Summary of the invention
Problem to be solved by this invention provides the implementation method that a kind of slip of being convenient to operate is controlled at terminal human-computer interaction.The control of sliding is a kind of novel man-machine interaction means, and it is intended in the slip of touch-screen terminal be carried out application controls by finger or stylus.
In order to solve above technical problem, the present invention at first carries out modularized design and realization to the control of sliding, and make it to be independent of any platform as far as possible, be independent of any application, thus can be by the loading of maximum degree of flexibility and use.Therefore, the core of the control of sliding is the slip control module, is called for short the slip control module, and slip control module and touch-screen carry out communication, the data that touch-screen sends is judged direction, the zone of control, thereby realize corresponding control operation.
The slip control module is supported four kinds of slip control operations, the respectively slip of corresponding four direction control, i.e. upwards slip control, downwards slip control, left slip control, slip control to the right.Each application can be registered this four kinds of slip control operations to the slip control module simultaneously.
The slip control module can provide the control device of different stage, the slip control that comprises distance-based and slip control based on the zone, and wherein, more condition is strict than the slip control of distance-based based on the slip control in zone.
This slip is controlled at the application process of terminal human-computer interaction, may further comprise the steps:
When A, application initializes, need to be to slip control module registration slip control callback operation;
B, when the touch-control data that touch-screen transmits are received in application, preferentially carry out slip control and judge;
If judging, the C slip control finds that this is once effective slip control, carries out the corresponding slip control callback operation of using previous registration so;
D, withdraw from application after, nullify registered sliding control callback operation.
In steps A,
Need to be to the slip control module declaration during application initializes: the slip control operation species that 1) needs application to use; 2) corresponding slip control operational motion; 3) slip control information, the control information of wherein sliding comprises:
1. the regional top left corner apex x coordinate figure of sliding control, the y coordinate figure.If based on the slip control in zone, this is essential option; If the slip control of distance-based, these two is 0.
2. sliding control summit, regional lower right corner x coordinate figure, the y coordinate figure.If based on the slip control in zone, this is essential option; If the slip control of distance-based, these two is the maximum of touch-screen size.
3. the effective length of sliding (pixel unit), essential option.
4. the stagger on the direction vertical with glide direction is apart from (pixel unit), essential option.
5. the speed of sliding (pixel/second unit), option.
Application can be simultaneously to 4 kinds of slip controls operations based on the zone of slip control module application for registration, and the coordinate in 4 slip control zones can be fully overlapping or be overlapped, in actual slide process, the slip control module can be according to sliding trace, intelligent decision and the situation of processing the slip control region overlapping.
In step B,
The touch-control data that the touch-screen transmission comes comprise that touch-control is pressed message (down), touch-control mobile messaging (move) lifts message (up) with touch-control, in the processing of these three kinds of message, all will preferentially slide control and judge.
(1) touch-control is pressed message:
For the slip control of distance-based, the direct start of record coordinate of slip control module;
For the slip control based on the zone, according to the slip control information of registration, the slip control module judges at first whether the contact falls within registered slip control zone.If the contact falls within arbitrary registered slip control zone, then recording the current coordinate in contact is starting point coordinate, otherwise mark epicycle slip control is invalid, and the epicycle slip control is judged end.
The contact may fall within a plurality of registered slip controls zone simultaneously, so the slip control module also needs to record the states such as affiliated area of contact.
(2) touch-control mobile messaging:
For the slip control of distance-based, this message does not process;
For the slip control based on the zone, the slip control module judges at first whether slip control takes place, and namely whether last contact has fallen within effective slip control zone, if slip control takes place, judges so more whether this contact still falls within these slip control zones.If, then continue slip control and judge, otherwise mark epicycle slip control being invalid, the epicycle slip control is judged end.
The contact may fall within a plurality of registered slip controls zone simultaneously, and in the process that move the contact, some slip control zone also may have been shifted out in the contact so, therefore needs the zone state of immediate updating contact.If the contact has moved into new slip control zone, new slip control zone is invalid in the epicycle slip control.
(3) touch-control lifts message:
For sliding control, directly write down terminal point coordinate based on distance;
For the slip control based on the zone, the slip control module judges at first whether slip control takes place, and namely whether last contact has fallen within effective slip control zone, if slip control takes place, judges so more whether this contact still falls within these slip control zones.If then recording the current coordinate in contact is terminal point coordinate, otherwise mark epicycle slip control is invalid, and the epicycle slip control is judged end.
After obtaining terminal point coordinate, according to the slip control information of using registration in starting point coordinate, terminal point coordinate and the steps A, sliding control module begins to confirm the action type of this skidding control, be to make progress to slide to control, control, slide left to control or slide to the right and control, and judge whether to satisfy sliding length condition and stagger condition, as if all satisfied to downslide, confirm that then this skidding control is finally effective, otherwise it is invalid to mark this skidding control, and end is judged in this skidding control.
In step C,
If judging, slip control finds that this is once effective slip control, carries out the corresponding slip control callback operation of using previous registration so; If find that the epicycle slip control is invalid, then carry out and use original touch-control processing.
Among the step D,
Withdraw from when using, application should be nullified the slip control operation to the slip control module, and the content of cancellation is:
1. with the slip control information zero clearing of describing in the steps A;
2. the slip control callback operation of registering in the steps A is emptied;
3. with the contact region state zero clearing of writing down among the step B.
The beneficial effect that the present invention has is:
Touch-screen man-machine interaction mode has been enriched in the introducing of slip control operation, for increasing new function point, terminal application software provides condition, and in specific terminal applies, provide point to touch the incomparable directly perceived quick effect of operation, it is more convenient, accurate to operate, and can be widely used in various touch-screen control terminals.
Embodiment
The present invention is described in further detail below in conjunction with the drawings and specific embodiments:
In this invention is in the embodiment 1, controls unlocking function with sliding of hand-hold communication appliance and specifies implementation procedure of the present invention.
According to Fig. 1, hand-hold communication appliance enters standby interface, i.e. standby is used and opened.Standby is used at first to slip control module registration slip control call back function (the slip control call back function comprises the data such as direction, slip control treatment state, slip control zone), direction is " slip control to the right ", the slip control readjustment is treated to " release ", the slip control zone is the rectangle of (0,50) to (200,150), it is the slip control that this slip control is based on the zone, effectively the slip control distance is 100 (pixels), and the swing allowable error is 50 (pixels), and slip control speed is 0.
According to Fig. 2, when finger or stylus in (50,60) when press the position, touch screen is processed code module and is detected touch-control and press message, preferentially carries out slip control and judges.
The slip control module at first inquire current have use the slip control registration, press coordinate and whether be positioned at registration slip control zone so judge touch-control, detect and find to press coordinate and be positioned at registration slip control zone, be starting point coordinate so record (50,60).
Finger or stylus are constantly mobile on screen, touch screen is processed code module, and (the slip control module is connected with touch screen and processes code module, process code module by touch screen and detect the touch-control mobile status) constantly detect the touch-control mobile messaging, so constantly carrying out slip control judges, carry out slip control at every turn and judge, the slip control module all will again detect new position of touch and whether still fall within registration slip control zone.Skid off registration slip control zone in case find touch-control, then the judgement of epicycle slip control is counted out and is finished, until touch-control lifts, the slip control call back function can not be performed yet.
When finger or stylus in (180,100) when lifting, touch screen is processed code module and is detected touch-control and lift message, judges so preferentially carry out slip control.This moment, the slip control module judged that lifting coordinate position still is positioned within the slip control zone of registration, and actual sliding length is 180 (pixels), actual stagger is 40 (pixels), satisfy sliding length condition and swing allowable error condition, so judge that slip control is finally effective, the slip control module is carried out to the right slip control call back function, i.e. unlocking function.
At last, the slip control module is finally carried out the notice touch screen and is processed code module, no longer carries out original touch-control and lifts the processing function.
The final successful implementation of slip control release.
In this working of an invention mode 2, cut the implementation procedure that the song function illustrates slip control with the slip control of touch mp4 equipment.
According to Fig. 1, touch mp4 opening of device, in player window, to the sliding control of sliding control module registration call back function, direction is " left " and " to the right ", sliding control readjustment is handled difference corresponding " playing last one first song " and " playing next song ", has only a first song as if current playing catalog or tabulation, then realizes the repeat playing of current song.The slip control region division is (0,0) to (128,160), i.e. the screen size of whole mp4 equipment, and namely this slip control is based on the slip control of distance.Effectively sliding control distance is 60 (pixels), and waving permissible error is 40 (pixels), and sliding control speed is 0.
According to Fig. 2, when finger or stylus when touch-screen is pressed, touch screen is processed code module and is detected touch-control and press message, preferentially carries out slip control and judges.The slip control module at first inquires the current slip control of the application registration that has, and is starting point coordinate so record the current coordinate (10,80) of pressing.
When finger or stylus constantly move on screen, because this is based on the slip control of distance, so the slip control module has been ignored the touch-control mobile messaging at this moment, be left intact, control is advised and is given original touch-control to move the processing function.
When the finger or stylus (100, when 70) lift the position, the current coordinate of slip control module records is terminal point coordinate, and through calculating, actual slip control length is 90 (pixels), actual rolling error is 10 (pixels), therefore be once effective slip control, because the x coordinate of terminal point is greater than the x coordinate of starting point, so this is once effective slip control to the right, therefore the slip control module is carried out slip control call back function to the right, namely " switches and plays next song ".
At last, the slip control module is finally carried out the notice touch screen and is processed code module, no longer carries out original touch-control and lifts the processing function.
Slip control is cut the final successful implementation of song.
The above only is preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of being done within the spirit and principles in the present invention, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.