CN112791392A - Touch data processing method and device, storage medium and electronic equipment - Google Patents

Touch data processing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN112791392A
CN112791392A CN201911109156.2A CN201911109156A CN112791392A CN 112791392 A CN112791392 A CN 112791392A CN 201911109156 A CN201911109156 A CN 201911109156A CN 112791392 A CN112791392 A CN 112791392A
Authority
CN
China
Prior art keywords
coordinate
rocker
coordinates
preset
target
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.)
Pending
Application number
CN201911109156.2A
Other languages
Chinese (zh)
Inventor
马迎斌
方攀
陈岩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201911109156.2A priority Critical patent/CN112791392A/en
Publication of CN112791392A publication Critical patent/CN112791392A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/40Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment
    • A63F13/42Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment by mapping the input signals into game commands, e.g. mapping the displacement of a stylus on a touch screen to the steering angle of a virtual vehicle
    • A63F13/428Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment by mapping the input signals into game commands, e.g. mapping the displacement of a stylus on a touch screen to the steering angle of a virtual vehicle involving motion or position input signals, e.g. signals representing the rotation of an input controller or a player's arm motions sensed by accelerometers or gyroscopes
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/20Input arrangements for video game devices
    • A63F13/21Input arrangements for video game devices characterised by their sensors, purposes or types
    • A63F13/214Input arrangements for video game devices characterised by their sensors, purposes or types for locating contacts on a surface, e.g. floor mats or touch pads
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/20Input arrangements for video game devices
    • A63F13/24Constructional details thereof, e.g. game controllers with detachable joystick handles
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/10Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by input arrangements for converting player-generated signals into game device control signals
    • A63F2300/1068Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by input arrangements for converting player-generated signals into game device control signals being specially adapted to detect the point of contact of the player on a surface, e.g. floor mat, touch pad

Abstract

The embodiment of the application discloses a touch data processing method, a touch data processing device, a storage medium and electronic equipment, wherein when a movement event of a rocker of external equipment is detected, a rocker coordinate corresponding to the rocker is obtained; detecting whether the coordinates of the rocker are preset coordinates or not; when the rocker coordinate is detected to be a preset coordinate, acquiring a historical rocker coordinate corresponding to the rocker coordinate; and when the historical rocker coordinate is not the preset coordinate, adjusting the coordinate parameter of the rocker coordinate to obtain the target rocker coordinate. Therefore, when the rocker coordinate is the preset coordinate and the historical rocker coordinate corresponding to the rocker coordinate is not the preset coordinate, the rocker coordinate is adjusted, the problem that the rocker event does not correspond to the touch event of the target assembly is solved, and the matching accuracy between the electronic equipment and the external equipment is improved.

Description

Touch data processing method and device, storage medium and electronic equipment
Technical Field
The present invention relates to the field of electronic technologies, and in particular, to a method and an apparatus for processing touch data, a storage medium, and an electronic device.
Background
With the development and progress of science and technology, electronic devices are becoming an indispensable part of people's lives, and users can perform various entertainment activities such as watching videos or playing games through the electronic devices. However, when a user plays a game through an electronic device, the user is often limited by the size of the touch screen of the electronic device, so that the user is inconvenient to operate the game through the touch screen, and more users are willing to operate the game in the electronic device through a gamepad.
When a user operates a game in the electronic device through a rocker of the gamepad, the rocker of the gamepad can not accurately control the movement parameters of the electronic device easily due to the precision problem of the rocker and the processing mode problem of data of the rocker.
Disclosure of Invention
The embodiment of the application provides a touch data processing method and device, a storage medium and electronic equipment, which can improve the matching accuracy between the electronic equipment and external equipment.
In a first aspect, an embodiment of the present application provides a method for processing touch data, including:
when a movement event of a rocker of an external device is detected, acquiring a rocker coordinate corresponding to the rocker;
detecting whether the rocker coordinate is a preset coordinate or not;
when the rocker coordinate is detected to be a preset coordinate, acquiring a historical rocker coordinate corresponding to the rocker coordinate;
and when the historical rocker coordinate is not the preset coordinate, adjusting the coordinate parameter of the rocker coordinate to obtain the target rocker coordinate.
In a second aspect, an embodiment of the present application provides a device for processing touch data, including:
the device comprises a first acquisition module, a second acquisition module and a control module, wherein the first acquisition module is used for acquiring a rocker coordinate corresponding to a rocker when the rocker of the external equipment is detected to generate a movement event;
the detection module is used for detecting whether the rocker coordinate is a preset coordinate or not;
the second acquisition module is used for acquiring a historical rocker coordinate corresponding to the rocker coordinate when the rocker coordinate is detected to be a preset coordinate;
and the adjusting module is used for adjusting the coordinate parameters of the rocker coordinates to obtain target rocker coordinates when the historical rocker coordinates are not preset coordinates.
In a third aspect, a storage medium is provided in an embodiment of the present application, where a computer program is stored, and when the computer program runs on a computer, the computer is caused to execute a method for processing touch data as provided in any embodiment of the present application.
In a fourth aspect, the electronic device provided in the embodiments of the present application includes a processor and a memory, where the memory has a computer program, and the processor is configured to execute the method for processing touch data provided in any embodiment of the present application by calling the computer program.
According to the method, in the embodiment of the application, when the movement event of the rocker of the external device is detected, the rocker coordinate corresponding to the rocker is obtained; detecting whether the coordinates of the rocker are preset coordinates or not; when the rocker coordinate is detected to be a preset coordinate, acquiring a historical rocker coordinate corresponding to the rocker coordinate; and when the historical rocker coordinate is not the preset coordinate, adjusting the coordinate parameter of the rocker coordinate to obtain the target rocker coordinate. Therefore, when the rocker coordinate is the preset coordinate and the historical rocker coordinate corresponding to the rocker coordinate is not the preset coordinate, the rocker coordinate is adjusted, the problem that the rocker event does not correspond to the touch event of the target assembly is solved, and the matching accuracy between the electronic equipment and the external equipment is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic view of an application scenario of a touch data processing method according to an embodiment of the present application.
Fig. 2 is a flowchart illustrating a method for processing touch data according to an embodiment of the present disclosure.
Fig. 3 is a schematic view of a direction of a rocker corresponding to the rocker provided in the embodiment of the present application.
Fig. 4 is another flowchart illustrating a touch data processing method according to an embodiment of the present disclosure.
Fig. 5 is a schematic structural diagram of a touch data processing device according to an embodiment of the present disclosure.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Fig. 7 is another schematic structural diagram of an electronic device according to an embodiment of the present application.
DETAILED DESCRIPTION OF EMBODIMENT (S) OF INVENTION
Referring to the drawings, wherein like reference numbers refer to like elements, the principles of the present application are illustrated as being implemented in a suitable computing environment. The following description is based on illustrated embodiments of the application and should not be taken as limiting the application with respect to other embodiments that are not detailed herein.
The term "module" as used herein may be considered a software object executing on the computing system. The various components, modules, engines, and services described herein may be viewed as objects implemented on the computing system. The apparatus and method described herein are preferably implemented in software, but may also be implemented in hardware, and are within the scope of the present application.
Referring to fig. 1, fig. 1 is a schematic view of an application scenario of a touch data processing method according to an embodiment of the present disclosure.
The external device 10 may include a handle, a VR device, a wireless keyboard, and the like, and the electronic device 20 may include a smart phone, a tablet computer, a Personal Digital Assistant (PDA), and the like. The external device 10 and the electronic device 20 may be connected through a wireless network, a bluetooth interface, or a USB interface, and the electronic device 20 may be controlled through the external device 10.
Specifically, the peripheral device 10 includes a joystick 12, and the joystick 12 of the peripheral device 10 corresponds to the target component 212 in the touch screen 210 of the electronic device 20. When the external device 10 is successfully connected to the electronic device 20, and when the movement operation of the joystick 12 in the external device 10 is detected, in the movement process of the joystick, the external device 10 may continuously acquire the joystick coordinate of the joystick 12 in the movement process, and send the acquired joystick coordinate to the electronic device 20 in a wireless connection or wired connection manner. When electronic device 20 receives the rocker coordinates in sequence, the rocker coordinates are converted into touch point coordinates corresponding to target element 212 in touch screen 210. And generates a touch operation of the target component 212 according to the touch point coordinates so that the user can control the electronic device 20 according to the movement operation of the joystick 12 in the external device 10.
Further, the external device 10 further includes a key 14, and the key 14 of the external device 10 corresponds to the first component 214 in the touch screen 210 of the electronic device 20. When a user presses the key 14 of the external device 10, the external device 10 generates pressing data of the pressing operation and transmits the pressing data to the electronic device 20 in real time, and the electronic device 20 processes the pressing data and executes a touch operation corresponding to the first component 214, so that the user can control the electronic device 20 through the pressing operation of the key 14 on the external device 10.
Referring to fig. 2, fig. 2 is a schematic flow chart of a method for processing touch data according to an embodiment of the present disclosure, where the method for processing touch data includes the following steps:
in step S101, when a movement event of a joystick of the peripheral device is detected, a joystick coordinate corresponding to the joystick is obtained.
When the external equipment and the electronic equipment are in a normal connection relation, whether a rocker in the external equipment moves or not is detected. For example, when it is detected that the coordinates of the joystick acquired by the electronic device are not the preset coordinates (0,0), it is determined that a movement event occurs in the joystick of the external device. The external device continuously monitors the movement event of the rocker, collects the rocker coordinates corresponding to the rocker according to a preset sampling frequency such as 20 milliseconds/time, and sequentially sends the rocker coordinates to the electronic device, so that the electronic device can process the rocker coordinates after acquiring the rocker coordinates, converts the rocker coordinates into contact coordinates corresponding to the target component, and then the electronic device can generate a corresponding touch event of the target component based on the contact coordinates.
Further, when the electronic device detects that a rocker of the external device moves, the electronic device obtains a rocker identifier corresponding to the rocker. And determining a component identifier corresponding to the rocker identifier according to the first mapping data stored in the electronic equipment, so as to determine a target component corresponding to the rocker according to the component identifier. And then the movement event of the rocker can be converted into a touch event of the corresponding target component, so that the electronic equipment is controlled through the rocker.
Note that the rocker coordinates (X, Y) are related to the direction of movement of the rocker. Referring to fig. 3, fig. 3 is a schematic view illustrating a direction of a rocker corresponding to the rocker according to the embodiment of the present disclosure. For example, when the stick moves in the positive left direction from the preset coordinate (0,0), the abscissa of the corresponding stick coordinate is less than 0; when the rocker moves in the right-and-left direction from the preset coordinate (0,0), the abscissa of the corresponding rocker coordinate is greater than 0; when the rocker moves along the right-up direction from the preset coordinate (0,0), the vertical coordinate of the corresponding rocker coordinate is greater than 0; when the rocker moves in the direct downward direction from the preset coordinate (0,0), the ordinate of the corresponding rocker coordinate is smaller than 0. Therefore, the rocker coordinate can be determined according to the moving direction of the rocker and the offset of the rocker. For example, when the rocker moves to the lower right direction along the preset coordinates (0,0), the rocker is offset from the abscissa by 1, and is offset from the ordinate by 2, the rocker coordinates (1, -2) can be determined.
In some embodiments, before the step of acquiring the coordinates of the joystick corresponding to the joystick when the joystick of the peripheral device is detected to have a movement event, the method further includes:
and establishing a mapping relation between a rocker of the external equipment and a target component of the electronic equipment to generate corresponding first mapping data.
When the external equipment is successfully connected with the electronic equipment, a rocker in the external equipment selected by a user is received, and rocker information corresponding to the rocker, such as a rocker identifier of the rocker and a movable range of the rocker, is acquired. Meanwhile, touch point coordinates corresponding to touch operation of a user on the touch screen are obtained, and the target component selected by the user is determined according to the touch point coordinates. At the moment, a rocker of the external device is mapped with a target component of the electronic device to establish a first mapping relation between the rocker and the target component and generate corresponding first mapping data. Among them, the first mapping data may include a rocker identification of the rocker, a movable range [0, A ] of the rocker, where A is a maximum moving value of the rocker, a component identification of the target component, a center point coordinate (x0, y0) of the target component, and a radius length R of the target component.
In step S102, whether the rocker coordinates are preset coordinates is detected.
The preset coordinate is a central coordinate (0,0) of the rocker, and after the electronic device obtains the rocker coordinate, whether the rocker coordinate is the preset coordinate (0,0) or not is detected. When the rocker coordinates are detected to be the preset coordinates (0,0), the operation of step S103 is performed. When the rocker coordinate is detected not to be the preset coordinate (0,0), the electronic equipment directly converts the rocker coordinate into the contact coordinate corresponding to the target assembly, and generates the touch operation of the target assembly based on the contact coordinate.
It should be noted that, in the prior art, when it is detected that the joystick coordinate is the preset coordinate (0,0), the electronic device may also directly convert the joystick coordinate that is the preset coordinate (0,0) into the center point coordinate corresponding to the target component, that is, the contact coordinate (0, 0). And after the system reports the event that the touch point coordinate is (0,0), generating a lifting event of the target component based on the touch point coordinate as the preset coordinate (0,0), and controlling the touch point coordinate (0,0) in the target component to be lifted by the system according to the lifting event, namely finishing the touch operation of the touch point coordinate (0,0), wherein the target component is also in a lifting state at the moment. And generating a touch event of the target component based on the coordinates of the next contact which is not (0,0) when the coordinates of the next contact which is reported by the system are not (0,0), and controlling the coordinates of the next contact which is not (0,0) to execute corresponding touch operation by the system so as to realize the touch operation of the target component again.
It can be understood that when the acquired rocker coordinate is the preset coordinate (0,0), it indicates that the rocker is currently in the center position of the rocker movement region. However, when the rocker is currently in the center of the rocker movement area, the rocker may have at least the following two different operating states. Firstly, the rocker is in a centering state, namely the rocker is in a loosening and non-working state, and at the moment, when the rocker is in the centering state, the acquired coordinates of the rocker are necessarily preset coordinates. Secondly, the rocker is in the fast moving state, happens to pass through the central coordinate of rocker when sampling time point to make the rocker coordinate of obtaining at present for predetermineeing coordinate (0,0), the rocker is in operating condition and just the passing through central coordinate of short time this moment.
For the second situation, when the rocker is in a fast moving state and happens to pass through the center coordinate of the rocker at the sampling time point, if the electronic device still converts the rocker coordinate of the preset coordinate (0,0) into the contact coordinate of (0,0), after the system reports an event that the contact coordinate is (0,0), the contact coordinate (0,0) in the system control target component is lifted, that is, the control target component is lifted.
However, when the target component is lifted, the real situation that the user operates the external device is that the rocker of the external device does not lift the rocker, but the user operates the rocker to be in a moving state all the time. At this time, the touch event of the target device and the joystick event cannot be corresponded. Therefore, when the rocker happens to pass through the center of the rocker in the moving process, the situation that the event of the rocker does not correspond to the event of the target assembly occurs at a high probability, so that the matching accuracy between the electronic equipment and the external equipment is not high.
Based on this problem, step S104 in this embodiment adjusts the rocker coordinate in the rocker coordinates that is consistent with the preset coordinate to the target rocker coordinate, thereby changing the contact coordinate corresponding to the rocker coordinate. For example, the target rocker coordinate corresponds to a contact coordinate of (2,2), so that the contact coordinate is not (0, 0). Therefore, when the rocker rapidly passes through the central position of the rocker, the touch point coordinates reported by the system of the electronic equipment are (2,2), the system continues to execute the sliding touch operation of the target assembly according to the touch point coordinates (2,2), the lifting event of the touch point coordinates (0,0) cannot be generated, and the matching accuracy between the electronic equipment and the external equipment is improved.
In step S102, a history stick coordinate corresponding to the stick coordinate is acquired.
As can be seen from the above, when the obtained coordinates of the joystick are the preset coordinates (0,0), the joystick may have at least the following two different operating states. Firstly, the rocker is in a centering state, namely the rocker is in a loosening and non-working state, and at the moment, when the rocker is in the centering state, the acquired coordinates of the rocker are necessarily preset coordinates. Secondly, the rocker is in the fast moving state, happens to pass through the central coordinate of rocker when sampling time point to make the rocker coordinate of obtaining at present for predetermineeing coordinate (0,0), the rocker is in operating condition and just the passing through central coordinate of short time this moment.
However, the actual working state of the current rocker cannot be accurately determined by only using a rocker coordinate which is a preset coordinate. Therefore, historical rocker coordinates corresponding to the rocker coordinates need to be obtained, and the real working state of the current rocker is determined through the historical rocker coordinates.
The historical rocker coordinates can be one or more historical rocker coordinates in a preset time period. For example, the historical rocker coordinate may be a previous rocker coordinate corresponding to the rocker coordinate, and the historical rocker coordinate may also be a previous two rocker coordinates corresponding to the rocker coordinate. For example, when the two previous rocker coordinates are obtained and do not correspond to the preset coordinates, it indicates that the rocker is in a fast moving state and happens to pass through the working state of the central coordinate of the rocker at the sampling time point, and at this time, the operation of step S104 is executed, so that after the rocker coordinate which is the preset coordinate is adjusted to the target rocker coordinate, the contact coordinate corresponding to the target rocker coordinate is not (0, 0). Therefore, when the rocker passes through the central coordinate quickly, the electronic equipment cannot generate the lifting event of the target assembly, the problem that the real event of the rocker does not correspond to the actual event of the target assembly when the rocker passes through the central coordinate quickly in the prior art is solved, and the matching accuracy between the electronic equipment and the external equipment is improved.
In addition, when the coordinates of the two current rockers are preset coordinates, the fact that the rockers are in the center coordinates for a certain time is shown, and the rockers are in the centering state inevitably. Therefore, when the rocker is detected to be in the centering state, the rocker coordinate which is the preset coordinate is not adjusted, so that the electronic equipment reports the contact coordinate which is (0,0) on the system according to the rocker coordinate which is the preset coordinate (0,0), a lifting event of the target component is generated, and the matching accuracy between the electronic equipment and the external equipment is improved.
In step S104, when the historical joystick coordinate is not the preset coordinate, the coordinate parameter of the joystick coordinate is adjusted to obtain the target joystick coordinate.
When the historical rocker coordinate is not the preset coordinate, the current rocker is in a fast moving state, and the current rocker happens to pass through the working state of the central coordinate of the rocker at the sampling time point. At this time, the coordinate parameter of the rocker coordinate needs to be adjusted to obtain the target rocker coordinate which is not the preset coordinate (0, 0). And the touch point coordinate corresponding to the corresponding target rocker coordinate is not (0,0), and when the touch point coordinate which is not (0,0) is reported in the system, the system controls the touch point coordinate to generate a touch event of the target component. Therefore, when the rocker passes through the central coordinate quickly, the electronic equipment cannot generate the lifting event of the target assembly, the problem that the real event of the rocker does not correspond to the actual event of the target assembly when the rocker passes through the central coordinate quickly in the prior art is solved, and the matching accuracy between the electronic equipment and the external equipment is improved.
In some embodiments, when the rocker coordinate is detected not to be the preset coordinate, acquiring a historical rocker coordinate corresponding to the rocker coordinate; when the historical rocker coordinate is a preset coordinate, determining a distance parameter between the rocker coordinate and the preset coordinate; and when the distance parameter is larger than the preset value, adjusting the coordinate parameter of the rocker coordinate corresponding to the previous rocker coordinate to obtain the previous target rocker coordinate.
When the rocker stops moving, the electronic equipment reports the coordinates (0,0) of the contact point on the system and then generates a lifting event of the target component. Subsequently, when a movement event of a rocker of the external device is detected, the electronic device converts the rocker coordinate (0,0) into the contact coordinate (0,0) when the rocker coordinate is acquired as the preset coordinate. Therefore, the contact point coordinates (0,0) generated when the rocker starts moving coincide with the contact point coordinates (0,0) generated when the rocker stops moving. It should be noted that, because the event read from the electronic device node by the electronic device input handler has a buffering mechanism, that is, the previous event and the current event of the same input device are consistent, the current event is not reported repeatedly. That is, since the touch point coordinates (0,0) generated when the joystick starts to move are identical to the touch point coordinates (0,0) generated when the joystick stops moving, the electronic device cannot distinguish whether the touch point coordinates (0,0) are in the joystick centering state or in the joystick movement starting state. Therefore, when the first rocker coordinate is the preset coordinate (0,0) and the converted touch point coordinate is (0,0), the device node buffer mechanism of the electronic device considers that the event does not change, the touch point coordinate (0,0) which starts to move at this time cannot be read by the inputreader, and the touch point coordinate (0,0) cannot be reported.
And further, determining a distance parameter between the rocker coordinate and a preset coordinate, and when the distance parameter is greater than the preset value, indicating that the current rocker coordinate exceeds the maximum value of the movable range of the rocker, namely the rocker coordinate is an invalid rocker coordinate. At this time, the touch point coordinate corresponding to the rocker coordinate also exceeds the maximum touch range of the target component, and the touch operation of the target component cannot be triggered based on the touch point coordinate after the touch point coordinate is reported by the system. Moreover, because the touch point coordinates (x, y) corresponding to the rocker coordinates when the rocker starts to move are not reported, the electronic device cannot generate the touch event of the target component according to the touch point coordinates (x, y) exceeding the maximum touch range of the target component alone, and the electronic device cannot be controlled by the rocker at this time.
Based on the problem, when the distance parameter between the rocker coordinate and the preset coordinate is larger than the preset value, the coordinate parameter of the rocker coordinate corresponding to the previous rocker coordinate is adjusted to obtain the previous target rocker coordinate. At this time, the previous target rocker coordinate is not the preset coordinate (0,0), and accordingly, the previous target rocker coordinate is not the preset coordinate when the previous target rocker coordinate is converted into the contact point coordinate. Therefore, the touch operation of the target component based on the touch point coordinates can be generated according to the touch point coordinates which are not the preset coordinates, namely, the target component starts to move. And when receiving the touch point coordinate corresponding to the current rocker coordinate, generating the touch operation based on the touch point coordinate again, and at the moment, continuing to move the target assembly. Therefore, when the rocker coordinate is detected not to be the preset coordinate, the historical rocker coordinate corresponding to the rocker coordinate can be obtained; when the historical rocker coordinate is a preset coordinate, determining a distance parameter between the rocker coordinate and the preset coordinate; and when the distance parameter is larger than the preset value, adjusting the coordinate parameter of the rocker coordinate corresponding to the previous rocker coordinate to obtain the previous target rocker coordinate. Therefore, the problem that the rocker cannot control the electronic equipment when the rocker moves too fast is solved.
In some embodiments, after the step of adjusting the coordinate parameter of the joystick coordinate to obtain the target joystick coordinate, the method further includes: determining the coordinates of a contact in the target assembly corresponding to the coordinates of the target rocker; and generating a touch event of the target component in response to the touch point coordinates.
Wherein the corresponding contact point coordinates of the target rocker coordinates in the target assembly can be determined from the first mapping data. Specifically, the touch point coordinates corresponding to the rocker coordinates can be determined according to the following formula:
x=x0+(X/A)*R;
y=y0+(X/A)*R;
wherein, (X, Y) is the coordinate of the target rocker, (X0, Y0) is the coordinate of the center point of the target assembly, A is the maximum movement value of the rocker, R is the radius length of the target assembly, and (X, Y) is the coordinate of the contact point. Each contact coordinate is required to conform to a Multi-touch Protocol (MTP), and the electronic device is a Multi-touch device.
It should be noted that the multi-touch protocol may enable the kernel driver to report any multi-finger data information to the user layer. Specifically, the multi-touch information is carried by ABS _ MT and sent in a certain order, for example, ABS _ MT _ POSITION _ X, ABS _ MT _ POSITION _ Y, and then an input _ MT _ sync is invoked to generate a SYN _ REPORT to mark the end of a point, telling the receiving party to receive the information of the current finger and prepare to receive the touch data of other fingers. And finally, calling an input _ sync function to report the contact coordinates to start action and tell a receiver to start receiving the next series of multi-point touch information.
The MTP protocol defines a series of ABS _ MT events, such as ABS _ MT _ TOUCH _ MAJOR, ABS _ MT _ POSITION _ X, and ABS _ MT _ POSITION _ Y, to implement multi-TOUCH. When the electronic equipment needs to acquire the abscissa corresponding to the contact coordinate, an ABS _ MT _ POSITION _ X event is generated, and the abscissa corresponding to the contact coordinate is acquired according to the ABS _ MT _ POSITION _ X event, namely the abscissa corresponding to the contact coordinate can be acquired according to the formula and the abscissa of the rocker coordinate; similarly, when the electronic device needs to acquire the ordinate corresponding to the contact coordinate, an ABS _ MT _ POSITION _ Y event is generated, and the ordinate corresponding to the contact coordinate is acquired according to the ABS _ MT _ POSITION _ Y event, that is, the ordinate corresponding to the contact coordinate can be acquired according to the above formula and the ordinate of the joystick coordinate. And after the touch point coordinates are obtained, calling an input _ sync function to generate a SYN _ REPORT event, reporting the corresponding touch point coordinates in the system, and delivering the touch point coordinate event to an input _ dispatcher system for distribution processing so as to realize the touch event of the target component.
As can be seen from the above, in the touch data processing method provided in the embodiment of the present application, when a movement event of a joystick of an external device is detected, a coordinate of the joystick corresponding to the joystick is obtained; detecting whether the coordinates of the rocker are preset coordinates or not; when the rocker coordinate is detected to be a preset coordinate, acquiring a historical rocker coordinate corresponding to the rocker coordinate; and when the historical rocker coordinate is not the preset coordinate, adjusting the coordinate parameter of the rocker coordinate to obtain the target rocker coordinate. Therefore, when the rocker coordinate is the preset coordinate and the historical rocker coordinate corresponding to the rocker coordinate is not the preset coordinate, the rocker coordinate is adjusted, the problem that the rocker event does not correspond to the touch event of the target assembly is solved, and the matching accuracy between the electronic equipment and the external equipment is improved.
Referring to fig. 4, fig. 4 is another schematic flow chart of a touch data processing method according to an embodiment of the present disclosure. Specifically, the method for processing touch data may include the following steps:
in step S201, when a movement event of a joystick of the peripheral device is detected, a coordinate of the joystick corresponding to the joystick is obtained.
When the external equipment and the electronic equipment are in a normal connection relation, whether a rocker in the external equipment moves or not is detected. For example, when it is detected that the coordinates of the joystick acquired by the electronic device are not the preset coordinates (0,0), it is determined that a movement event occurs in the joystick of the external device. The external equipment continuously monitors the movement event of the rocker, acquires the rocker coordinates corresponding to the rocker according to a preset sampling frequency such as 20 milliseconds/time, and sequentially sends the rocker coordinates to the electronic equipment, so that the electronic equipment can process the rocker coordinates after acquiring the rocker coordinates, converts the rocker coordinates into contact coordinates corresponding to a target component in the electronic equipment, and generates a corresponding touch event of the target component based on the contact coordinates.
Further, when the electronic device detects that a rocker of the external device moves, the electronic device obtains a rocker identifier corresponding to the rocker. And determining a component identifier corresponding to the rocker identifier according to the first mapping data stored in the electronic equipment, so as to determine a target component corresponding to the rocker according to the component identifier. And then the movement event of the rocker can be converted into a touch event of the corresponding target component, so that the electronic equipment is controlled through the rocker.
In step S202, it is detected whether the rocker coordinates are within the preset area.
The preset area is a rocker dead zone which is set by a manufacturer of the external equipment, and when the rocker moves in the rocker dead zone, the rocker will all belong to invalid movement and cannot generate corresponding rocker movement events. It can be appreciated that the rocker dead band setting is to prevent the rocker from failing to be fully centered due to the accuracy problem of the rocker, thereby generating a series of rocker coordinates that are not preset coordinates, thereby causing the target assembly to be out of control. Therefore, whether the rocker coordinate is in the preset area needs to be detected, so that the rocker coordinate in the preset area is adjusted, and the matching accuracy between the electronic device and the external device is improved.
It should be noted that, the electronic device of the present application may store a plurality of pieces of rocker dead zone data of the existing external device. Or when the external equipment is connected with the electronic equipment, the electronic equipment can automatically acquire the dead zone data of the rocker of the external equipment and store the dead zone data of the rocker. Or when the external equipment is connected with the electronic equipment, the electronic equipment can also receive the rocker dead zone data manually input by the user and store the rocker dead zone data. Therefore, after the electronic equipment is connected with the external equipment, the dead zone data of the rocker of the external equipment can be acquired, and whether the coordinate of the rocker needs to be adjusted or not is judged according to the dead zone data of the rocker. Specifically, when the rocker coordinate is located in the preset region, the operation of step S203 is performed, that is, the rocker coordinate is adjusted to the preset coordinate (0, 0). When the rocker coordinate is not located in the preset area, the rocker coordinate is directly used as the target rocker coordinate, and the operation of step S208 is performed.
In step S203, the joystick coordinate is adjusted to a preset coordinate.
When the rocker coordinate is located in the preset area, the rocker coordinate is adjusted to be the preset coordinate (0,0), so that the acquired corresponding contact coordinate is also (0, 0). Therefore, when the coordinates of the joystick are located in the preset area, the movement operation of the joystick is an invalid operation, and the touch operation of the target component is not generated according to the invalid operation of the joystick.
In step S204, it is detected whether the rocker coordinates are preset coordinates.
The preset coordinate is a central coordinate (0,0) of the rocker, and after the electronic device obtains the rocker coordinate, whether the rocker coordinate is the preset coordinate (0,0) or not is detected. When the rocker coordinate is detected to be the preset coordinate (0,0), the operation of step S205 is performed. When it is detected that the rocker coordinate is not the preset coordinate (0,0), the rocker coordinate is directly used as the target rocker coordinate, and the operation of step S208 is executed, that is, the electronic device directly converts the rocker coordinate into the touch point coordinate corresponding to the target component, and generates the touch operation of the target component based on the touch point coordinate.
It should be noted that, in the prior art, when it is detected that the joystick coordinate is the preset coordinate (0,0), the electronic device may also directly convert the joystick coordinate that is the preset coordinate (0,0) into the center point coordinate corresponding to the target component, that is, the contact coordinate (0, 0). And after the system reports the event that the touch point coordinate is (0,0), the system controls the touch point coordinate (0,0) in the target component to be lifted, namely the touch operation of the touch point coordinate (0,0) is finished, and the target component is also in a lifted state at the moment. And when the next contact coordinate reported by the system is not (0,0), the system controls the next contact coordinate which is not (0,0) to execute the touch operation so as to realize the touch operation of the target component again.
It can be understood that when the acquired rocker coordinate is the preset coordinate (0,0), it indicates that the rocker is currently in the center position of the rocker movement region. However, when the rocker is currently in the center of the rocker movement area, the rocker may have at least the following two different operating states. Firstly, the rocker is in a centering state, namely the rocker is in a loosening and non-working state, and at the moment, when the rocker is in the centering state, the acquired coordinates of the rocker are necessarily preset coordinates. Secondly, the rocker is in the fast moving state, happens to pass through the central coordinate of the rocker when sampling time point, thereby the rocker coordinate that makes current acquireing is for presetting coordinate (0,0), and the rocker is in operating condition and only transient process central coordinate this moment.
For the second situation, when the rocker is in a fast moving state and happens to pass through the center coordinate of the rocker at the sampling time point, if the electronic device still converts the rocker coordinate of the preset coordinate (0,0) into the contact coordinate of (0,0), after the system reports the event that the contact coordinate is (0,0), the contact coordinate (0,0) in the system control target component is lifted, that is, the control target component is lifted.
However, the external device is actually in a state that the external device does not have a rocker lifting event, but the rocker is always in a moving state. Therefore, when the rocker happens to pass through the center of the rocker in the moving process, the situation that the event of the rocker does not correspond to the event of the target assembly occurs at a high probability, so that the matching accuracy between the electronic equipment and the external equipment is not high.
Based on this problem, in step S207 in this embodiment, the rocker coordinate that is consistent with the preset coordinate in the rocker coordinates is adjusted to be the target rocker coordinate, so as to change the contact coordinate corresponding to the rocker coordinate. For example, the target rocker coordinate corresponds to a contact coordinate of (2,2), so that the contact coordinate is not (0, 0). Therefore, when the rocker rapidly passes through the central position of the rocker, the touch point coordinates reported by the system of the electronic equipment are (2,2), the system continues to execute the sliding touch operation of the target assembly according to the touch point coordinates (2,2), the lifting event of the touch point coordinates (0,0) cannot be generated, and the matching accuracy between the electronic equipment and the external equipment is improved. In step S205, the historical stick coordinates corresponding to the stick coordinates are acquired.
The historical rocker coordinates can be one or more historical rocker coordinates in a preset time period. For example, the historical rocker coordinate may be a previous rocker coordinate corresponding to the rocker coordinate, and the historical rocker coordinate may also be a previous two rocker coordinates corresponding to the rocker coordinate. For example, when the two previous rocker coordinates are obtained and do not correspond to the preset coordinates, it indicates that the rocker is in a fast moving state and happens to pass through the working state of the central coordinate of the rocker at the sampling time point, and at this time, the operation of step S104 is executed, so that after the rocker coordinate which is the preset coordinate is adjusted to the target rocker coordinate, the contact coordinate corresponding to the target rocker coordinate is not (0, 0). Therefore, when the rocker passes through the central coordinate quickly, the electronic equipment cannot generate the lifting event of the target assembly, the problem that the real event of the rocker does not correspond to the actual event of the target assembly when the rocker passes through the central coordinate quickly in the prior art is solved, and the matching accuracy between the electronic equipment and the external equipment is improved.
In addition, when the coordinates of the two current rockers are preset coordinates, the fact that the rockers are in the center coordinates for a certain time is shown, and the rockers are in the centering state inevitably. Therefore, when the rocker is detected to be in the centering state, the rocker coordinate which is the preset coordinate is not adjusted, so that the electronic equipment reports the contact coordinate which is (0,0) on the system according to the rocker coordinate which is the preset coordinate (0,0), a lifting event of the target component is generated, and the matching accuracy between the electronic equipment and the external equipment is improved.
In step S206, when the historical joystick coordinate is not the preset coordinate, a first coordinate parameter corresponding to the historical joystick coordinate is acquired.
When the historical rocker coordinate is not the preset coordinate, the current rocker is in a fast moving state, and the current rocker happens to pass through the working state of the central coordinate of the rocker at the sampling time point. At this time, the coordinate parameter of the rocker coordinate needs to be adjusted to obtain the target rocker coordinate which is not the preset coordinate (0, 0). And the touch point coordinate corresponding to the corresponding target rocker coordinate is not (0,0), and when the touch point coordinate which is not (0,0) is reported in the system, the system controls the touch point coordinate to generate a touch event of the target component. Therefore, when the rocker rapidly passes through the central coordinate, the electronic equipment cannot generate the lifting event of the target assembly, the problem that the real event of the rocker does not correspond to the actual event of the target assembly when the rocker rapidly passes through the central coordinate in the prior art is solved, and the accuracy of the rocker in the external equipment for controlling the electronic equipment is improved.
The method comprises the steps of obtaining a first coordinate parameter corresponding to a historical rocker coordinate, and adjusting the rocker coordinate through the first coordinate parameter. For example, when the historical rocker coordinate is (-3,1), the first coordinate parameters of the rocker coordinate are determined to be-3 and 1.
In step S207, the coordinate parameter of the joystick coordinate is adjusted according to the first coordinate parameter to obtain the target joystick coordinate.
Adjusting parameters such as-1 and 1 corresponding to the rocker coordinate can be obtained according to the first coordinate parameters-3 and 1, and the rocker coordinate is adjusted according to the adjusting parameters to obtain a target rocker coordinate (-1, 1). And predicting the coordinates of the target rocker according to the coordinate parameters of the historical rocker coordinates corresponding to the rocker coordinates, so that the coordinates of the target rocker conform to the current movement track of the rocker.
In some embodiments, the step of adjusting the coordinate parameter of the joystick coordinate according to the first coordinate parameter to obtain the target joystick coordinate includes: determining the moving direction of the rocker according to the first coordinate parameter and the coordinate parameter of the rocker coordinate; acquiring an adjusting parameter corresponding to the coordinate of the rocker according to the moving direction; and adjusting the coordinate parameters of the rocker coordinates based on the adjustment parameters.
And determining the moving direction of the rocker according to the first coordinate parameter of the historical rocker coordinate and the coordinate parameter of the rocker coordinate. I.e. subtracting the historical rocker coordinates from the rocker coordinates to determine the direction of movement. For example, the historical rocker coordinate is (-3,1), the rocker coordinate is (0,0), and the subtraction result is (3, -1), and the moving direction of the rocker is the lower right direction. The coordinates of the rocker can be adjusted according to the moving direction of the rocker to obtain the coordinates (1, -1) of the target rocker.
In step S208, the target rocker coordinates or the contact coordinates in the target assembly corresponding to the rocker coordinates are determined.
Wherein the corresponding contact point coordinates of the target rocker coordinates in the target assembly can be determined from the first mapping data. Specifically, the touch point coordinates corresponding to the rocker coordinates can be determined according to the following formula:
x=x0+(X/A)*R;
y=y0+(X/A)*R;
wherein, (X, Y) is the coordinate of the target rocker, (X0, Y0) is the coordinate of the center point of the target assembly, A is the maximum movement value of the rocker, R is the radius length of the target assembly, and (X, Y) is the coordinate of the contact point. Each contact coordinate is required to conform to a Multi-touch Protocol (MTP), and the electronic device is a Multi-touch device.
It should be noted that the multi-touch protocol may enable the kernel driver to report any multi-finger data information to the user layer. Specifically, the multi-touch information is carried by ABS _ MT and sent in a certain order, for example, ABS _ MT _ POSITION _ X, ABS _ MT _ POSITION _ Y, and then an input _ MT _ sync is invoked to generate a SYN _ REPORT to mark the end of a point, telling the receiving party to receive the information of the current finger and prepare to receive the touch data of other fingers. And finally, calling an input _ sync function to report the contact coordinates to start action and tell a receiver to start receiving the next series of multi-point touch information.
The MTP protocol defines a series of ABS _ MT events, such as ABS _ MT _ TOUCH _ MAJOR, ABS _ MT _ POSITION _ X, and ABS _ MT _ POSITION _ Y, to implement multi-TOUCH. When the electronic equipment needs to acquire the abscissa corresponding to the contact coordinate, an ABS _ MT _ POSITION _ X event is generated, and the abscissa corresponding to the contact coordinate is acquired according to the ABS _ MT _ POSITION _ X event, namely the abscissa corresponding to the contact coordinate can be acquired according to the formula and the abscissa of the rocker coordinate; similarly, when the electronic device needs to acquire the ordinate corresponding to the contact coordinate, an ABS _ MT _ POSITION _ Y event is generated, and the ordinate corresponding to the contact coordinate is acquired according to the ABS _ MT _ POSITION _ Y event, that is, the ordinate corresponding to the contact coordinate can be acquired according to the above formula and the ordinate of the joystick coordinate.
In step S209, a touch event of the target component is generated in response to the touch point coordinates.
After the touch point coordinates are obtained, an input _ sync function is called to generate a SYN _ REPORT event, corresponding touch point coordinates are reported in the system, and the touch point coordinate event is delivered to an input _ dispatcher system for distribution processing, so that the touch event of the target assembly is realized.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a touch data processing device according to an embodiment of the present disclosure. Specifically, the touch data processing device includes: a first acquisition module 31, a detection module 32, a second acquisition module 33 and an adjustment module 34.
The first obtaining module 31 is configured to obtain a rocker coordinate corresponding to a rocker when a movement event of the rocker of the external device is detected.
And the detection module 32 is used for detecting whether the rocker coordinate is a preset coordinate.
And a second obtaining module 33, configured to obtain a historical rocker coordinate corresponding to the rocker coordinate when the rocker coordinate is detected to be the preset coordinate.
And the adjusting module 34 is configured to adjust the coordinate parameter of the rocker coordinate to obtain a target rocker coordinate when the historical rocker coordinate is not the preset coordinate.
In some embodiments, the adjustment module 34 includes an acquisition sub-module and an adjustment sub-module.
And the obtaining submodule is used for obtaining a first coordinate parameter corresponding to the historical rocker coordinate when the historical rocker coordinate is not the preset coordinate.
And the adjusting submodule is used for adjusting the coordinate parameter of the rocker coordinate according to the first coordinate parameter so as to obtain the target rocker coordinate.
In some embodiments, the adjusting module 34 is further configured to determine a moving direction of the joystick according to the first coordinate parameter and the coordinate parameter of the joystick coordinate; acquiring an adjusting parameter corresponding to the coordinate of the rocker according to the moving direction; and adjusting the coordinate parameters of the rocker coordinates based on the adjustment parameters.
In some embodiments, the first obtaining module 31 is further configured to detect whether the rocker coordinate is located in the preset area after obtaining the rocker coordinate corresponding to the rocker; and when the rocker coordinate is detected to be located in the preset area, adjusting the rocker coordinate to be the preset coordinate.
The embodiment of the application also provides the electronic equipment. Referring to fig. 6, an electronic device 500 includes a processor 501 and a memory 502. The processor 501 is electrically connected to the memory 502.
The processor 500 is a control center of the electronic device 500, connects various parts of the whole electronic device using various interfaces and lines, performs various functions of the electronic device 500 by running or loading a computer program stored in the memory 502, and calls data stored in the memory 502, and processes the data, thereby performing overall monitoring of the electronic device 500.
The memory 502 may be used to store software programs and modules, and the processor 501 executes various functional applications and data processing by running the computer programs and modules stored in the memory 502. The memory 502 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, a computer program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory 502 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 502 may also include a memory controller to provide the processor 501 with access to the memory 502.
In this embodiment, the processor 501 in the electronic device 500 loads instructions corresponding to one or more processes of the computer program into the memory 502, and the processor 501 runs the computer program stored in the memory 502, so as to implement various functions as follows:
when a movement event of a rocker of the external equipment is detected, acquiring a rocker coordinate corresponding to the rocker;
detecting whether the coordinates of the rocker are preset coordinates or not;
when the rocker coordinate is detected to be a preset coordinate, acquiring a historical rocker coordinate corresponding to the rocker coordinate;
and when the historical rocker coordinate is not the preset coordinate, adjusting the coordinate parameter of the rocker coordinate to obtain the target rocker coordinate.
In some embodiments, when the coordinate parameter of the joystick coordinate is adjusted to obtain the target joystick coordinate, the processor 501 may specifically perform the following steps:
acquiring a first coordinate parameter corresponding to a historical rocker coordinate;
and adjusting the coordinate parameter of the rocker coordinate according to the first coordinate parameter to obtain the target rocker coordinate.
In some embodiments, when the coordinate parameter of the joystick coordinate is adjusted according to the first coordinate parameter, the processor 501 may specifically perform the following steps:
determining the moving direction of the rocker according to the first coordinate parameter and the coordinate parameter of the rocker coordinate;
acquiring an adjusting parameter corresponding to the coordinate of the rocker according to the moving direction;
and adjusting the coordinate parameters of the rocker coordinates based on the adjustment parameters.
In some embodiments, after obtaining the rocker coordinates corresponding to the rocker, the processor 501 may specifically perform the following steps:
detecting whether the coordinates of the rocker are located in a preset area;
and when the rocker coordinate is detected to be located in the preset area, adjusting the rocker coordinate to be the preset coordinate.
The processor 501 may further specifically perform the following steps:
when the rocker coordinate is detected not to be the preset coordinate, acquiring a historical rocker coordinate corresponding to the rocker coordinate;
when the historical rocker coordinate is a preset coordinate, determining a distance parameter between the rocker coordinate and the preset coordinate;
and when the distance parameter is larger than the preset value, adjusting the coordinate parameter of the rocker coordinate corresponding to the previous rocker coordinate to obtain the previous target rocker coordinate.
In some embodiments, after adjusting the coordinate parameter of the joystick coordinate to obtain the target joystick coordinate, the processor 501 may further specifically perform the following steps:
determining the coordinates of a contact in the target assembly corresponding to the coordinates of the target rocker;
and generating a touch event of the target component in response to the touch point coordinates.
As can be seen from the above, in the electronic device provided in the embodiment of the present application, when a movement event of a joystick of an external device is detected, a coordinate of the joystick corresponding to the joystick is obtained; detecting whether the coordinates of the rocker are preset coordinates or not; when the rocker coordinate is detected to be a preset coordinate, acquiring a historical rocker coordinate corresponding to the rocker coordinate; and when the historical rocker coordinate is not the preset coordinate, adjusting the coordinate parameter of the rocker coordinate to obtain the target rocker coordinate. Therefore, when the rocker coordinate is the preset coordinate and the historical rocker coordinate corresponding to the rocker coordinate is not the preset coordinate, the rocker coordinate is adjusted, the problem that the rocker event does not correspond to the touch event of the target assembly is solved, and the matching accuracy between the electronic equipment and the external equipment is improved.
Referring to fig. 7, in some embodiments, the electronic device 500 may further include: a display 503, radio frequency circuitry 504, audio circuitry 505, and a power supply 506. The display 503, the rf circuit 504, the audio circuit 505, and the power source 506 are electrically connected to the processor 501.
The display 503 may be used to display information entered by or provided to the user as well as various graphical user interfaces, which may be made up of graphics, text, icons, video, and any combination thereof. The Display 503 may include a Display panel, and in some embodiments, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The rf circuit 504 may be used for transceiving rf signals to establish wireless communication with a network device or other electronic devices via wireless communication, and for transceiving signals with the network device or other electronic devices.
The audio circuit 505 may be used to provide an audio interface between a user and an electronic device through a speaker, microphone.
The power source 506 may be used to power various components of the electronic device 500. In some embodiments, power supply 506 may be logically coupled to processor 501 through a power management system, such that functions of managing charging, discharging, and power consumption are performed through the power management system.
Although not shown in fig. 7, the electronic device 500 may further include a camera, a bluetooth module, and the like, which are not described in detail herein.
An embodiment of the present application further provides a storage medium, where the storage medium stores a computer program, and when the computer program runs on a computer, the computer is caused to execute the method for processing touch data in any of the foregoing embodiments, such as: when a movement event of a rocker of the external equipment is detected, acquiring a rocker coordinate corresponding to the rocker; detecting whether the coordinates of the rocker are preset coordinates or not; when the rocker coordinate is detected to be a preset coordinate, acquiring a historical rocker coordinate corresponding to the rocker coordinate; and when the historical rocker coordinate is not the preset coordinate, adjusting the coordinate parameter of the rocker coordinate to obtain the target rocker coordinate.
In the embodiment of the present application, the storage medium may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
It should be noted that, for the touch data processing method in the embodiment of the present application, it can be understood by a person skilled in the art that all or part of the process of implementing the touch data processing method in the embodiment of the present application can be completed by controlling the relevant hardware through a computer program, where the computer program can be stored in a computer readable storage medium, such as a memory of an electronic device, and executed by at least one processor in the electronic device, and the process of executing the process can include, for example, the process of the embodiment of the touch data processing method. The storage medium may be a magnetic disk, an optical disk, a read-only memory, a random access memory, etc.
In the touch data processing apparatus according to the embodiment of the present application, each functional module may be integrated into one processing chip, or each functional module may exist alone physically, or two or more functional modules are integrated into one functional module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented as a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium such as a read-only memory, a magnetic or optical disk, or the like.
The foregoing describes in detail a method, an apparatus, a storage medium, and an electronic device for processing touch data provided in an embodiment of the present application, and a specific example is applied in the present application to explain principles and embodiments of the present application, and the description of the foregoing embodiments is only used to help understand the method and core ideas of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A method for processing touch data is characterized by comprising the following steps:
when a movement event of a rocker of an external device is detected, acquiring a rocker coordinate corresponding to the rocker;
detecting whether the rocker coordinate is a preset coordinate or not;
when the rocker coordinate is detected to be a preset coordinate, acquiring a historical rocker coordinate corresponding to the rocker coordinate;
and when the historical rocker coordinate is not the preset coordinate, adjusting the coordinate parameter of the rocker coordinate to obtain the target rocker coordinate.
2. The method of claim 1, wherein the step of adjusting the coordinate parameters of the rocker coordinates to obtain target rocker coordinates comprises:
acquiring a first coordinate parameter corresponding to the historical rocker coordinate;
and adjusting the coordinate parameter of the rocker coordinate according to the first coordinate parameter to obtain a target rocker coordinate.
3. The method of claim 2, wherein the step of adjusting the coordinate parameter of the rocker coordinate based on the first coordinate parameter comprises:
determining the moving direction of the rocker according to the first coordinate parameter and the coordinate parameter of the rocker coordinate;
acquiring an adjusting parameter corresponding to the rocker coordinate according to the moving direction;
and adjusting the coordinate parameters of the rocker coordinates based on the adjustment parameters.
4. The method of claim 1, wherein the step of obtaining the rocker coordinates corresponding to the rocker further comprises:
detecting whether the rocker coordinate is located in a preset area or not;
and when the rocker coordinate is detected to be located in a preset area, adjusting the rocker coordinate to be a preset coordinate.
5. The method of claim 1, further comprising:
when the rocker coordinate is detected not to be a preset coordinate, acquiring a historical rocker coordinate corresponding to the rocker coordinate;
when the historical rocker coordinate is a preset coordinate, determining a distance parameter between the rocker coordinate and the preset coordinate;
and when the distance parameter is larger than a preset value, adjusting the coordinate parameter of the rocker coordinate corresponding to the previous rocker coordinate to obtain the previous target rocker coordinate.
6. The method of claim 1, wherein the step of adjusting the coordinate parameters of the rocker coordinates to obtain target rocker coordinates is further followed by:
determining the coordinates of the contact points in the target assembly corresponding to the coordinates of the target rocker;
and responding to the touch point coordinates to generate a touch event of the target assembly.
7. A processing device of touch data, comprising:
the device comprises a first acquisition module, a second acquisition module and a control module, wherein the first acquisition module is used for acquiring a rocker coordinate corresponding to a rocker when the rocker of the external equipment is detected to generate a movement event;
the detection module is used for detecting whether the rocker coordinate is a preset coordinate or not;
the second acquisition module is used for acquiring a historical rocker coordinate corresponding to the rocker coordinate when the rocker coordinate is detected to be a preset coordinate;
and the adjusting module is used for adjusting the coordinate parameters of the rocker coordinates to obtain target rocker coordinates when the historical rocker coordinates are not preset coordinates.
8. The apparatus of claim 7, wherein the adjustment module comprises:
the obtaining sub-module is used for obtaining a first coordinate parameter corresponding to the historical rocker coordinate when the historical rocker coordinate is not a preset coordinate;
and the adjusting submodule is used for adjusting the coordinate parameter of the rocker coordinate according to the first coordinate parameter so as to obtain a target rocker coordinate.
9. A storage medium on which a computer program is stored, characterized in that, when the computer program runs on a computer, the computer is caused to execute the method of processing touch data according to claim 1.
10. An electronic device, comprising a processor and a memory, wherein the memory has a computer program, and the processor is configured to execute the method for processing touch data according to claim 1 by calling the computer program.
CN201911109156.2A 2019-11-13 2019-11-13 Touch data processing method and device, storage medium and electronic equipment Pending CN112791392A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911109156.2A CN112791392A (en) 2019-11-13 2019-11-13 Touch data processing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911109156.2A CN112791392A (en) 2019-11-13 2019-11-13 Touch data processing method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN112791392A true CN112791392A (en) 2021-05-14

Family

ID=75803389

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911109156.2A Pending CN112791392A (en) 2019-11-13 2019-11-13 Touch data processing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN112791392A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116036578A (en) * 2023-01-28 2023-05-02 腾讯科技(深圳)有限公司 Data processing method and device and related equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100081507A1 (en) * 2008-10-01 2010-04-01 Microsoft Corporation Adaptation for Alternate Gaming Input Devices
CN104215439A (en) * 2013-06-04 2014-12-17 名硕电脑(苏州)有限公司 Correction method of center of rocker
CN109432767A (en) * 2018-11-15 2019-03-08 深圳市七熊科技有限公司 A kind of exchange method and system of game paddle and terminal
CN110368676A (en) * 2019-07-16 2019-10-25 Oppo广东移动通信有限公司 Control method, device, storage medium and the electronic equipment of touch information

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100081507A1 (en) * 2008-10-01 2010-04-01 Microsoft Corporation Adaptation for Alternate Gaming Input Devices
CN104215439A (en) * 2013-06-04 2014-12-17 名硕电脑(苏州)有限公司 Correction method of center of rocker
CN109432767A (en) * 2018-11-15 2019-03-08 深圳市七熊科技有限公司 A kind of exchange method and system of game paddle and terminal
CN110368676A (en) * 2019-07-16 2019-10-25 Oppo广东移动通信有限公司 Control method, device, storage medium and the electronic equipment of touch information

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116036578A (en) * 2023-01-28 2023-05-02 腾讯科技(深圳)有限公司 Data processing method and device and related equipment

