A kind of single smart key implementation method, device and portable terminal
Technical field
The present invention relates to communication technical field, more particularly, relate to a kind of single smart key implementation method, device and portable terminal.
Background technology
Along with science and technology is growing, the application function of portable terminal is more and more abundanter, and a lot of application functions realize all needing to carry out page turn over operation, such as the e-book reading function etc.In existing smart mobile phone, generally be to provide " page up " and " lower one page " two to control button at the application function interface, realize respectively forward page turning and the function of page turning backward, and can't realize simultaneously forward page turning and the function of page turning backward by a button.
Summary of the invention
The technical problem to be solved in the present invention is, for the defects of prior art, provides a kind of single smart key implementation method, device and portable terminal.
The technical solution adopted for the present invention to solve the technical problems is:
Construct a kind of single smart key implementation method, wherein, may further comprise the steps:
Detect the slide information on the single sliding button, described slide information comprises sliding distance and sliding speed;
Judge whether described sliding distance reaches default sliding distance threshold value;
If described sliding distance reaches default sliding distance threshold value, judge further that then whether described sliding speed is greater than default sliding speed higher limit;
In described sliding speed during greater than default sliding speed higher limit, the current slide that then will detect is as fast slide, otherwise judges that whether described sliding speed is less than default sliding speed lower limit;
During less than default sliding speed lower limit, the current slide that then will detect is as slow slide in described sliding speed;
Type according to current slide is carried out default triggering task.
Whether single smart key implementation method of the present invention: detecting has length by event on the single sliding button if wherein, also comprising step before the step of the slide information on the single sliding button of described detection.
Single smart key implementation method of the present invention, wherein, the step that described type according to current slide is carried out default triggering task specifically comprises:
When described single sliding button does not have length to be not fast slide by event and described current slide, carry out the first kind and trigger task;
When described single sliding button does not have length to be not slow slide by event and described current slide, carry out Equations of The Second Kind and trigger task;
When described single sliding button has length to be slow slide by event and described current slide, carry out the 3rd class and trigger task;
When described single sliding button has length to be fast slide by event and described current slide, carry out the 4th class and trigger task.
Single smart key implementation method of the present invention, wherein, the described first kind triggers task, Equations of The Second Kind triggers in task, the 3rd class triggering task and the 4th class triggering task and comprises respectively the different subtasks corresponding from the slide that slides and slide left to the right.
Single smart key implementation method of the present invention, wherein, described first kind triggering task is: stir to the left or to the right one page according to the current slide control page;
Described Equations of The Second Kind triggering task is: roll to the left or to the right according to the current slide control page;
Described the 3rd class triggering task is: the sliding distance of current slide is converted into the number of pages of stirring forward or backward according to preset ratio, and carries out;
Described the 4th class triggering task is: directly stir forward or backward default number of pages according to current slide, perhaps, directly stir forward or backward chapters and sections according to current slide.
The present invention also provides a kind of single smart key implement device, wherein, comprising:
First detection module, for detection of the slide information on the single sliding button, described slide information comprises sliding distance and sliding speed;
The first judge module is used for judging whether described sliding distance reaches default sliding distance threshold value;
The second judge module, be used for when described sliding distance reaches default sliding distance threshold value, judge that further whether described sliding speed is greater than default sliding speed higher limit, if the current slide that described sliding speed greater than default sliding speed higher limit, then will detect is as fast slide;
The 3rd judge module, be used for when described sliding speed is not more than default sliding speed higher limit, judge that whether described sliding speed is less than default sliding speed lower limit, if the current slide that described sliding speed less than default sliding speed lower limit, then will detect is as slow slide;
Execution module is used according to the type of current slide and is carried out default triggering task.
Single smart key implement device of the present invention, whether wherein, described device also comprises the second detection module, long by event for detection of having on the single sliding button.
Single smart key implement device of the present invention, wherein, described execution module comprises:
First triggers subelement, is used for carrying out the first kind and triggering task when described single sliding button does not have length to be not fast slide by event and described current slide;
Second triggers subelement, is used for carrying out Equations of The Second Kind and triggering task when described single sliding button does not have length to be not slow slide by event and described current slide;
The 3rd triggers subelement, is used for carrying out the 3rd class and triggering task when described single sliding button has length to be slow slide by event and described current slide;
The 4th triggers subelement, is used for carrying out the 4th class and triggering task when described single sliding button has length to be fast slide by event and described current slide.
Single smart key implement device of the present invention, wherein, described first kind triggering task is: stir to the left or to the right one page according to the current slide control page;
Described Equations of The Second Kind triggering task is: roll to the left or to the right according to the current slide control page;
Described the 3rd class triggering task is: the sliding distance of current slide is converted into the number of pages of stirring forward or backward according to preset ratio, and carries out;
Described the 4th class triggering task is: directly stir forward or backward default number of pages according to current slide, perhaps, directly stir forward or backward chapters and sections according to current slide.
The present invention also provides a kind of portable terminal, wherein, comprises such as each described single smart key implement device of front.
Beneficial effect of the present invention is: by detecting the slide information on the single sliding button, and slide information is divided into fast slide and slow slide at least, whether perhaps further detect has length by event on the single sliding button, and will grow to combine by event and fast slide, slow slide and trigger multiple different default triggering task, thereby realize the several functions of single sliding button, enrich user's experience.
Description of drawings
The invention will be further described below in conjunction with drawings and Examples, in the accompanying drawing:
Fig. 1 is the single smart key implementation method process flow diagram of preferred embodiment of the present invention;
Fig. 2 is the single smart key implement device theory diagram of preferred embodiment of the present invention.
Embodiment
The single smart key implementation method flow process of preferred embodiment of the present invention may further comprise the steps as shown in Figure 1: the slide information on S1, the single sliding button of detection, and slide information comprises sliding distance and sliding speed; S2, judge whether sliding distance reaches default sliding distance threshold value; If the S3 sliding distance reaches default sliding distance threshold value, whether then further judge sliding speed greater than default sliding speed higher limit, otherwise do not carry out any operation; If the current slide that the S4 sliding speed greater than default sliding speed threshold value, then will detect is as fast slide; S5 otherwise the current slide that will detect are as slow slide; S6, carry out default triggering task according to the type of current slide, thereby realize the several functions of single sliding button, enrich user's experience.
In the method for above-described embodiment, the sliding distance threshold value can be system's sliding distance default according to single sliding button, when the sliding distance of actual slide during greater than this default sliding distance, just think effective slide, thereby be determined further, otherwise think invalid slide, do not do any reaction.Above-mentioned sliding speed threshold value also can be preseted by the user, slide is divided into dissimilar according to the slide that detects and the sliding speed threshold value comparative result of presetting, and can preset the triggering task corresponding with dissimilar slides, thereby realize the different Trigger Functions of single sliding button, replace two or more button of the prior art.
For obtaining how different slide types, whether preferably, in the method for above-described embodiment, the step that detects the slide information on the single sliding button: detecting has length by event on the single sliding button if also comprising step before.This length is specially Long contact time information on above-mentioned single sliding button by event, can set when duration of contact to surpass Preset Time (for example 3 seconds) Shi Weichang by event.Combine with the judged result of above-mentioned fast slide and slow slide by the event detection result long, can obtain following at least four kinds of different trigger conditions: 1, not long by event on the single sliding button, and current slide is as fast slide; 2, not long by event on the single sliding button, and current slide is as slow slide; 3, length is arranged by event on the single sliding button, and current slide is as slow slide; 4, length is arranged by event on the single sliding button, and current slide is as fast slide.
Further, in the method for above-described embodiment, the step of carrying out default triggering task according to the type of current slide specifically comprises: when single sliding button does not have length to be not fast slide by event and current slide, carry out the first kind and trigger task; When single sliding button does not have length to be not slow slide by event and current slide, carry out Equations of The Second Kind and trigger task; When single sliding button has length to be slow slide by event and current slide, carry out the 3rd class and trigger task; When single sliding button has length to be fast slide by event and current slide, carry out the 4th class and trigger task.Wherein, the above-mentioned first kind triggers task, Equations of The Second Kind triggering task, the 3rd class triggers task and the 4th class triggering task can be the different task of setting according to different application functions.
Further, the above-mentioned first kind triggers task, Equations of The Second Kind triggers in task, the 3rd class triggering task and the 4th class triggering task and comprises respectively the different subtasks corresponding from the slide that slides and slide left to the right, be that above-mentioned four generic tasks can be decomposed into again eight kinds of tasks, concrete task definition also can be set according to different application functions.Take the e-book reading interface as example, can be according to user's to the left or to the right page turning of slide, different slide types can corresponding different page-turning speed.
Particularly, above-mentioned first kind triggering task is: stir to the left or to the right one page according to the current slide control page.That is, when single sliding button does not have length to be not fast slide by event and current slide, directly control the page and turn over a page to the left or to the right.
Above-mentioned Equations of The Second Kind triggering task is: roll to the left or to the right according to the current slide control page.Namely, when single sliding button does not have length to be not slow slide by event and current slide, controlling the page according to the sliding distance of current slide rolls to the left or to the right, when slide slides into the other end by an end of above-mentioned single sliding button, then turn over a page to the left or to the right.
Above-mentioned the 3rd class triggering task is: the sliding distance of current slide is converted into the number of pages of stirring forward or backward according to preset ratio, and carries out.Namely, when single sliding button has length to be slow slide by event and current slide, control the number of pages that the page stirs to the left or to the right according to the sliding distance of current slide, concrete number of pages can by system's setting, also can be arranged by user oneself.For example, can set when sliding into the other end from an end of above-mentioned single sliding button, can climb over 10 pages, 20 pages etc.
Above-mentioned the 4th class triggering task is: directly stir forward or backward default number of pages according to current slide, perhaps, directly stir forward or backward chapters and sections according to current slide.That is, when single sliding button has length to be fast slide by event and current slide, can set at faster speed page turning, for example directly climb over chapters and sections.
In another embodiment of the present invention, a kind of single smart key implement device also is provided, as shown in Figure 2, comprising: first detection module 10, for detection of the slide information on the single sliding button, slide information comprises sliding distance and sliding speed; The first judge module 20 is used for judging whether sliding distance reaches default sliding distance threshold value; The second judge module 30, be used for when sliding distance reaches default sliding distance threshold value, judge that further whether sliding speed is greater than default sliding speed higher limit, if sliding speed is greater than default sliding speed higher limit, the current slide that then will detect is as fast slide, otherwise the current slide that will detect is as slow slide; Execution module 40 is used according to the type of current slide and is carried out default triggering task, thereby realizes the several functions of single sliding button, enriches user's experience.
In the device of above-described embodiment, similarly, the sliding distance threshold value can be system's sliding distance default according to single sliding button, when the sliding distance of actual slide during greater than this default sliding distance, just think effective slide, thereby be determined further, otherwise think invalid slide, do not do any reaction.Above-mentioned sliding speed threshold value also can be preseted by the user, slide is divided into dissimilar according to the slide that detects and the sliding speed threshold value comparative result of presetting, and can preset the triggering task corresponding with dissimilar slides, thereby realize the different Trigger Functions of single sliding button, replace two or more button of the prior art.
Whether further, said apparatus also comprises the second detection module 50, long by event for detection of having on the single sliding button.This length is specially Long contact time information on above-mentioned single sliding button by event, can set when duration of contact to surpass Preset Time (for example 3 seconds) Shi Weichang by event.Combine with the judged result of above-mentioned fast slide and slow slide by the event detection result long, can obtain following at least four kinds of different trigger conditions: 1, not long by event on the single sliding button, and current slide is as fast slide; 2, not long by event on the single sliding button, and current slide is as slow slide; 3, length is arranged by event on the single sliding button, and current slide is as slow slide; 4, length is arranged by event on the single sliding button, and current slide is as fast slide.
In the device of above-described embodiment, execution module 40 comprises: first triggers subelement, is used for carrying out the first kind and triggering task when single sliding button does not have length to be not fast slide by event and current slide; Second triggers subelement, is used for carrying out Equations of The Second Kind and triggering task when single sliding button does not have length to be not slow slide by event and current slide; The 3rd triggers subelement, is used for carrying out the 3rd class and triggering task when single sliding button has length to be slow slide by event and current slide; The 4th triggers subelement, is used for carrying out the 4th class and triggering task when single sliding button has length to be fast slide by event and current slide.Wherein, the above-mentioned first kind triggers task, Equations of The Second Kind triggering task, the 3rd class triggers task and the 4th class triggering task can be the different task of setting according to different application functions.
The above-mentioned first kind triggers task, Equations of The Second Kind triggers in task, the 3rd class triggering task and the 4th class triggering task and comprises respectively the different subtasks corresponding from the slide that slides and slide left to the right, be that above-mentioned four generic tasks can be decomposed into again eight kinds of tasks, concrete task definition also can be set according to different application functions.Take the e-book reading interface as example, can be according to user's to the left or to the right page turning of slide, different slide types can corresponding different page-turning speed.
Particularly, in the device of above-described embodiment, first kind triggering task is: roll to the left or to the right according to the current slide control page; Equations of The Second Kind triggering task is: stir to the left or to the right one page according to the current slide control page; The 3rd class triggering task is: the sliding distance of current slide is converted into the number of pages of stirring forward or backward according to preset ratio, and carries out; The 4th class triggering task is: directly stir forward or backward default number of pages according to current slide, perhaps, directly stir forward or backward chapters and sections according to current slide.Specifically see also the description of preceding method embodiment, be not repeated herein.
In another embodiment of the present invention, a kind of portable terminal also is provided, comprising such as the described single smart key implement device of the arbitrary embodiment in front, specifically can participate in aforementioned each embodiment, be not repeated herein.The portable terminal of present embodiment is preferably mobile phone.
To sum up, the present invention is by detecting the slide information on the single sliding button, and slide information is divided into fast slide and slow slide at least, whether perhaps further detect has length by event on the single sliding button, and will grow to combine by event and fast slide, slow slide and trigger multiple different default triggering task, thereby realize the several functions of single sliding button, enrich user's experience.
Should be understood that, for those of ordinary skills, can be improved according to the above description or conversion, and all these improvement and conversion all should belong to the protection domain of claims of the present invention.