Cursor control method and device, electronic equipment and storage medium
By receiving cursor movement instructions in an electronic device and judging the edge area, and adjusting the cursor movement distance, the problem of the cursor sliding out of the interface in the edge area is solved, and the consistency and user experience of cursor movement are improved.
Patent Information
- Application Number
- CN202310869937.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-14
- Publication Date
- 2025-01-14
Smart Images

Figure CN119311193A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of display control technology, and in particular to a cursor control method and device, an electronic device, and a storage medium. Background Art
[0002] In the field of electronic devices such as smart phones, laptops, and wearable devices based on augmented reality (AR) technology and virtual reality (VR) technology, users can achieve human-computer interaction through a cursor in the display interface of the electronic device; wherein, the user can control the movement of the cursor by operating on the display interface of the electronic device; or, the user can achieve cursor movement in the display interface of the head-mounted display device by operating on a touch pad of the head-mounted display device, such as on a mobile phone screen, to simulate.
[0003] However, in the process of controlling the movement of the cursor on the display interface, when the cursor is dragged close to the edge of the display interface, it will be treated as the user raising his hand, interrupting the movement of the cursor, causing the user to be unable to continue to control the movement of the cursor, seriously affecting the user's experience. Summary of the invention
[0004] The present disclosure provides a cursor control method and device, an electronic device, and a storage medium.
[0005] According to a first aspect of an embodiment of the present disclosure, a cursor control method is provided, which is applied to a first electronic device, and includes:
[0006] Receiving a movement instruction of a cursor on a display interface of the first electronic device;
[0007] Determining whether the cursor is located in an edge area of the display interface;
[0008] In response to the cursor being located in the edge area, the cursor is controlled to move according to the movement instruction; wherein the movement distance of the cursor is less than the distance indicated by the movement instruction.
[0009] In some embodiments, in response to the cursor being located in the edge area, controlling the cursor to move according to the movement instruction includes:
[0010] In response to the cursor being located in the edge area, the cursor is controlled to move according to the movement instruction and the distance of the cursor relative to the outer edge of the edge area; wherein the distance of the cursor movement is positively correlated with the distance of the cursor from the outer edge of the edge area.
[0011] In some embodiments, the movement instruction carries movement distance information; and controlling the movement of the cursor according to the movement instruction and the distance of the cursor relative to the outer edge of the edge area includes:
[0012] determining a distance weight according to the distance of the cursor relative to the outer edge of the edge area;
[0013] Determine the target moving distance according to the distance weight and the moving distance information;
[0014] The cursor is controlled to move according to the target moving distance.
[0015] In some embodiments, determining the distance weight according to the distance of the cursor relative to the outer edge of the edge area includes:
[0016] Determine a ratio of a distance of the cursor relative to an outer edge of the edge area to a width of the edge area;
[0017] The distance weight is determined according to the ratio; wherein the distance weight is positively correlated with the ratio.
[0018] In some embodiments, determining the distance weight according to the ratio includes:
[0019] The ratio is squared using a preset square root function to obtain the distance weight; wherein the number of square roots of the preset square root function is greater than a preset number threshold.
[0020] In some embodiments, the movement distance information includes a movement distance in a preset direction;
[0021] The determining of the distance weight according to the distance of the cursor relative to the outer edge of the edge area includes:
[0022] Determining a distance weight corresponding to the preset direction according to the distance of the cursor relative to the outer edge of the edge area in the preset direction;
[0023] The step of determining the target moving distance according to the distance weight and the moving distance information includes:
[0024] The target moving distance of the cursor in the preset direction is determined according to the moving distance in the preset direction and the distance weight corresponding to the preset direction.
[0025] In some embodiments, the method further comprises:
[0026] In response to the cursor being located in an area outside the edge area, the cursor is controlled to move a distance indicated by the movement instruction.
[0027] In some embodiments, the receiving an instruction to move a cursor on a display interface of the first electronic device includes:
[0028] The movement instruction sent by the second electronic device is received; wherein the movement instruction is generated by the second electronic device based on the detected touch operation.
[0029] According to a second aspect of an embodiment of the present disclosure, a cursor control device is provided, which is applied to a first electronic device, including:
[0030] A receiving module, configured to receive a movement instruction for a cursor on a display interface of the first electronic device;
[0031] A determination module, used to determine whether the cursor is located in an edge area of the display interface;
[0032] The first moving module is used to control the movement of the cursor according to the moving instruction in response to the cursor being located in the edge area; wherein the moving distance of the cursor is less than the distance indicated by the moving instruction.
[0033] In some embodiments, the first moving module is used to control the movement of the cursor in response to the cursor being located in the edge area according to the movement instruction and the distance of the cursor relative to the outer edge of the edge area; wherein the distance of the cursor movement is positively correlated with the distance of the cursor from the outer edge of the edge area.
[0034] In some embodiments, the movement instruction carries movement distance information;
[0035] The first moving module is used to determine a distance weight according to the distance of the cursor relative to the outer edge of the edge area; determine a target moving distance according to the distance weight and the moving distance information; and control the cursor to move according to the target moving distance.
[0036] In some embodiments, the first moving module is used to determine the ratio of the distance of the cursor relative to the outer edge of the edge area to the width of the edge area; determine the distance weight based on the ratio; wherein the distance weight is positively correlated with the ratio.
[0037] In some embodiments, the first moving module is used to perform square root processing on the ratio using a preset square root function to obtain the distance weight; wherein the number of square roots of the preset square root function is greater than a preset number threshold.
[0038] In some embodiments, the movement distance information includes a movement distance in a preset direction;
[0039] The first moving module is used to determine the distance weight corresponding to the preset direction according to the distance of the cursor relative to the outer edge of the edge area in the preset direction; and determine the target moving distance of the cursor in the preset direction according to the moving distance in the preset direction and the distance weight corresponding to the preset direction.
[0040] In some embodiments, the apparatus further comprises:
[0041] The second moving module is used for controlling the cursor to move a distance indicated by the moving instruction in response to the cursor being located in an area outside the edge area.
[0042] In some embodiments, the receiving module is used to receive the movement instruction sent by the second electronic device; wherein the movement instruction is generated by the second electronic device based on the detected touch operation.
[0043] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0044] A processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the method as described in the first aspect above.
[0045] According to a fourth aspect of an embodiment of the present disclosure, there is provided a storage medium, including:
[0046] When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method as described in the first aspect above.
[0047] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0048] On the one hand, since the edge area is close to the edge of the display interface, the cursor is likely to slide out of the display interface during movement. In response to this, the embodiment of the present disclosure controls the movement of the cursor according to the movement instruction in response to the cursor being located in the edge area of the display interface, and the distance the cursor moves is less than the distance indicated by the movement instruction, which can reduce the problem of the cursor moving out of the edge of the display interface, such as the cursor losing tracking. On the other hand, compared with the related art in which the movement of the cursor is interrupted by triggering a hand-raising process when the cursor is located in the edge area, the embodiment of the present disclosure controls the cursor to move a smaller distance when the cursor is located in the edge area, maintains the consistency of the cursor movement, and reduces the fragmentation of the user's experience when moving the cursor.
[0049] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0051] Figure 1 This is an example flow chart of a cursor control method shown in an embodiment of the present disclosure.
[0052] Figure 2 This is an example diagram showing an embodiment of the present disclosure in which a first electronic device receives a movement instruction sent by a second electronic device.
[0053] Figure 3 This is an example of a display interface area division shown in an embodiment of the present disclosure. Figure 1 .
[0054] Figure 4 This is an example of a display interface area division shown in an embodiment of the present disclosure. Figure 2 .
[0055] Figure 5 This is a local example diagram of an edge area shown in an embodiment of the present disclosure.
[0056] Figure 6 It is an exemplary square root function shown in an embodiment of the present disclosure.
[0057] Figure 7 is a diagram of a cursor control device shown in an embodiment of the present disclosure.
[0058] Figure 8 It is a block diagram of an electronic device shown in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0059] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0060] The embodiment of the present disclosure provides a cursor control method, and the execution subject may be a first electronic device, for example, a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementations, the cursor control method may be implemented by a processor calling a computer-readable instruction stored in a memory.
[0061] Figure 1 is a flowchart of a cursor control method according to an embodiment of the present disclosure, which is applied to a first electronic device. Figure 1 It can be seen that the following steps are included:
[0062] S101, receiving an instruction to move a cursor on a display interface of the first electronic device;
[0063] S102, determining whether the cursor is located at an edge area of the display interface;
[0064] S103 . In response to the cursor being located in the edge area, controlling the cursor to move according to the movement instruction; wherein the movement distance of the cursor is less than the distance indicated by the movement instruction.
[0065] In step S101, the first electronic device receives an instruction to move a cursor on a display interface, which may be that the first electronic device directly receives an instruction to move a cursor on a display interface issued by a user, for example, the first electronic device receives a touch operation issued by a user to indicate the movement of a cursor based on a touch component, or receives a voice issued by a user to indicate the movement of a cursor based on a sound receiving component, so that the first electronic device receives the corresponding movement instruction. Among them, the touch operation includes the operation of dragging a cursor on a screen of a smart phone or a touch pad of a laptop, clicking a button (including a physical button or a virtual button) to indicate the movement of a cursor, etc.; the voice includes "move right", "move left 100 pixels", etc.
[0066] In some embodiments, the first electronic device may also receive a movement instruction sent by the second electronic device; wherein the movement instruction is generated by the second electronic device based on a detected touch operation, or is generated by the second electronic device based on a voice uttered by a user.
[0067] Figure 2 This is an example diagram showing a first electronic device receiving a movement instruction sent by a second electronic device according to an embodiment of the present disclosure. Figure 2 In the embodiment, the head-mounted display device corresponds to the first electronic device, and the screen of the head-mounted display device includes the display interface of the first electronic device; the mobile phone corresponds to the second electronic device, and the virtual touchpad in the mobile phone has a projection relationship with the screen of the head-mounted display device, and the virtual cursor is used as a control medium. The mobile phone detects the touch operation based on the virtual touchpad and generates a movement instruction indicating the movement of the virtual cursor, so that the head-mounted display device receives the movement instruction, and the head-mounted display device can subsequently control the movement of the virtual cursor on the screen based on the movement instruction. By indirectly receiving the movement instruction by the first electronic device, the movement of the cursor in the display interface of the first electronic device can be controlled by the second electronic device, which can meet the needs of multi-device interaction scenarios.
[0068] In step S102, the first electronic device determines whether the cursor is located in the edge area of the display interface; wherein the edge area is an area away from the center position of the display interface, the edge area can be one or more, and the shape of the edge area can be rectangular, circular, etc. The embodiment of the present disclosure does not limit the shape and number of the edge area.
[0069] For example, Figure 3 An example of dividing the display interface area provided in the embodiment of the present disclosure Figure 1 , Figure 3 In the display interface, the display interface is divided into a safe area and a restricted area, wherein the restricted area corresponds to the edge area, and the safe area is the area outside the edge area; the circle represents the cursor; Figure 3 In the example, the cursor is located in the edge area (i.e., the restricted area) of the display interface.
[0070] Figure 4 An example of dividing the display interface area provided in the embodiment of the present disclosure Figure 2 , Figure 4 In the example, the cursor is located in an area outside the edge area of the display interface (ie, a safe area).
[0071] In some embodiments, the edge area of the display interface corresponds to a coordinate range. The first electronic device determines, based on the coordinates of the cursor and the coordinate range, that the cursor is located in the edge area of the display interface if the coordinates of the cursor fall within the coordinate range; if the coordinates of the cursor do not fall within the coordinate range, the first electronic device determines that the cursor is located in an area outside the edge area of the display interface.
[0072] Exemplarily, the coordinates of the cursor include the coordinates in the x direction and the coordinates in the y direction, and the coordinate range corresponding to the edge area includes the coordinate range in the x direction and the coordinate range in the y direction. If the coordinates of the cursor in the x direction fall within the coordinate range in the x direction, and / or the coordinates of the cursor in the y direction fall within the coordinate range in the y direction, it is determined that the cursor is located in the edge area of the display interface.
[0073] In some embodiments, each pixel in the display interface corresponds to a pixel number, and the edge area corresponds to a set of pixel numbers of each pixel located in the edge area; the first electronic device determines the pixel number corresponding to the cursor according to the position of the cursor on the display interface, and when the pixel number corresponding to the cursor belongs to the pixel number set, determines that the cursor is located in the edge area of the display interface; when the pixel number corresponding to the cursor does not belong to the pixel number set, determines that the cursor is located in an area outside the edge area of the display interface.
[0074] In step S103, in response to the cursor being located in the edge area, the cursor is controlled to move according to the movement instruction; wherein the movement distance of the cursor is less than the distance indicated by the movement instruction. The distance indicated by the movement instruction in the embodiment of the present disclosure may be the sliding distance of the user's dragging operation on the touch component, the distance corresponding to clicking the button indicating the movement of the cursor; it may also be the distance carried by the user's voice, such as the distance carried by the voice "move left 100 pixels" is 100 pixels; the distance corresponding to the user's voice, such as the preset distance corresponding to the voice "move right", such as "50 pixels", etc., which is not limited in the present disclosure.
[0075] In some embodiments, the edge area corresponds to a preset distance weight, which is less than 1; thus, in response to the cursor being located in the edge area, the first electronic device controls the cursor to move a distance weighted by the preset distance weight based on the movement control instruction.
[0076] In some embodiments, the edge area corresponds to a preset distance reduction amount, and the preset distance reduction amount is greater than 0; thus, in response to the cursor being located in the edge area, the first electronic device controls the cursor to move a distance represented by the difference between the distance indicated by the movement control instruction and the preset distance reduction amount based on the movement control instruction.
[0077] It is understandable that, on the one hand, since the edge area is close to the edge of the display interface, the cursor is likely to slide out of the display interface during movement. In response to this, the embodiment of the present disclosure controls the movement of the cursor according to the movement instruction in response to the cursor being located in the edge area of the display interface, and the distance the cursor moves is less than the distance indicated by the movement instruction, which can reduce the problem of the cursor moving out of the edge of the display interface, such as the cursor losing tracking. On the other hand, compared with the related art in which the movement of the cursor is interrupted by triggering a hand-raising process when the cursor is located in the edge area, the embodiment of the present disclosure controls the cursor to move a smaller distance when the cursor is located in the edge area, maintains the consistency of the cursor movement, and reduces the fragmentation of the user's experience in the process of moving the cursor.
[0078] In some embodiments, in response to the cursor being located in the edge area, controlling the cursor to move according to the movement instruction includes:
[0079] In response to the cursor being located in the edge area, the cursor is controlled to move according to the movement instruction and the distance of the cursor relative to the outer edge of the edge area; wherein the distance of the cursor movement is positively correlated with the distance of the cursor from the outer edge of the edge area.
[0080] In the embodiment of the present disclosure, the distance between the cursor and the outer edge of the edge area is the minimum distance between the cursor and the outer edge of the edge area. Figure 3As shown, the outer edge of the edge area is a quadrilateral, and the distance between the cursor and the outer edge of the edge area includes four distances, wherein the minimum distance is the distance between the cursor and the outer edge of the edge area in the embodiment of the present disclosure. Figure 3 The middle is the distance between the cursor and the right side of the outer edge.
[0081] In response to a cursor being located in an edge area of a display interface, the first electronic device controls the movement of the cursor according to a movement instruction and the distance of the cursor from the outer edge of the edge area; wherein the distance of the cursor movement is positively correlated with the distance of the cursor from the outer edge of the edge area. In some embodiments, in response to a cursor being located in an edge area of a display interface, based on a preset distance function, the distance of the cursor from the outer edge of the edge area and the distance indicated by the movement instruction are processed to obtain a processed movement distance, thereby controlling the movement of the cursor to the processed movement distance; wherein, the smaller the distance of the cursor from the outer edge of the edge area, the smaller the processed movement distance obtained based on the same distance indicated by the movement instruction.
[0082] In some embodiments, in response to the cursor being located in the edge area of the display interface, the first electronic device determines the distance reduction corresponding to the distance of the cursor relative to the outer edge of the edge area based on a preset distance reduction correspondence relationship, and determines the difference between the distance indicated by the movement control instruction and the distance reduction amount, thereby controlling the cursor to move the distance represented by the difference; wherein the distance reduction correspondence relationship includes a mapping between the distance of the cursor relative to the outer edge of the edge area and the distance reduction amount, and the distance of the cursor relative to the outer edge of the edge area in each mapping relationship is positively correlated with the distance reduction amount.
[0083] Exemplarily, the closer the cursor is to the outer edge of the edge area, the smaller the distance the cursor is controlled to move, such as the closer it is to 0, thereby reducing the situation where the cursor slides out of the display interface.
[0084] It can be understood that the closer the cursor is to the outer edge of the edge area, the greater the possibility that the cursor slides out of the display interface. In this regard, the embodiments of the present disclosure respond to the cursor being located in the edge area, and control the movement of the cursor according to the movement instruction and the distance of the cursor relative to the outer edge of the edge area. The closer the cursor is to the outer edge of the edge area, the smaller the distance the cursor is controlled to move based on the movement instruction. On the basis of improving the consistency of the cursor movement in the edge area, the occurrence of problems such as the cursor being lost due to the cursor moving out of the display interface is further reduced.
[0085] In some embodiments, the movement instruction carries movement distance information; and controlling the movement of the cursor according to the movement instruction and the distance of the cursor relative to the outer edge of the edge area includes:
[0086] determining a distance weight according to the distance of the cursor relative to the outer edge of the edge area;
[0087] Determine the target moving distance according to the distance weight and the moving distance information;
[0088] The cursor is controlled to move according to the target moving distance.
[0089] In the disclosed embodiment, the movement instruction carries movement distance information, such as the sliding distance of the user's dragging operation on the touch component, the distance carried by the user's voice, etc.
[0090] The first electronic device of the disclosed embodiment determines the weight corresponding to the distance of the cursor relative to the outer edge of the edge area as the distance weight based on a preset weight relationship; or, uses a preset weight function to process the distance of the cursor relative to the outer edge of the edge area to obtain the distance weight; wherein, as can be seen from the above, the distance weight is less than 1, and the distance weight is positively correlated with the distance of the cursor relative to the outer edge of the edge area.
[0091] After determining the distance weight, in some embodiments of the disclosed embodiments, the first electronic device weights the moving distance information by the distance weight and determines the result as the target moving distance, thereby controlling the cursor to move according to the target moving distance.
[0092] In some embodiments, the first electronic device determines the result of weighting the moving distance information with the distance weight, further corrects the result using a preset correction distance, and determines the corrected result as the target moving distance; wherein the preset correction distance can be obtained through multiple test fittings.
[0093] It can be understood that the embodiment of the present disclosure determines the target moving distance through a distance weight that is positively correlated with the distance of the cursor from the outer edge of the edge area, and controls the cursor to move according to the target moving distance, so that the target moving distance is less than the distance indicated by the moving instruction, thereby improving the correlation between the target moving distance and the distance indicated by the moving instruction, thereby improving the consistency between the cursor movement and the user's intention, and providing a better user experience.
[0094] In some embodiments, determining the distance weight according to the distance of the cursor relative to the outer edge of the edge area includes:
[0095] Determine a ratio of a distance of the cursor relative to an outer edge of the edge area to a width of the edge area;
[0096] The distance weight is determined according to the ratio; wherein the distance weight is positively correlated with the ratio.
[0097] In the embodiment of the present disclosure, the first electronic device determines the ratio of the distance of the cursor relative to the outer edge of the edge area to the width of the edge area; wherein the width of the edge area is the distance between the outer edge and the inner edge of the edge area, such as Figure 5 The embodiment of the present disclosure provides a local example diagram of an edge area, wherein, taking the x direction as an example, the distance between the cursor and the inner edge of the edge area is dX, the width of the edge area is cX, and the distance between the cursor and the outer edge of the edge area is cX-dX; the above ratio is It can be understood that in the embodiment of the present disclosure, the ratio of the distance of the cursor relative to the outer edge of the edge area to the width of the edge area is less than 1, and the ratio is positively correlated with the distance of the cursor relative to the outer edge of the edge area.
[0098] After determining the ratio, the first electronic device of the disclosed embodiment determines the distance weight according to the ratio; for example, the distance weight corresponding to the ratio is determined according to a correspondence between a preset ratio and the distance weight; or the distance weight is obtained by processing the ratio using a preset function; wherein the distance weight is positively correlated with the ratio.
[0099] It can be understood that compared to determining the distance weight based on the absolute distance of the cursor relative to the outer edge of the edge area, the method of determining the distance weight based on the ratio of the distance of the cursor relative to the outer edge of the edge area and the width of the edge area in the embodiment of the present disclosure can be applicable to display interfaces of different sizes, thereby improving the generalization capability of the cursor control method of the embodiment of the present disclosure.
[0100] In some embodiments, determining the distance weight according to the ratio includes:
[0101] The ratio is squared using a preset square root function to obtain the distance weight; wherein the number of square roots of the preset square root function is greater than a preset number threshold.
[0102] In an embodiment of the present disclosure, after the first electronic device determines the ratio of the distance of the cursor relative to the outer edge of the edge area to the width of the edge area, it uses a preset square root function to perform square root processing on the comparison value to obtain a distance weight; wherein the number of square roots of the preset square root function is greater than a preset number threshold; exemplarily, the preset number threshold is 4.
[0103] Taking the preset square root function as the 8th square root function as an example, the distance weight L x It can be expressed by the following formula (1):
[0104]
[0105] Wherein, cX represents the width of the edge area, and dX represents the distance of the cursor relative to the inner edge of the edge area.
[0106] Figure 6 An exemplary square root function provided in the embodiment of the present disclosure, wherein L1 indicates a quadratic square root function Trend graph, L2 indicates the fourth square root function Trend graph, L3 indicates the eighth square root function The trend graph of , where x is less than 1. It should be noted that Figure 6 It is used to illustrate the changes of the square root function curve with different square root times. Figure 6 In the square root function shown, x may be the ratio of the distance of the cursor relative to the inner edge of the edge area to the width of the edge area.
[0107] Depend on Figure 6 It can be seen that, on the one hand, the slope of the quadratic square root function curve is relatively large, and the slope of the curves of the fourth square root function and the eighth square root function is relatively gentle. Therefore, the embodiment of the present disclosure uses a preset square root function with a square root number greater than a preset number threshold to perform square root processing on the ratio of the distance of the cursor relative to the outer edge of the edge area to the width of the edge area to obtain a distance weight, thereby controlling the movement of the cursor according to the distance weight and the movement instruction, so that the distance weight corresponding to the cursor at different positions is less different (better continuity), and the smoothness of the distance weight corresponding to different positions is improved. On the other hand, when the cursor of the embodiment of the present disclosure is close to the inner edge of the edge area, the closer the distance weight is to 1, that is, the closer the distance moved by the cursor is to the distance indicated by the movement instruction, so that when the cursor slides from the safe area into the edge area, or from the edge area into the safe area, the user experience is reduced. The user perception of the sudden decrease or increase in the distance of the cursor movement caused by the user is split. In addition, compared with using a neural network model to process the distance of the cursor relative to the outer edge of the edge area to obtain a distance weight, the embodiment of the present disclosure uses a function to determine the distance weight, which saves the computing pressure of the first electronic device.
[0108] In some embodiments, the movement distance information includes a movement distance in a preset direction;
[0109] The determining of the distance weight according to the distance of the cursor relative to the outer edge of the edge area includes:
[0110] Determining a distance weight corresponding to the preset direction according to the distance of the cursor relative to the outer edge of the edge area in the preset direction;
[0111] The step of determining the target moving distance according to the distance weight and the moving distance information includes:
[0112] The target moving distance of the cursor in the preset direction is determined according to the moving distance in the preset direction and the distance weight corresponding to the preset direction.
[0113] In an embodiment of the present disclosure, the moving distance information includes the moving distance in a preset direction; wherein the preset direction is such as the x direction and the y direction, wherein the x direction and the y direction can be directions in the world coordinate system or directions in the coordinate system of the first electronic device, and the present disclosure does not limit this.
[0114] In some embodiments, the closer the cursor is to the outer edge of the edge area, the smaller the distance weight corresponding to the x direction is, for example, the distance weight corresponding to the x direction is closer to 0, thereby reducing the situation where the cursor slides out of the display interface.
[0115] The first electronic device determines the distance weight corresponding to the preset direction based on the distance of the cursor in the preset direction relative to the outer edge of the edge area, and thereby determines the target moving distance of the cursor in the preset direction based on the moving distance in the preset direction and the distance weight corresponding to the preset direction.
[0116] by Figure 3 Taking the cursor position shown in as an example, since the cursor is located in the edge area in the x direction (the coordinates of the cursor in the x direction fall into the coordinate range corresponding to the edge area in the x direction), the distance weight L corresponding to the x direction is determined based on the above formula (1): x (The distance weight L corresponding to the y direction y As 1); so that when the preset distance information includes moving 100 pixels in the x direction, the cursor is controlled to move 100 pixels in the x direction and L x Weighted distance.
[0117] In addition, since the cursor is located in an area outside the edge area in the y direction (the coordinate of the cursor in the y direction does not fall within the coordinate range corresponding to the edge area in the y direction), the distance weight corresponding to the y direction can be set to 1; thereby, when the preset distance information includes moving 100 pixels in the y direction, the cursor is controlled to move a distance corresponding to 100 pixels in the y direction.
[0118] It can be understood that the embodiment of the present disclosure determines the distance weight corresponding to the preset direction based on the distance of the cursor in the preset direction relative to the outer edge of the edge area, thereby determining the target movement distance of the cursor in the preset direction. On the basis of improving the consistency of the cursor movement in the edge area, it can improve the control distance of the cursor movement and the degree of matching between the movement direction and the movement instruction, thereby improving the accuracy of the cursor movement.
[0119] In some embodiments, the method further comprises:
[0120] In response to the cursor being located in an area outside the edge area, the cursor is controlled to move a distance indicated by the movement instruction.
[0121] In the disclosed embodiment, in response to the cursor being located in an area outside the edge area (i.e., the safety area), the cursor is controlled to move the distance indicated by the movement instruction, for example, the cursor is controlled to move the distance consistent with the distance indicated by the movement instruction. Exemplarily, when the cursor is located in an area outside the edge area, the movement distance of the cursor will be 100% fully mapped, for example: every 100 pixel slides on the touch pad of the mobile phone will be reflected in the cursor movement of 100 pixel points in the screen display area of the head-mounted display device.
[0122] In addition, when the second electronic device sends a movement instruction to the first electronic device based on the touch instruction detected by the touch component, the first electronic device obtains the first pixel density of the display interface of the first electronic device and the second pixel density of the second electronic device, and determines the density ratio of the first pixel density to the second pixel density, thereby controlling the cursor movement to be a distance represented by multiplying the distance indicated by the movement instruction by the density ratio.
[0123] It can be understood that, on the one hand, if the cursor is controlled to move a distance consistent with the distance indicated by the movement instruction, the distance weight can be regarded as 1; when the cursor is located in the edge area close to the inner edge of the edge area, the distance weight is close to 1, so that when the cursor slides from the safe area to the edge area, or from the edge area to the safe area, the user experience fragmentation caused by the user's perception of a sudden decrease or increase in the cursor movement distance is reduced. On the other hand, if the cursor is controlled to move the distance indicated by the movement instruction based on the first pixel density and the second pixel density, the matching degree of multi-device interactive control can be improved, and the accuracy and generalization ability of cursor control can be improved.
[0124] Figure 7 is a diagram of a cursor control device shown in an embodiment of the present disclosure, which is applied to a first electronic device. Figure 7 It is known that, including:
[0125] The receiving module 701 is used to receive a movement instruction of a cursor on a display interface of the first electronic device;
[0126] A determination module 702 is used to determine whether the cursor is located in an edge area of the display interface;
[0127] The first moving module 703 is used to control the movement of the cursor according to the moving instruction in response to the cursor being located in the edge area; wherein the moving distance of the cursor is less than the distance indicated by the moving instruction.
[0128] In some embodiments, the first movement module 703 is used to control the movement of the cursor in response to the cursor being located in the edge area, according to the movement instruction and the distance of the cursor relative to the outer edge of the edge area; wherein the distance of the cursor movement is positively correlated with the distance of the cursor from the outer edge of the edge area.
[0129] In some embodiments, the movement instruction carries movement distance information;
[0130] The first moving module 703 is used to determine a distance weight according to the distance of the cursor relative to the outer edge of the edge area; determine a target moving distance according to the distance weight and the moving distance information; and control the cursor to move according to the target moving distance.
[0131] In some embodiments, the first movement module 703 is used to determine the ratio of the distance of the cursor relative to the outer edge of the edge area to the width of the edge area; determine the distance weight based on the ratio; wherein the distance weight is positively correlated with the ratio.
[0132] In some embodiments, the first moving module 703 is used to perform square root processing on the ratio using a preset square root function to obtain the distance weight; wherein the number of square roots of the preset square root function is greater than a preset number threshold.
[0133] In some embodiments, the movement distance information includes a movement distance in a preset direction;
[0134] The first moving module 703 is used to determine the distance weight corresponding to the preset direction according to the distance of the cursor relative to the outer edge of the edge area in the preset direction; and determine the target moving distance of the cursor in the preset direction according to the moving distance in the preset direction and the distance weight corresponding to the preset direction.
[0135] In some embodiments, the apparatus further comprises:
[0136] The second moving module 704 is configured to control the cursor to move a distance indicated by the moving instruction in response to the cursor being located in an area outside the edge area.
[0137] In some embodiments, the receiving module 701 is used to receive the movement instruction sent by the second electronic device; wherein the movement instruction is generated by the second electronic device based on the detected touch operation.
[0138] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0139] Figure 8 8 is a block diagram of an electronic device 800 shown in an embodiment of the present disclosure, corresponding to the aforementioned first electronic device. For example, the electronic device 800 may be a mobile phone, a mobile computer, etc.
[0140] Reference Figure 8 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0141] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0142] The memory 804 is configured to store various types of data to support operations on the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0143] The power component 806 provides power to the various components of the electronic device 800. The power component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.
[0144] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0145] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0146] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0147] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the electronic device 800, the relative positioning of the components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0148] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as Wi-Fi, 4G or 5G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0149] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0150] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by a processor 820 of an electronic device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0151] A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute the aforementioned cursor control method.
[0152] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims above.
[0153] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A cursor control method, characterized in that: Applied in a first electronic device, the method includes: Receiving a movement instruction of a cursor on a display interface of the first electronic device; Determining whether the cursor is located in an edge area of the display interface; In response to the cursor being located in the edge area, the cursor is controlled to move according to the movement instruction; wherein the movement distance of the cursor is less than the distance indicated by the movement instruction.
2. The method according to claim 1, characterized in that In response to the cursor being located in the edge area, controlling the cursor to move according to the movement instruction includes: In response to the cursor being located in the edge area, the cursor is controlled to move according to the movement instruction and the distance of the cursor relative to the outer edge of the edge area; wherein the distance of the cursor movement is positively correlated with the distance of the cursor from the outer edge of the edge area.
3. The method according to claim 2, characterized in that The moving instruction carries moving distance information; and controlling the movement of the cursor according to the moving instruction and the distance of the cursor relative to the outer edge of the edge area includes: determining a distance weight according to the distance of the cursor relative to the outer edge of the edge area; Determine the target moving distance according to the distance weight and the moving distance information; The cursor is controlled to move according to the target moving distance.
4. The method according to claim 3, characterized in that The determining of the distance weight according to the distance of the cursor relative to the outer edge of the edge area includes: Determine a ratio of a distance of the cursor relative to an outer edge of the edge area to a width of the edge area; The distance weight is determined according to the ratio; wherein the distance weight is positively correlated with the ratio.
5. The method according to claim 4, characterized in that Determining the distance weight according to the ratio includes: The ratio is squared using a preset square root function to obtain the distance weight; wherein the number of square roots of the preset square root function is greater than a preset number threshold.
6. The method according to claim 3, characterized in that The moving distance information includes the moving distance in a preset direction; The determining of the distance weight according to the distance of the cursor relative to the outer edge of the edge area includes: Determining a distance weight corresponding to the preset direction according to the distance of the cursor relative to the outer edge of the edge area in the preset direction; The step of determining the target moving distance according to the distance weight and the moving distance information includes: The target moving distance of the cursor in the preset direction is determined according to the moving distance in the preset direction and the distance weight corresponding to the preset direction.
7. The method according to claim 1, characterized in that The method further comprises: In response to the cursor being located in an area outside the edge area, the cursor is controlled to move a distance indicated by the movement instruction.
8. The method according to claim 1, characterized in that: The receiving an instruction to move a cursor on a display interface of the first electronic device includes: The movement instruction sent by the second electronic device is received; wherein the movement instruction is generated by the second electronic device based on the detected touch operation.
9. A cursor control device, characterized in that: Applied in a first electronic device, the device comprises: A receiving module, configured to receive a movement instruction for a cursor on a display interface of the first electronic device; A determination module, used to determine whether the cursor is located in an edge area of the display interface; The first moving module is used to control the movement of the cursor according to the moving instruction in response to the cursor being located in the edge area; wherein the moving distance of the cursor is less than the distance indicated by the moving instruction.
10. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the method as claimed in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method as claimed in any one of claims 1 to 8.