Similar Documents

Publication Publication Date Title
CN110368676B (en) Touch information control method and device, storage medium and electronic equipment
CN109062468B (en) Split screen display method and device, storage medium and electronic equipment
CN108958606B (en) Split screen display method and device, storage medium and electronic equipment
CN107172671B (en) Channel switching method, device, storage medium and terminal
CN106817753B (en) Method and device for saving electricity by switching background gray scales and mobile terminal
CN109714476B (en) Data processing method and device, mobile terminal and storage medium
EP3591947A1 (en) Broadcast receiver queue adjustment method, apparatus, storage medium, and electronic device
CN110221765B (en) Video file playing method and device, storage medium and terminal
CN111078108A (en) Screen display method and device, storage medium and mobile terminal
CN107193551B (en) Method and device for generating image frame
CN110851014B (en) Touch recognition method and device, storage medium and terminal equipment
CN112791392A (en) Touch data processing method and device, storage medium and electronic equipment
CN111596793B (en) Anti-misoperation method and system, storage medium and terminal equipment
CN113332726A (en) Virtual character processing method and device, electronic equipment and storage medium
CN112764564B (en) Touch information processing method and device, storage medium and electronic equipment
US11914813B2 (en) Ranging method and apparatus thereof, storage medium, and terminal device
CN110996003B (en) Photographing positioning method and device and mobile terminal
CN111144845B (en) Mobile terminal meeting reminding method and device
CN112867171A (en) WIFI connection method and device, storage medium and mobile terminal
CN112380520A (en) Screen unlocking method and device, storage medium and mobile terminal
CN112199050A (en) Storage method, device, storage medium and terminal equipment
CN110990606B (en) Picture storage method and device, storage medium and electronic equipment
CN109656438B (en) Desktop wallpaper preview method and device, mobile terminal and storage medium
CN112468725B (en) Photo shooting method and device, storage medium and mobile terminal
CN110971760B (en) Network communication content output control method and device, storage medium and terminal equipment

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210514

RJ01 Rejection of invention patent application after publication