CN110851056B - Cursor control method and device, computing equipment and storage medium - Google Patents
Cursor control method and device, computing equipment and storage medium Download PDFInfo
- Publication number
- CN110851056B CN110851056B CN201911114802.4A CN201911114802A CN110851056B CN 110851056 B CN110851056 B CN 110851056B CN 201911114802 A CN201911114802 A CN 201911114802A CN 110851056 B CN110851056 B CN 110851056B
- Authority
- CN
- China
- Prior art keywords
- cursor
- visual field
- rotation angle
- current
- position point
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 39
- 239000013598 vector Substances 0.000 claims abstract description 121
- 230000000007 visual effect Effects 0.000 claims abstract description 111
- 238000004088 simulation Methods 0.000 claims abstract description 37
- 238000005070 sampling Methods 0.000 claims description 72
- 238000006073 displacement reaction Methods 0.000 claims description 56
- 238000004364 calculation method Methods 0.000 claims description 15
- 230000000694 effects Effects 0.000 abstract description 5
- 230000009471 action Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000008859 change Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 230000001413 cellular effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 239000004984 smart glass Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0484—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/50—Controlling the output signals based on the game progress
- A63F13/52—Controlling the output signals based on the game progress involving aspects of the displayed game scene
- A63F13/525—Changing parameters of virtual cameras
- A63F13/5255—Changing parameters of virtual cameras according to dedicated instructions from a player, e.g. using a secondary joystick to rotate the camera around a player's character
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The application provides a cursor control method, a cursor control device, a computing device and a storage medium, and relates to the technical field of computers. Under the condition that a cursor moving signal is received, acquiring a current simulation position point of a cursor based on a preset cursor reference point at fixed time; calculating a distance vector between the current simulated position point of the cursor and the reference point of the cursor; and setting the current simulated position point of the cursor back to the cursor reference point, determining the rotation angle of the visual field based on the distance vector, and controlling the rotation of the visual field of the system according to the rotation angle of the visual field. According to the method, the cursor reference point is preset in the system, the current simulation position point of the cursor is obtained based on the timing of the cursor reference point, the rotation angle of the visual field is rotated by calculating the distance vector of the two points, when the cursor reaches the boundary of the area, the user moves the cursor towards the original direction as effective operation when the cursor moves, and the cursor is continuously presented according to the original visual field rotation effect, so that the user experience is improved.
Description
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a cursor control method, a cursor control device, a computing device, and a storage medium.
Background
Under the background of the prior art, along with the improvement of the requirement of users on game experience, more convenient operation gradually appears under the condition that the action state of the visual field in the game is controlled by dragging a cursor.
The cursor control method in the prior art directly controls the rotation of the system visual field by dragging the cursor. For example, the Frame Per Second (FPS) of a computer refers to the number of pictures of an animation or video. In the game, a cursor can be moved by dragging a mouse, and the rotation of the view angle of the character is controlled by the movement of the cursor. After the cursor reaches the boundary of the system display area, the subsequent operation of the user is often regarded as an ineffective operation, and the user is required to manually pull the cursor to a position away from the boundary in the opposite direction, then the cursor can be continuously dragged in the original direction, and the rotation of the visual field is controlled.
From the above, the existing cursor control method is inconvenient to control the rotation of the visual field, and greatly reduces the user experience.
Disclosure of Invention
In view of the foregoing, embodiments of the present application provide a cursor control method and apparatus, a computing device, and a storage medium, so as to solve the technical drawbacks in the prior art.
The embodiment of the application discloses a cursor control method, which comprises the following steps:
under the condition that a cursor movement signal is received, acquiring a current simulation position point of a cursor based on a preset cursor reference point at fixed time;
calculating a distance vector between the current simulated position point of the cursor and the reference point of the cursor;
and setting the current simulated position point of the cursor back to the cursor reference point, determining the rotation angle of the visual field based on the distance vector, and controlling the rotation of the visual field of the system according to the rotation angle of the visual field.
Optionally, under the condition of receiving the cursor movement signal, acquiring the current simulated position point of the cursor based on the preset cursor reference point timing includes:
and acquiring the current simulation position point of the cursor based on a preset cursor reference point according to the set sampling frequency.
Optionally, according to the set sampling frequency, acquiring the current simulated position point of the cursor based on the preset cursor reference point includes:
determining displacement generated by a cursor movement signal in the current sampling period according to the set sampling frequency;
and determining the current simulation position point of the cursor according to the preset cursor reference point and the displacement.
Optionally, determining the view rotation angle based on the distance vector includes:
and matching the visual field rotation angle based on the distance vector according to a preset correspondence table of the distance vector and the visual field rotation angle.
Optionally, the step of controlling rotation of the system field of view according to the field of view rotation angle based on the matching of the distance vector to the field of view rotation angle includes:
and determining a distance vector in the current sampling period, determining a visual field rotation angle corresponding to the distance vector in the current sampling period according to the corresponding table, and controlling the visual field of the system to rotate by the visual field rotation angle.
Optionally, the step of controlling rotation of the system field of view according to the field of view rotation angle based on the matching of the distance vector to the field of view rotation angle includes:
and determining an accumulated distance vector from the first sampling period to the current sampling period of the received cursor movement signal, determining a visual field rotation angle corresponding to the accumulated distance vector according to the corresponding table, and controlling the system visual field to rotate to the visual field rotation angle.
Optionally, the method further comprises:
under the condition that a cursor movement signal is received, judging whether the next actual position point of the cursor exceeds the boundary of the display area according to the displacement vector in the current sampling period and the current actual position point of the cursor;
if yes, moving the cursor to the boundary of the display area according to the direction of the displacement vector and the current actual position point of the cursor;
if not, the cursor is controlled to move to the next actual position point.
Optionally, the method further comprises:
and obtaining a displacement vector in the current sampling period according to an application programming interface of the system.
The embodiment of the application discloses a cursor control device, including:
the first acquisition module is configured to acquire a current simulation position point of the cursor based on a preset cursor reference point timing under the condition of receiving a cursor movement signal;
a calculation module configured to calculate a distance vector of the cursor current simulated position point and the cursor reference point;
and the determining module is configured to reset the current simulated position point of the cursor to the cursor reference point, determine the rotation angle of the visual field based on the distance vector and control the rotation of the visual field of the system according to the rotation angle of the visual field.
Further, the first acquisition module is specifically configured to:
and acquiring the current simulation position point of the cursor based on a preset cursor reference point according to the set sampling frequency.
Further, the first acquisition module is specifically configured to:
determining displacement generated by a cursor movement signal in the current sampling period according to the set sampling frequency;
and determining the current simulation position point of the cursor according to the preset cursor reference point and the displacement.
Further, the determining module is specifically configured to:
and matching the visual field rotation angle based on the distance vector according to a preset correspondence table of the distance vector and the visual field rotation angle.
Further, the determining module is specifically configured to:
and determining a distance vector in the current sampling period, determining a visual field rotation angle corresponding to the distance vector in the current sampling period according to the corresponding table, and controlling the visual field of the system to rotate by the visual field rotation angle.
Further, the determining module is specifically configured to:
and determining an accumulated distance vector from the first sampling period to the current sampling period of the received cursor movement signal, determining a visual field rotation angle corresponding to the accumulated distance vector according to the corresponding table, and controlling the system visual field to rotate to the visual field rotation angle.
Further, the cursor control device further includes:
the judging module is configured to judge whether the next actual position point of the cursor exceeds the boundary of the display area according to the displacement vector in the current sampling period and the current actual position point of the cursor under the condition of receiving the cursor movement signal; if yes, executing the first processing module, and if not, executing the second processing module; the cursor is controlled to move to the next actual position point.
The first processing module is configured to move the cursor to the boundary of the display area according to the direction of the displacement vector and the current actual position point of the cursor;
and the second processing module is configured to control the cursor to move to the next actual position point.
Further, the cursor control device further includes:
and the second acquisition module is configured to acquire the displacement vector in the current sampling period according to an application programming interface of the system.
The embodiment of the application discloses a computing device, which comprises a memory, a processor and computer instructions stored on the memory and capable of running on the processor, wherein the processor executes the instructions to realize the steps of the cursor control method.
The embodiment of the application discloses a computer readable storage medium storing computer instructions, wherein the instructions, when executed by a processor, implement the steps of the method described in the steps of the cursor control method.
According to the cursor control method and device, the cursor reference point is preset in the system, the current simulation position point of the cursor is obtained based on the timing of the cursor reference point, after the position information of the current simulation position point of the cursor and the cursor reference point is determined, the visual field rotation angle is rotated by calculating the distance vectors of the two points, after the cursor reaches the boundary of the area, in order to obtain the displacement vector generated by the cursor moving signal, and after each calculation is completed, the current simulation position point of the cursor is reset to the cursor reference point. When the user moves the cursor, the user drags the cursor in the original direction to be regarded as effective operation, and the cursor is continuously presented according to the original visual field rotation effect, so that the user experience is improved.
Drawings
FIG. 1 is a block diagram of a computing device of an embodiment of the present application;
FIG. 2 is a flowchart illustrating steps of a cursor control method according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating steps of a cursor control method according to another embodiment of the present application;
FIG. 4 is a schematic diagram of a cursor control device according to an embodiment of the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is, however, susceptible of embodiment in many other ways than those herein described and similar generalizations can be made by those skilled in the art without departing from the spirit of the application and the application is therefore not limited to the specific embodiments disclosed below.
The terminology used in the one or more embodiments of the specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of the specification. As used in this specification, one or more embodiments and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present specification refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that, although the terms first, second, etc. may be used in one or more embodiments of this specification to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first may also be referred to as a second, and similarly, a second may also be referred to as a first, without departing from the scope of one or more embodiments of the present description. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
In the present application, a cursor control method, apparatus, computing device, and storage medium are provided, and the following embodiments are described in detail one by one.
Fig. 1 is a block diagram illustrating a configuration of a computing device 100 according to an embodiment of the present description. The components of the computing device 100 include, but are not limited to, a memory 110 and a processor 120. Processor 120 is coupled to memory 110 via bus 130 and database 150 is used to store data.
Computing device 100 also includes access device 140, access device 140 enabling computing device 100 to communicate via one or more networks 160. Examples of such networks include the Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the internet. The access device 140 may include one or more of any type of network interface, wired or wireless (e.g., a Network Interface Card (NIC)), such as an IEEE802.11 Wireless Local Area Network (WLAN) wireless interface, a worldwide interoperability for microwave access (Wi-MAX) interface, an ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a bluetooth interface, a Near Field Communication (NFC) interface, and so forth.
In one embodiment of the present description, the above-described components of computing device 100, as well as other components not shown in FIG. 1, may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device shown in FIG. 1 is for exemplary purposes only and is not intended to limit the scope of the present description. Those skilled in the art may add or replace other components as desired.
Computing device 100 may be any type of stationary or mobile computing device including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), mobile phone (e.g., smart phone), wearable computing device (e.g., smart watch, smart glasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. Computing device 100 may also be a mobile or stationary server.
The processor 120 may perform the steps of the cursor control method shown in fig. 2, including steps S210 to S230.
Step S210: and under the condition that a cursor movement signal is received, acquiring the current simulation position point of the cursor based on the preset cursor reference point timing.
In this embodiment of the present application, taking a cursor reference point as an example, the cursor reference point refers to a point preset in the system, and the position of the cursor reference point may be in an upper left, a lower left, an upper right, a lower right, an upper side, a lower side, a left side, a right side, a middle area, and a system inner area deviating from the middle area in the system. The middle region within the system is a common situation. In any case, the cursor reference point is preset inside the system, and the position of the cursor reference point is not changed when the cursor reference point is used for calculation. The cursor current simulation position point is obtained by generating displacement based on a preset cursor reference point and a cursor movement signal obtained at fixed time, and the position of the cursor current simulation position point is not fixed in each calculation.
Under the condition that the cursor movement signal is not received, the cursor movement signal is not acquired, and the displacement generated by the cursor movement signal cannot be acquired. Under the condition that the cursor movement signal is received, the displacement generated by the cursor movement signal is collected, and the movement track of the cursor movement can be straight line, curve, combination of straight line and curve, and is not limited in the embodiment. For example: in a game scene, when a user cursor moves, motion information for detecting the movement of the cursor in the system collects displacement generated by a cursor movement signal.
In practical application, the displacement generated by the cursor moving signal in the current sampling period can be determined by acquiring the current analog position point of the cursor based on the preset cursor reference point according to the set sampling frequency; and determining the current simulation position point of the cursor according to the preset cursor reference point and the displacement.
In an embodiment of the present application, based on a preset cursor reference point, position information of a current analog position point of a cursor is obtained at fixed time, a sampling frequency is preset in a system, and under the condition that a cursor movement signal is received, motion information when the current cursor moves is collected according to the sampling frequency set by the system, that is, displacement generated when the cursor moves is collected according to the sampling frequency set by the system every second, and the sampling frequency is different according to different application conditions. After the sampling frequency is determined, the sampling period is also determined as the reciprocal of the sampling frequency, the sampling period is the time interval when the cursor is moved, and when the information of the cursor movement is collected, the displacement generated when the cursor is moved is determined in the current sampling period according to the sampling frequency set in the embodiment.
In an embodiment of the present application, the movement track of the cursor is various when the cursor moves, but the displacement generated by the movement of the cursor is irrelevant to the movement track of the cursor, and only relevant to the starting point and the end point of the cursor.
For example: in a game scene, a cursor moves in an area, the movement of the cursor can control the movement state of a character in the game, and the movement track of the cursor in the area is various: when the cursor movement track is a curve, the movement action of the character in the cursor control game can be visual field rotation; when the cursor movement state is a straight line, the movement of the character can also be visual field rotation; when the motion state of the cursor is that the curve and the straight line are mutually kneaded, the motion action of the character can also be that the visual field rotates.
Step S220: and calculating a distance vector between the current simulated position point of the cursor and the reference point of the cursor.
In an embodiment of the present application, after the current simulated position point information of the cursor is determined according to the displacement generated by the cursor reference point and the cursor movement signal, the distance vector between the current simulated position point of the cursor and the cursor reference point is calculated, and the calculation process is implemented by a calculation program in the system. And after the current simulated position point of the cursor is acquired, a calculation program is called, and the distance vectors of the two points are calculated based on the determined current simulated position point of the cursor and the position information of the cursor reference point.
Step S230: and setting the current simulated position point of the cursor back to the cursor reference point, determining the rotation angle of the visual field based on the distance vector, and controlling the rotation of the visual field of the system according to the rotation angle of the visual field.
In an embodiment of the application, after one calculation is completed, the current simulated position point of the cursor is reset to the position of the cursor reference point, after the reset is completed, the current simulated position point of the cursor is identical to the position information of the cursor reference point, and the current simulated position point of the cursor is reset to the cursor reference point, so that the situation that the cursor moving signal cannot be acquired to generate displacement after the current simulated position point of the cursor is positioned at the boundary of the system area is avoided. And thus the position information of the current analog position point of the cursor cannot be determined according to the cursor reference point. For example: in a game scene, when a user drags a cursor, the displacement generated by a cursor movement signal changes along with the movement of the cursor of the user, at the moment, the motion information of the current simulation position point of the cursor also changes, and the angle of rotation of the field of view of a character in the game also changes after the distance vector between the current simulation position point of the cursor and a cursor reference point changes. However, if the current simulated position point of the cursor is not returned to the position of the cursor reference point, when the cursor of the user moves, the system cursor moves to the boundary of the area, and the displacement of the cursor movement signal cannot be acquired, and at this time, the rotation angle of the visual field of the character in the game does not change with the movement of the cursor of the user. After each calculation is completed, according to the calculation method of setting the current simulated position point of the cursor back to the reference point of the cursor, the displacement signal of the cursor movement can be continuously collected, so that the rotation angle of the visual field is determined based on the generated distance vector, and the rotation of the visual field of the system is controlled according to the rotation angle of the visual field.
According to the cursor control method, the cursor reference point is preset in the system, the current simulation position point of the cursor is obtained based on the timing of the cursor reference point, after the position information of the current simulation position point of the cursor and the cursor reference point is determined, the visual field rotation angle is rotated by calculating the distance vectors of the two points, after the cursor reaches the boundary of the area, in order to obtain the displacement vector generated by the cursor moving signal, after each calculation is completed, the current simulation position point of the cursor is reset to the cursor reference point. When the user moves the cursor, the user drags the cursor in the original direction to be regarded as effective operation, and the cursor is continuously presented according to the original visual field rotation effect, so that the user experience is improved.
Another embodiment of the present application discloses a cursor dragging method, as shown in fig. 3, including steps S310 to S360.
Step S310: and under the condition that a cursor movement signal is received, acquiring the current simulation position point of the cursor based on the preset cursor reference point timing.
In practical application, the displacement generated by the cursor moving signal in the current sampling period can be determined according to the set sampling frequency; and determining the current simulation position point of the cursor according to the preset cursor reference point and the displacement.
Step S320: and calculating a distance vector between the current simulated position point of the cursor and the reference point of the cursor.
Step S330: and setting the current simulated position point of the cursor back to a cursor reference point, and controlling the rotation of the system vision according to the vision rotation angle based on the matching of the vision rotation angle based on the distance vector according to a preset correspondence table of the distance vector and the vision rotation angle.
In the game scene, the motion state of the character is controlled by controlling a cursor, and the rotation of the visual field is determined according to a preset correspondence table of the distance vector and the rotation angle of the visual field. The correspondence table of the distance vector and the rotation angle of the field of view is already preset inside the system before the cursor movement signal is received.
The correspondence relationship may be various, for example, the correspondence relationship between the distance vector and the rotation angle of the field of view may be linear or nonlinear.
For example, when the correspondence between the distance vector and the view rotation angle is linear, the corresponding view rotation angle can be determined according to one distance vector, and the current view is controlled to continue to rotate by the corresponding view rotation angle.
In practical application, the visual field rotation angle corresponding to the distance vector in the current sampling period can be determined according to the corresponding table by determining the distance vector in the current sampling period, and the visual field rotation angle of the system is controlled.
For example, in the case where the correspondence relationship between the distance vectors and the view rotation angles is nonlinear, the view rotation angles corresponding to the respective distance vectors are different from each other, and in this case, it is necessary to superimpose the distance vectors and obtain an accumulated view rotation angle, and control the current view to be rotated to a position corresponding to the accumulated view rotation angle.
In practical application, determining an accumulated distance vector from a first sampling period to a current sampling period of a received cursor movement signal, determining a visual field rotation angle corresponding to the accumulated distance vector according to the corresponding table, and controlling the system visual field to rotate to the visual field rotation angle.
In a game scene, when a cursor is dragged to generate a displacement vector, a character in the game can also rotate a certain angle along with the movement of the cursor, for example: in the game scene, when the player drags the cursor, if the distance vector generated by the current motion of the simulated position point of the cursor and the rotation angle of the visual field are in regular linear change, for example: when the corresponding relation between the distance vector and the visual field rotation angle is a straight line, one distance vector can uniquely determine the visual field rotation angle, and when the distance vector obtained by calculating the distance vector between the current simulated position point of the cursor and the reference point of the cursor is 0.1, the rotation angle of the corresponding visual field is 36 degrees. When the distance vector is 0.2, the corresponding view rotation angle is 72 degrees. And calling a corresponding relation table which accords with the situation at the moment, determining a visual field rotation angle corresponding to the distance vector in the current sampling period according to the corresponding relation table, and controlling the visual field of the system to rotate by the visual field rotation angle.
If the distance vector generated by the current simulated position point movement of the cursor and the visual field rotation angle are in nonlinear change, one distance vector cannot uniquely determine one visual field rotation angle, and the visual field rotation angle is determined according to the accumulated distance vectors. Such as: when the distance vector generated by the current simulated position point motion of the cursor and the visual field rotation angle are a curve, and when the distance vector is 0.1, the corresponding visual field rotation angle may be 36 degrees, but when the distance vector is 0.6, the corresponding visual field rotation angle may also be 50 degrees, at the moment, the visual field rotation angle is to be determined, the distance vectors are to be overlapped, a corresponding relation table which accords with the situation at the moment is called, the visual field rotation angle corresponding to the accumulated distance vector is determined according to the corresponding table, and the visual field rotation of the system is controlled to be rotated to the visual field rotation angle.
Step S340: when the cursor movement signal is received, it is determined whether the next actual position point of the cursor exceeds the boundary of the display area according to the displacement vector in the current sampling period and the current actual position point of the cursor, if so, step S350 is executed, and if not, step S360 is executed.
Step S350: and moving the cursor to the boundary of the display area according to the direction of the displacement vector and the current actual position point of the cursor.
Step S360: the cursor is controlled to move to the next actual position point.
In an embodiment of the present application, taking the current actual position point of the cursor as an example, the current actual position point of the cursor may be in an upper left, a lower left, an upper right, a lower right, an upper side, a lower side, a left side, a right side, a middle area and a deviated middle position of the display area, where the current actual position point of the cursor is not limited in the embodiment of the present application, and under the condition that a cursor movement signal is received, the position information of the current actual position point of the cursor and the displacement generated by the movement of the cursor in the current sampling period are used to determine the position information of the current actual position point of the cursor after the next cursor movement, and the position information of the current actual position point of the cursor and the value of the displacement vector are combined to obtain the next actual position point, and if the next actual position point exceeds the boundary of the display area, the cursor is moved to the boundary of the display area according to the direction of the displacement vector.
And if the next actual position point does not exceed the boundary of the display area, controlling the cursor to move to the next actual position point according to the direction of the displacement vector.
In practical application, the displacement vector in the current sampling period is obtained according to an application programming interface (Application Programming Interface, API) of the system.
In this embodiment of the present application, taking the API as an example, the API is a call interface reserved for an application program by an operating system, the application program calls the API of the operating system to enable the operating system to execute a command of the application program, and under the condition that a cursor movement signal is received inside the system, the API of the system obtains a displacement vector in a current sampling period.
When a user performs cursor control, the displacement vector generated by cursor movement in the current sampling period can be conveniently and rapidly acquired when the displacement vector in the sampling period is acquired according to the API of the operating system.
According to the cursor control method provided by the embodiment, the cursor reference point is preset in the system, the current simulation position point of the cursor is obtained based on the timing of the cursor reference point, after the position information of the current simulation position point of the cursor and the cursor reference point is determined, the visual field rotation angle is rotated by calculating the distance vectors of the two points, after the cursor reaches the boundary of the area, in order to obtain the displacement vector generated by the cursor moving signal, and after each calculation is completed, the current simulation position point of the cursor is reset to the cursor reference point. When the user moves the cursor, the user drags the cursor in the original direction to be regarded as effective operation, and the cursor is continuously presented according to the original visual field rotation effect, so that the user experience is improved.
The embodiment of the application discloses a cursor control device, as shown in fig. 4, including:
a first obtaining module 410, configured to obtain, based on a preset cursor reference point timing, a current simulated position point of a cursor in the case of receiving a cursor movement signal;
a calculation module 420 configured to calculate a distance vector of the cursor current simulated position point and the cursor reference point;
the determining module 430 is configured to set the current simulated position point of the cursor back to the cursor reference point, determine the rotation angle of the visual field based on the distance vector, and control the rotation of the visual field of the system according to the rotation angle of the visual field.
Optionally, the first obtaining module 410 is specifically configured to:
and acquiring the current simulation position point of the cursor based on a preset cursor reference point according to the set sampling frequency.
Optionally, the first obtaining module 410 is specifically configured to:
determining displacement generated by a cursor movement signal in the current sampling period according to the set sampling frequency;
and determining the current simulation position point of the cursor according to the preset cursor reference point and the displacement.
Optionally, the determining module 430 is specifically configured to:
and matching the visual field rotation angle based on the distance vector according to a preset correspondence table of the distance vector and the visual field rotation angle.
Optionally, the determining module 430 is specifically configured to:
and determining a distance vector in the current sampling period, determining a visual field rotation angle corresponding to the distance vector in the current sampling period according to the corresponding table, and controlling the visual field of the system to rotate by the visual field rotation angle.
Optionally, the determining module 430 is specifically configured to:
and determining an accumulated distance vector from the first sampling period to the current sampling period of the received cursor movement signal, determining a visual field rotation angle corresponding to the accumulated distance vector according to the corresponding table, and controlling the system visual field to rotate to the visual field rotation angle.
Optionally, the cursor control device further includes:
the judging module is configured to judge whether the next actual position point of the cursor exceeds the boundary of the display area according to the displacement vector in the current sampling period and the current actual position point of the cursor under the condition of receiving the cursor movement signal, if so, the first processing module is executed, and if not, the second processing module is executed;
the first processing module is configured to move the cursor to the boundary of the display area according to the direction of the displacement vector and the current actual position point of the cursor;
and the second processing module is configured to control the cursor to move to the next actual position point.
Optionally, the cursor control device further includes:
the second acquisition module is specifically configured to acquire the displacement vector in the current sampling period according to an application programming interface API of the system.
According to the cursor control device, the cursor reference point is preset in the system, the current simulation position point of the cursor is obtained based on the timing of the cursor reference point, after the position information of the current simulation position point of the cursor and the cursor reference point is determined, the visual field rotation angle is rotated through calculating the distance vectors of the two points, after the cursor reaches the boundary of the area, in order to obtain the displacement vector generated by the cursor moving signal, after each calculation is completed, the current simulation position point of the cursor is reset to the cursor reference point. When the user moves the cursor, the user drags the cursor in the original direction to be regarded as effective operation, and the cursor is continuously presented according to the original visual field rotation effect, so that the user experience is improved.
An embodiment of the present application also provides a computing device including a memory, a processor, and computer instructions stored on the memory and executable on the processor, the processor implementing the following steps when executing the instructions: under the condition that a cursor movement signal is received, acquiring a current simulation position point of a cursor based on a preset cursor reference point at fixed time;
calculating a distance vector between the current simulated position point of the cursor and the reference point of the cursor;
and setting the current simulated position point of the cursor back to the cursor reference point, determining the rotation angle of the visual field based on the distance vector, and controlling the rotation of the visual field of the system according to the rotation angle of the visual field.
An embodiment of the present application also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the steps of the cursor control method as described above.
The above is an exemplary version of a computer-readable storage medium of the present embodiment. It should be noted that, the technical solution of the storage medium and the technical solution of the cursor control method belong to the same concept, and details of the technical solution of the storage medium which are not described in detail can be referred to the description of the technical solution of the cursor control method.
The computer instructions include computer program code that may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
It should be noted that, for the sake of simplicity of description, the foregoing method embodiments are all expressed as a series of combinations of actions, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily all necessary for the present application.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to the related descriptions of other embodiments.
The above-disclosed preferred embodiments of the present application are provided only as an aid to the elucidation of the present application. Alternative embodiments are not intended to be exhaustive or to limit the invention to the precise form disclosed. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the application and the practical application, to thereby enable others skilled in the art to best understand and utilize the application. This application is to be limited only by the claims and the full scope and equivalents thereof.
Claims (18)
1. A cursor control method, comprising:
under the condition that a cursor movement signal is received, acquiring a current simulation position point of a cursor based on a preset cursor reference point at fixed time;
calculating a distance vector between the current simulated position point of the cursor and the reference point of the cursor;
after one calculation is completed, the current simulated position point of the cursor is set back to the cursor reference point, the visual field rotation angle is determined according to the corresponding relation between the distance vector and the rotation visual field angle, and the rotation of the visual field of the system is controlled according to the visual field rotation angle.
2. The method of claim 1, wherein upon receiving the cursor movement signal, acquiring the current simulated position point of the cursor based on the preset cursor reference point timing comprises:
and acquiring the current simulation position point of the cursor based on a preset cursor reference point according to the set sampling frequency.
3. The method of claim 2, wherein obtaining the current simulated location point of the cursor based on the preset cursor reference point according to the set sampling frequency comprises:
determining displacement generated by a cursor movement signal in the current sampling period according to the set sampling frequency;
and determining the current simulation position point of the cursor according to the preset cursor reference point and the displacement.
4. The method of claim 1, wherein determining the view rotation angle based on the distance vector based on the correspondence of the distance vector and the rotation view angle comprises:
and matching the visual field rotation angle based on the distance vector according to a preset correspondence table of the distance vector and the visual field rotation angle.
5. The method of claim 4, wherein controlling rotation of the system field of view based on the field of view rotation angle comprises:
and determining a distance vector in the current sampling period, determining a visual field rotation angle corresponding to the distance vector in the current sampling period according to the corresponding table, and controlling the visual field of the system to rotate by the visual field rotation angle.
6. The method of claim 4, wherein controlling rotation of a system field of view according to the field of view rotation angle based on the distance vector matching the field of view rotation angle comprises:
and determining an accumulated distance vector from the first sampling period to the current sampling period of the received cursor movement signal, determining a visual field rotation angle corresponding to the accumulated distance vector according to the corresponding table, and controlling the system visual field to rotate to the visual field rotation angle.
7. The method of claim 1, wherein the method further comprises:
under the condition that a cursor movement signal is received, judging whether the next actual position point of the cursor exceeds the boundary of the display area according to the displacement vector in the current sampling period and the current actual position point of the cursor;
if yes, moving the cursor to the boundary of the display area according to the direction of the displacement vector and the current actual position point of the cursor;
if not, the cursor is controlled to move to the next actual position point.
8. The method of claim 7, wherein the method further comprises:
and obtaining a displacement vector in the current sampling period according to an application programming interface of the system.
9. A cursor control device, comprising:
the first acquisition module is configured to acquire a current simulation position point of the cursor based on a preset cursor reference point timing under the condition of receiving a cursor movement signal;
a calculation module configured to calculate a distance vector of the cursor current simulated position point and the cursor reference point;
and the determining module is configured to reset the current simulated position point of the cursor to the cursor reference point after one calculation is completed, determine the rotation angle of the visual field based on the distance vector according to the corresponding relation between the distance vector and the rotation visual field angle, and control the rotation of the visual field of the system according to the rotation angle of the visual field.
10. The apparatus of claim 9, wherein the first acquisition module is specifically configured to:
and acquiring the current simulation position point of the cursor based on a preset cursor reference point according to the set sampling frequency.
11. The apparatus of claim 10, wherein the first acquisition module is specifically configured to:
determining displacement generated by a cursor movement signal in the current sampling period according to the set sampling frequency;
and determining the current simulation position point of the cursor according to the preset cursor reference point and the displacement.
12. The apparatus of claim 9, wherein the determination module is specifically configured to:
and matching the visual field rotation angle based on the distance vector according to a preset correspondence table of the distance vector and the visual field rotation angle.
13. The apparatus of claim 12, wherein the determination module is specifically configured to:
and determining a distance vector in the current sampling period, determining a visual field rotation angle corresponding to the distance vector in the current sampling period according to the corresponding table, and controlling the visual field of the system to rotate by the visual field rotation angle.
14. The apparatus of claim 12, wherein the determination module is specifically configured to:
and determining an accumulated distance vector from the first sampling period to the current sampling period of the received cursor movement signal, determining a visual field rotation angle corresponding to the accumulated distance vector according to the corresponding table, and controlling the system visual field to rotate to the visual field rotation angle.
15. The apparatus as recited in claim 9, further comprising:
the judging module is configured to judge whether the next actual position point of the cursor exceeds the boundary of the display area according to the displacement vector in the current sampling period and the current actual position point of the cursor under the condition of receiving the cursor movement signal, if so, the first processing module is executed, and if not, the second processing module is executed;
the first processing module is configured to move the cursor to the boundary of the display area according to the direction of the displacement vector and the current actual position point of the cursor;
and the second processing module is configured to control the cursor to move to the next actual position point.
16. The apparatus as recited in claim 15, further comprising:
and the second acquisition module is configured to acquire the displacement vector in the current sampling period according to an application programming interface of the system.
17. A computing device comprising a memory, a processor, and computer instructions stored on the memory and executable on the processor, wherein the processor, when executing the instructions, implements the steps of the method of any of claims 1-8.
18. A computer readable storage medium storing computer instructions which, when executed by a processor, implement the steps of the method of any one of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911114802.4A CN110851056B (en) | 2019-11-14 | 2019-11-14 | Cursor control method and device, computing equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911114802.4A CN110851056B (en) | 2019-11-14 | 2019-11-14 | Cursor control method and device, computing equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110851056A CN110851056A (en) | 2020-02-28 |
CN110851056B true CN110851056B (en) | 2024-02-27 |
Family
ID=69601881
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911114802.4A Active CN110851056B (en) | 2019-11-14 | 2019-11-14 | Cursor control method and device, computing equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110851056B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111665940B (en) | 2020-06-05 | 2021-05-11 | 腾讯科技(深圳)有限公司 | Cursor control method and device and related equipment |
CN111921196B (en) * | 2020-09-01 | 2024-07-16 | 网易(杭州)网络有限公司 | Game view angle control method and device, storage medium and electronic equipment |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1624675A (en) * | 2003-12-05 | 2005-06-08 | 联发科技股份有限公司 | Hand held electron device |
CN1804774A (en) * | 2004-12-22 | 2006-07-19 | 微软公司 | Improving touch screen accuracy |
CN102075709A (en) * | 2010-05-20 | 2011-05-25 | 曾瑋 | Touchpad television remote controller and touch control method thereof |
CN103019375A (en) * | 2012-11-28 | 2013-04-03 | 广东远峰电子科技有限公司 | Cursor control method and system based on image recognition |
CN103279205A (en) * | 2012-01-10 | 2013-09-04 | 英属维京群岛速位互动股份有限公司 | Pointing device, operating method thereof and relative multimedia interactive system |
CN103294177A (en) * | 2012-02-29 | 2013-09-11 | 株式会社理光 | Cursor moving control method and system |
CN104123058A (en) * | 2013-04-24 | 2014-10-29 | 广明光电股份有限公司 | Method for touch host computer to control mobile device |
CN109343810A (en) * | 2018-09-30 | 2019-02-15 | 北京淳中科技股份有限公司 | Control switching method, device and KVM switch |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20050000276A (en) * | 2003-06-24 | 2005-01-03 | 주식회사 성진씨앤씨 | Virtual joystick system for controlling the operation of a security camera and controlling method thereof |
US8593402B2 (en) * | 2010-04-30 | 2013-11-26 | Verizon Patent And Licensing Inc. | Spatial-input-based cursor projection systems and methods |
-
2019
- 2019-11-14 CN CN201911114802.4A patent/CN110851056B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1624675A (en) * | 2003-12-05 | 2005-06-08 | 联发科技股份有限公司 | Hand held electron device |
CN1804774A (en) * | 2004-12-22 | 2006-07-19 | 微软公司 | Improving touch screen accuracy |
CN102075709A (en) * | 2010-05-20 | 2011-05-25 | 曾瑋 | Touchpad television remote controller and touch control method thereof |
CN103279205A (en) * | 2012-01-10 | 2013-09-04 | 英属维京群岛速位互动股份有限公司 | Pointing device, operating method thereof and relative multimedia interactive system |
CN103294177A (en) * | 2012-02-29 | 2013-09-11 | 株式会社理光 | Cursor moving control method and system |
CN103019375A (en) * | 2012-11-28 | 2013-04-03 | 广东远峰电子科技有限公司 | Cursor control method and system based on image recognition |
CN104123058A (en) * | 2013-04-24 | 2014-10-29 | 广明光电股份有限公司 | Method for touch host computer to control mobile device |
CN109343810A (en) * | 2018-09-30 | 2019-02-15 | 北京淳中科技股份有限公司 | Control switching method, device and KVM switch |
Non-Patent Citations (3)
Title |
---|
Hardware and Software Implementation of Real Time Electrooculogram (EOG) Acquisition System to Control Computer Cursor with Eyeball Movement;Zakir Hossain;ICAEE;第132-137页 * |
严开元 ; 胡徐兵 ; 熊菡 ; .GUI光标移动技术综述.科技展望.2016,(22),第308页. * |
基于Kinect的模拟鼠标和键盘行为的理论和技术研究;韩甲甲;中国优秀硕士论文电子期刊网;第I138-1126页 * |
Also Published As
Publication number | Publication date |
---|---|
CN110851056A (en) | 2020-02-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11282182B2 (en) | Image processing method and apparatus, computer-readable medium, and electronic device | |
CN107771391B (en) | Method and apparatus for determining exposure time of image frame | |
CN113630615B (en) | Live broadcast room virtual gift display method and device | |
CN110851056B (en) | Cursor control method and device, computing equipment and storage medium | |
CN110570499B (en) | Expression generating method, device, computing equipment and storage medium | |
CN107340964A (en) | The animation effect implementation method and device of a kind of view | |
CN106254784A (en) | A kind of method and device of Video processing | |
CN109784164B (en) | Foreground identification method and device, electronic equipment and storage medium | |
CN107656866B (en) | Method for testing application fluency, mobile terminal and computing device | |
WO2020114097A1 (en) | Boundary box determining method and apparatus, electronic device, and storage medium | |
CN109271929B (en) | Detection method and device | |
CN109829963B (en) | Image drawing method and device, computing equipment and storage medium | |
CN109559288A (en) | Image processing method, device, electronic equipment and computer readable storage medium | |
CN116030185A (en) | Three-dimensional hairline generating method and model training method | |
CN111773668B (en) | Animation playing method and device | |
CN114187392A (en) | Virtual even image generation method and device and electronic equipment | |
CN109587035B (en) | Head portrait display method and device of session interface, electronic equipment and storage medium | |
CN110766631A (en) | Face image modification method and device, electronic equipment and computer readable medium | |
CN113190320B (en) | Interface adjustment method and device | |
CN108256451B (en) | Method and device for detecting human face | |
CN112604282B (en) | Virtual lens control method and device | |
CN112862693B (en) | Picture processing method and device | |
CN115228081A (en) | Virtual scene switching method and device | |
CN112800360B (en) | Object control method and device | |
CN110381374B (en) | Image processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: 519000 Room 102, 202, 302 and 402, No. 325, Qiandao Ring Road, Tangjiawan Town, high tech Zone, Zhuhai City, Guangdong Province, Room 102 and 202, No. 327 and Room 302, No. 329 Applicant after: Zhuhai Jinshan Digital Network Technology Co.,Ltd. Address before: 519000 Room 102, 202, 302 and 402, No. 325, Qiandao Ring Road, Tangjiawan Town, high tech Zone, Zhuhai City, Guangdong Province, Room 102 and 202, No. 327 and Room 302, No. 329 Applicant before: ZHUHAI KINGSOFT ONLINE GAME TECHNOLOGY Co.,Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |