The disclosure relates to the field of communications, in particular to a method and device for determining a cursor display position.
For the current mobile terminal (for example, intelligent mobile phone), if a user need to edit text (for example, sending a message) on it, then an editable area will be formed on the screen of the mobile terminal, and a blinking cursor will also appear in this editable area. With the increase of the text input by the user, the cursor generally moves along the direction where the text increases (for example, moving to the right). When the user realizes that there is a spelling mistake or several characters are missing in the edited text, the following two methods would be adopted generally:
method 1, clicking a text area which needs to be amended directly via a touch medium, for example: the IOS system used in I-phone. The defect of this method lies in not being able to accurately click the text area which needs to be added or amended;
method 2, enabling the cursor to move left and right on the screen by dragging the cursor, until it is moved to the text area which need to be added or amended, and the cursor stops moving when the touch medium leaves the touch screen, for example, the Android system used in most mobile phones. The defect of this method lies in that if the current position of the cursor is far away from the text area which needs to be added or amended, then the touch medium should always execute the operation of dragging the cursor on the touch screen, the operation process of which is complicated.
The present invention provides a cursor display position determination method and device, so as to at least solve the problem in related art that the operation of moving a cursor in an editable area of a mobile terminal is complicated.
According to one embodiment of the present invention, a cursor display position determination method is provided.
The cursor display position determination method according to the present invention comprises: when the duration of a contact of a touch medium with a click position in an editable area on a mobile terminal screen is longer than a preset duration, acquiring the click position and the sliding direction of the touch medium starting from the click position; determining the movement direction of the cursor according to the click position and the sliding direction; and moving the cursor to the position to be displayed according to the movement direction.
Preferably, determining the movement direction of a cursor according to the click position and the sliding direction comprises: determining an end position of a sliding operation according to the click position and the sliding direction; and determining the movement direction of the cursor according to the acquired click position and the end position.
Preferably, determining the movement direction of a cursor according to the acquired click position and the end position comprises: acquiring the coordinate of the click position and the coordinate of the end position; calculating an included angle between the vector displacement from the click position to the end position and a positive coordinate axis, the origin of the coordinates of which is the click position, according to the coordinate of the acquired click position and the coordinate of the end position; and determining the movement direction of the cursor according to the calculated included angle.
Preferably, determining the movement direction of the cursor according to the calculated included angle comprises one of the following: if 2kπ−π/4<α≦2kπ+π/4, then determining that the movement direction of the cursor is to the right; if 2kπ+π/4<α≦2kπ+3π/4, then determine that the movement direction of the cursor is upward; if 2kπ+3π/4<α≦2kπ+5π/4, then determine that the movement direction of the cursor is to the left; if 2kπ+5π/4<α≦2kπ+7π/4, then determine that the movement direction of the cursor is downward, where k is an arbitrary integer, π is 180 degree, and α is the included angle.
Preferably, moving the cursor to the position to be displayed according to the movement direction comprises: moving the cursor along the movement direction starting from the click position according to a preset frequency; and in response to the movement end operation of the touch medium, determining that the display position of the cursor in the editable area at present is the position to be displayed.
Preferably, moving the cursor to the position to be displayed according to the movement direction comprises: determining the duration of sliding according to the click position and the sliding direction; calculating the number of times of movement according to the duration of sliding and the preset movement frequency; and moving the cursor along the movement direction starting from the click position according to the calculated number of times of movement, and determining that the display position of the cursor in the editable area at present is the position to be displayed.
Preferably, after moving the cursor to the position to be displayed according to the movement direction, the method further comprises: recording the number of times of the touch medium executing a sliding operation on the mobile terminal screen; and when the number of times of sliding operation exceeds a preset number of times, adjusting the preset movement frequency.
According to another embodiment of the present invention, a cursor display position determination device is provided.
The cursor display position determination device according to the present invention comprises: an acquisition module, configured to, when the duration of a contact of a touch medium with a click position in an editable area on a mobile terminal screen is longer than a preset duration, acquire the click position and the sliding direction of the touch medium starting from the click position; a determination module, configured to determine the movement direction of the cursor according to the click position and the sliding direction; and an execution module, configured to move the cursor to the position to be displayed according to the movement direction.
Preferably, the determination module comprises: a first determination unit, configured to determine an end position of a sliding operation according to the click position and the sliding direction; and a second determination unit, configured to determine the movement direction of the cursor according to the acquired click position and the end position.
Preferably, the second determination unit comprises: a first acquisition unit, configured to acquire the coordinate of the click position and the coordinate of the end position; a first calculation unit, configured to calculate an included angle between the vector displacement from the click position to the end position and a positive coordinate axis, the origin of the coordinates of which is the click position, according to the coordinate of the acquired click position and the coordinate of the end position; and a third determination unit, configured to determine the movement direction of the cursor according to the calculated included angle.
Preferably, the third determination unit is configured to, if 2kπ−π/4<α≦2kπ+π/4, then determine that the movement direction of the cursor is to the right; or if 2kπ+π/4<α≦2kπ+3π/4, then determine that the movement direction of the cursor is upward; or if 2kπ+3π/4<α≦2kπ+5π/4, then determine that the movement direction of the cursor is to the left; or if 2kπ+5π/4<α≦2kπ+7π/4, then determine that the movement direction of the cursor is downward, where k is an arbitrary integer, π is 180 degree, and α is the included angle.
Preferably, the execution module comprises: a movement unit, configured to move the cursor along the movement direction starting from the click position according to a preset frequency; and a fourth determination unit, configured to, in response to the movement end operation of the touch medium, determine that the display position of the cursor in the editable area at present is the position to be displayed.
Preferably, the execution module further comprises: a fifth determination unit, configured to determine a duration of sliding according to the click position and the sliding direction; and a second calculation unit, configured to calculate the number of times of movement according to the duration of sliding and the preset movement frequency; and a sixth determination unit, configured to move the cursor along the movement direction starting from the click position according to the calculated number of times of movement, and determining that the display position of the cursor in the editable area at present is the position to be displayed.
Preferably, the above-mentioned device further comprises: a recording module, configured to record the number of times of the touch medium executing a sliding operation on the mobile terminal screen; and an adjustment module, configured to, when the number of times of sliding operation exceeds a preset number of times, adjust the preset movement frequency.
By means of the present invention, the touch medium click the editable area of the mobile terminal, and if the contact duration of the touch medium with the click position exceeds the preset duration, then a sliding operation is executed starting from the click position, and finally it is possible to determine the movement of the cursor in a specific direction according to the click position and sliding direction, until the cursor is moved to the position where the user wants to edit the text; the problem that the operation of moving a cursor in an editable area of a mobile terminal is complicated, thereby effectively viewing the whole text-editing interface via the automatic movement of the cursor, thus facilitating the positioning of the cursor with a simple operation.
Drawings, provided for further understanding of the disclosure and forming a part of the specification, are used to explain the disclosure together with embodiments of the disclosure rather than to limit the disclosure. In the drawings:
The disclosure is described below with reference to the accompanying drawings and embodiments in detail. Note that, the embodiments of the disclosure and the features of the embodiments can be combined with each other if there is no conflict.
step S102: when the duration of a contact of a touch medium with a click position in an editable area on a mobile terminal screen is longer than a preset duration, acquiring the click position and the sliding direction of the touch medium starting from the click position;
step S104: determining the movement direction of the cursor according to the click position and sliding direction; and
step S106: moving the cursor to the position to be displayed according to the movement direction.
In the related art, the operation of moving a cursor in an editable area of a mobile terminal is complicated. By means of the invention shown in
Preferably, in step S104, determining the movement direction of the cursor according to the click position and the sliding direction can comprise the following operations:
step S1: determining an end position of a sliding operation according to the click position and the sliding direction; and
step S2: determining the movement direction of the cursor according to the acquired click position and the end position.
In a preferred embodiment, the click position can be used as the origin of coordinates to establish the horizontal axis and the vertical axis, and at the same time, the ray emitted from the click position passes through the end position; and the movement direction of the cursor can be determined according to the included angle between the ray and the horizontal axis or vertical axis.
In a preferred implementation, in step S2 mentioned above, determining the movement direction of the cursor according to the acquired click position and the end position can comprise the following steps:
step S21: acquiring the coordinate of the click position and the coordinate of the end position;
step S22: calculating an included angle between the vector displacement from the click position to the end position and a positive coordinate axis, the origin of the coordinates of which is the click position, according to the coordinate of the acquired click position and the coordinate of the end position; and
step S23: determining the movement direction of the cursor according to the calculated included angle.
In the preferred embodiment, it is assumed that the coordinates of the click position are A (x1, y1), and the coordinates of the end position are B (x2, y2), then the vector displace AB (x2−x1, y2−y1) can be calculated. The included angle α between AB and the positive horizontal axis the origin of which is point A can be calculated by means of the trigonometric function formula, for example, using the formula α=arctan((y2−y1)/(x2−x1)). Of course, A can also be taken as the origin of coordinates (0, 0), then the vector displacement AB=(x2, y2). Now, the formula can be simplified as α=arctan (y2/x2).
In a preferred implementation, in step S23, determining the movement direction of the cursor according to the calculated included angle can comprise one of the following processing: if 2kπ−π/4<α≦2kπ+π/4, then determining that the movement direction of the cursor is to the right; if 2kπ+π/4<α≦2kπ+3π/4, then determine that the movement direction of the cursor is upward; if 2kπ+3π/4<α≦2kπ+5π/4, then determine that the movement direction of the cursor is to the left; if 2kπ+5π/4<α≦2kπ+7π/4, then determine that the movement direction of the cursor is downward, where k is an arbitrary integer, π is 180 degree, and α is the included angle.
In a preferred embodiment, the click position can be adopted as the origin of coordinates, rays are emitted from the origin along the −45 degree, the 45 degree, the 135 degree and 225 degree, respectively, which divide each quadrant. If 2kπ−π/4<α≦2kπ+π/4, which indicates that the sliding direction is more close to the positive horizontal axis, then it can be determined that the movement direction in the next step is to the right; if 2kπ+π/4<α≦2kπ+3π/4, which indicates that the sliding direction is more close to the positive vertical axis, then it can be determined that the movement direction in the next step is upward; if 2kπ+3π/4<α≦2kπ+5π/4, which indicates that the sliding direction is more close to the negative horizontal axis, then it is determined that the movement direction of the cursor is to the left; and if 2kπ+5π/4<α≦2kπ+7π/4, which indicates that the sliding direction is more close to the negative vertical axis, then it is determined that the movement direction of the cursor is downward.
In a preferred embodiment, if the text needs to be edited by the user is in the upper right of the current position of the cursor, the user will consciously perform a sliding operation from the cursor position to the upper right. At this moment, it is required to determine the end position of this sliding operation, and then the current movement direction is determined according to the included angle formed by the vector displace, which is formed by the start position and the end position, with the positive axis of the X axis. For example, when the currently calculated included angle is between −45 degree and 45 degree, the cursor will move right in a preset movement frequency. In response to the click operation of the user on any position of the touch screen, the movement is stopped; and then the touch medium clicks the position where the cursor is located at present, and now the cursor position can be taken at the current click position. Which range the included angle formed by the vector displacement, which is from the position where the cursor is located to the end position, with the positive axis of the X axis falls into is judged according to the sliding operation executed again by the user It is found that the included angle is between positive 45 degree and positive 135 degree after calculation, then it can be determined that the cursor is to move upward. Now, the cursor moves upward in a preset movement frequency; and when the cursor has moved to the text which needs to be edited by the user, the movement is stopped in response to the click operation of the user at any position on the touch screen, and the user can continue to input text.
Preferably, in step S106, moving the cursor to the position to be displayed according to the movement direction can comprise the following operations:
step S3: moving the cursor along the movement direction starting from the click position according to a preset frequency; and
step S4: in response to the movement end operation of the touch medium, determining that the display position of the cursor in the editable area at present is the position to be displayed.
In a preferred embodiment, the user can set the frequency of the autoscroll of the cursor, for example, automatically moving for 3 times every second. When editing the text in an application interface, for example, short message input and notepad input, the cursor will appear immediately; in addition to this, in other scenarios, for example: viewing a record, a cursor will also appear when the text a some place is clicked, and the current cursor state can be named as state_cursor_idle in the preferred embodiment. Touch and long press the position where the cursor is located, and slide upwards, the cursor will scroll forward from the positioned position automatically in a preset frequency (for example, 3 times/s), and the current cursor state can be named as state_cursor_automove_front in the preferred embodiment; Touch and long press the position where the cursor is located, and slide downwards, the cursor will scroll backward from the positioned position automatically in a preset frequency (for example, 3 times/s), and the current cursor state can be named as state_cursor_automove_back in the preferred embodiment. When the user sees that the cursor has moved to the position of the text to be edited automatically, light touch any position on the screen, the automatic scrolling of the cursor will stop, and now the cursor state automatically recovers to state_cursor_idle again.
In a preferred embodiment,
Preferably, in step S106, moving the cursor to the position to be displayed according to the movement direction can further comprise the following operations:
step S5: determining the duration of sliding according to the click position and the sliding direction;
step S6: calculating the number of times of movement according to the duration of sliding and the preset movement frequency; and
step S7: moving the cursor along the movement direction starting from the click position according to the calculated number of times of movement, and determining that the display position of the cursor in the editable area at present is the position to be displayed.
In a preferred embodiment, the sliding trace of the touch medium on the touch screen can be determined according to the click position and sliding direction, and the duration of sliding can be determined according to the starting position and end position of the sliding trace, the number of times of movement of the cursor corresponding to each sliding operation can be calculated according to the duration of sliding and preset frequency, and the cursor moves along the movement direction starting from the click position according to the calculated number of times of movement and determine the display position of the cursor in the editable area.
For example, it is determined that the duration of sliding is 2s according to the touch trace of the touch medium, and the preset frequency of the mobile terminal is 3 times/s, it can be calculated that the number of times of movement is 6 times. If the sliding direction is upward, then the cursor will automatically move upward for 6 times, and if the cursor moves 1 line each time, then the cursor will move upward for 6 lines.
Preferably, in step S106, after moving the cursor to the position to be displayed according to the movement direction, the method can further comprise the following operations:
step S8: recording the number of times of the touch medium executing a sliding operation on the mobile terminal screen; and
step S9: when the number of times of sliding operation exceeds a preset number of times, adjusting the preset movement frequency.
In a preferred embodiment, a mobile terminal can record the number of time of the sliding operation executed by the touch medium, for example, when the touch medium slides upward once, but does not arrive at the text position the user desires, at this moment, the user will continue to execute the operation of sliding upward, so that the cursor continues to move upward; in this way, every time the touch medium slide once, the number recorded by the mobile plus one; if the number of times of sliding operation executed by the touch medium exceeds the preset number of times (for example, 3 times), then it indicates that the current preset frequency does not satisfy the requirement of the user, now the mobile terminal can automatically adjust the preset frequency from 3 times/s to 4 times/s,
Further description is made to the above-mentioned preferred implementation in combination with the preferred embodiment shown in
step S302: the touch medium clicking the editable area of the mobile terminal screen;
step S304: judging the current state of the cursor, if it is state_cursor_automove_front or state_cursor_automove_back, then continuing to execute step S306; and if not, then turning to step S310;
step S306: the cursor scrolling automatically, until it stops scrolling in response to the click operation of the touch medium;
step S308: the state of the cursor being state_cursor_automove_idle;
step S310: judging whether the click position is in the editable area; if yes, then continuing to execute step S312; and if not, then turning to step S314;
step S312: the cursor moving the current click position of the touch medium; and turning to step S308; and
step S314: the position of the cursor not changing; and turning to step S308.
By means of the device shown in
Preferably, as shown in
Preferably, as shown in
In the preferred implementation, the above-mentioned third determination unit 2024 is configured to, if 2kπ−π/4<α≦2kπ+π/4, then determine that the movement direction of the cursor is to the right; or if 2kπ+π/4<α≦2kπ+3π/4, then determine that the movement direction of the cursor is upward; or if 2kπ+3π/4 <α≦2kπ+5π/4, then determine that the movement direction of the cursor is to the left; or if 2kπ+5π/4<α≦2kπ+7π/4, then determine that the movement direction of the cursor is downward, where k is an arbitrary integer, π is 180 degree, and α is the included angle.
Preferably, as shown in
Preferably, as shown in
Preferably, as shown in
It needs to be noted that the preferred operation mode of interaction of each module and each unit shown in
It can be seen from the description above that the above-mentioned embodiment has realized the following technical effect (it needs to be noted that these effects are effects that can be arrived by some preferred embodiments): effective viewing of the whole text-editing interface via the automatic movement of the cursor, thus facilitating the positioning of the cursor with a simple operation.
Obviously, those skilled in the art should know that each of the mentioned modules or steps of the disclosure can be realized by universal computing devices; the modules or steps can be focused on single computing device, or distributed on the network formed by multiple computing devices; selectively, they can be realized by the program codes which can be executed by the computing device; thereby, the modules or steps can be stored in the storage device and executed by the computing device; and under some circumstances, the shown or described steps can be executed in different orders, or can be independently manufactured as each integrated circuit module, or multiple modules or steps thereof can be manufactured to be single integrated circuit module, thus to be realized. In this way, the disclosure is not restricted to any particular hardware and software combination.
The descriptions above are only the preferable embodiment of the disclosure, which are not used to restrict the disclosure, for those skilled in the art, the disclosure may have various changes and variations. Any amendments, equivalent substitutions, improvements, etc. within the principle of the disclosure are all included in the scope of the protection of the disclosure.
Number | Date | Country | Kind |
---|---|---|---|
201210205397.9 | Jun 2012 | CN | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/CN2013/076084 | 5/22/2013 | WO | 00 |