WO2021092768A1 - 触摸事件的处理方法、装置、移动终端及存储介质 - Google Patents

触摸事件的处理方法、装置、移动终端及存储介质 Download PDF

Info

Publication number
WO2021092768A1
WO2021092768A1 PCT/CN2019/117605 CN2019117605W WO2021092768A1 WO 2021092768 A1 WO2021092768 A1 WO 2021092768A1 CN 2019117605 W CN2019117605 W CN 2019117605W WO 2021092768 A1 WO2021092768 A1 WO 2021092768A1
Authority
WO
WIPO (PCT)
Prior art keywords
touch
mobile terminal
reporting
threshold
touch event
Prior art date
Application number
PCT/CN2019/117605
Other languages
English (en)
French (fr)
Inventor
林进全
Original Assignee
深圳市欢太科技有限公司
Oppo广东移动通信有限公司
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 深圳市欢太科技有限公司, Oppo广东移动通信有限公司 filed Critical 深圳市欢太科技有限公司
Priority to CN201980100129.0A priority Critical patent/CN114341784A/zh
Priority to PCT/CN2019/117605 priority patent/WO2021092768A1/zh
Publication of WO2021092768A1 publication Critical patent/WO2021092768A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/041Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/725Cordless telephones

Definitions

  • This application relates to the technical field of mobile terminals, and more specifically, to a method, device, mobile terminal, and storage medium for processing touch events.
  • Mobile terminals such as tablet computers and mobile phones, have become one of the most commonly used consumer electronic products in people's daily lives.
  • touch technology is applied to mobile terminals. More and more mobile terminals are equipped with touch screens. The application of touch technology simplifies user operations and brings users A better user experience.
  • this application proposes a touch event processing method, device, mobile terminal, and storage medium.
  • the embodiments of the present application provide a method for processing touch events, which is applied to a mobile terminal, the mobile terminal includes a touch screen, and the method includes: detecting the current usage scenario of the mobile terminal; The reporting threshold corresponding to the usage scenario; when a touch event is detected, the touch event information including the initial touch coordinate is reported; when the touch event is continuously detected, if the difference between the current touch coordinate and the initial touch coordinate is If the value is greater than the reporting threshold, the touch event information including the current touch coordinates is reported.
  • an embodiment of the present application provides a touch event processing device, which is applied to a mobile terminal.
  • the mobile terminal includes a touch screen.
  • the device includes a scene detection module, a threshold determination module, a first reporting module, and a second A reporting module, wherein the scene detection module is used to detect the current usage scene of the mobile terminal; the threshold determination module is used to determine a reporting threshold corresponding to the usage scene; the first reporting module is used to When a touch event is detected, the touch event information including the initial touch coordinates is reported; the second reporting module is used to continuously detect the touch event, if the difference between the current touch coordinates and the initial touch coordinates If the value is greater than the reporting threshold, the touch event information including the current touch coordinates is reported.
  • an embodiment of the present application provides a mobile terminal, including: one or more processors; a memory; one or more application programs, wherein the one or more application programs are stored in the memory and It is configured to be executed by the one or more processors, and the one or more programs are configured to execute the touch event processing method provided in the first aspect described above.
  • an embodiment of the present application provides a computer-readable storage medium, and the computer-readable storage medium stores program code, and the program code can be invoked by a processor to execute the touch provided in the first aspect.
  • the processing method of the event is not limited to:
  • the solution provided by this application determines the reporting threshold corresponding to the usage scenario by detecting the usage scenario currently spoken by the mobile terminal. After the reporting threshold is determined, when a touch event is detected, the touch event information including the initial touch coordinates is reported, When a touch event is continuously detected, if the difference between the current touch coordinate and the initial touch coordinate is greater than the reporting threshold, the touch event information including the current touch coordinate is reported, so that the mobile terminal can report the threshold according to the usage scenario.
  • the reporting of touch event information is controlled to avoid false triggering of sliding events, and it can also quickly respond to sliding events in demand scenarios.
  • Fig. 1 shows a flowchart of a method for processing a touch event according to an embodiment of the present application.
  • Fig. 2 shows a flowchart of a method for processing a touch event according to another embodiment of the present application.
  • FIG. 3 shows a flowchart of step S220 in the method for processing a touch event provided by another embodiment of the present application.
  • FIG. 4 shows another flowchart of step S220 in the method for processing a touch event provided by another embodiment of the present application.
  • Fig. 5 shows a flowchart of a method for processing a touch event according to another embodiment of the present application.
  • Fig. 6 shows a flowchart of a method for processing a touch event according to still another embodiment of the present application.
  • Fig. 7 shows a flowchart of a method for processing a touch event according to yet another embodiment of the present application.
  • Fig. 8 shows a block diagram of a touch event processing device according to an embodiment of the present application.
  • Fig. 9 is a block diagram of a mobile terminal for executing the method for processing a touch event according to an embodiment of the present application.
  • Fig. 10 is a storage unit for storing or carrying program codes for implementing the touch event processing method according to the embodiment of the present application.
  • the display screen usually plays a role in mobile terminals such as mobile phones and tablet computers to display content such as text, pictures, icons, or videos.
  • touch technology is widely used in the field of human-computer interaction.
  • more and more mobile terminals are equipped with touch screens.
  • touch screen When the touch screen is set, when it is detected that the user is dragging on the touch screen, It can respond to the user's touch operation during touch operations such as single click, double tap, and sliding.
  • touch technology simplifies user operations and brings a better user experience to users.
  • the click event during the shaking will cause a sliding event, which is caused by the coordinate shaking caused by the touch screen system according to the user's click operation of.
  • the original user's click operation is caused by jitter, which triggers a sliding event and causes an error response of the interface.
  • the traditional technical solution adopts a unified anti-jitter preset threshold.
  • the preset threshold is used to control the reporting of touch event information when the touch event is generated.
  • the touch event information can be Including press events, lifting events, screen coordinates, pressure event information of hand pressing, approximate event information of the diameter of the finger contacting the touch screen, and approximate event information of the diameter of the finger.
  • the touch screen system compares the difference between the touch coordinates of each frame during the occurrence of the touch event and the initial touch coordinates of the touch event with the preset threshold, and when the difference is greater than the preset threshold
  • the touch event information is reported, so as to avoid the click operation when shaking, the data of each frame of touch coordinates are reported in real time, and the sliding event is triggered by mistake.
  • the preset threshold of anti-jitter set in the mobile terminal is usually a fixed value, and a unified preset threshold of anti-jitter is used globally, that is, the same preset threshold is used in all usage scenarios.
  • Preset threshold In some scenes (such as game scenes, etc.), sliding events need to be triggered quickly. If the threshold is large, it is easy to be recognized as a click event and cannot respond quickly to sliding; and in some scenes (such as chat scenes, etc.), Usually it is a click operation. If the threshold is small, the click operation is likely to trigger a sliding event, causing an error response of the interface.
  • the inventor proposes the touch event processing method, device, mobile terminal, and storage medium provided by the embodiments of the present application.
  • the touch event is touched in the usage scenario.
  • the reporting of touch event information is controlled to avoid false triggering of sliding events, and it can also quickly respond to sliding events in demand scenarios.
  • the specific touch event processing method will be described in detail in the subsequent embodiments.
  • FIG. 1 shows a schematic flowchart of a touch event processing method provided by an embodiment of the present application.
  • the touch event processing method is used to dynamically update the reporting threshold corresponding to the scene, and in the touch event information reporting process when the touch event occurs, the touch event information is reported according to the reporting threshold to avoid false triggering of the sliding event, and It can also quickly respond to sliding events in demand scenarios.
  • the touch event processing method is applied to the touch event processing device 400 as shown in FIG. 8 and the mobile terminal 100 configured with the touch event processing device 400 (FIG. 9 ). The following will take a mobile terminal as an example to describe the specific process of this embodiment.
  • the mobile terminal applied in this embodiment may be a smart phone, a tablet computer, an e-book, etc., which is not limited here.
  • the mobile terminal includes a touch screen.
  • the process shown in FIG. 1 will be described in detail below, and the method for processing the touch event may specifically include the following steps:
  • Step S110 Detect the current usage scenario of the mobile terminal.
  • the mobile terminal can detect the usage scenario in which the mobile terminal is in use during the process of being used.
  • different usage scenarios correspond to the requirements for sliding operation response and click operation response requirements. Therefore, the reporting threshold for reporting touch event information can be determined according to the usage scenario in the future, so that the reporting threshold corresponds to the usage scenario and avoiding sliding Event is triggered by mistake, and can quickly respond to sliding operations in demand scenarios.
  • the usage scenario of the mobile terminal may be based on one or more of the frequency of click operations, the number of click operations, the frequency of sliding operations, and the number of times of sliding operations in different scenarios. Divide. For example, the usage scenario can be divided according to the frequency of the click operation and the frequency of the sliding operation. The requirements for the sliding operation and the demand for the click operation are determined by the size of the two frequencies, and according to the requirements for the sliding operation and the Click the requirements of the operation to divide the usage scenarios.
  • the weight of the demand for the sliding operation and the weight of the demand for the click operation can be allocated, and then the usage scenarios can be divided according to the demand for the sliding operation and the demand for the click operation at the same time.
  • the frequency of sliding operations accounts for the first ratio of the frequency of all touch operations.
  • the first ratio is used to characterize the demand for sliding operations.
  • the frequency of click operations accounts for the second of all touch operations. Ratio, the second ratio is used to characterize the demand for click operations, and then the first product and the second product are calculated as the first product of the first ratio and its corresponding weight, and the second product of the second ratio and its corresponding weight.
  • the sum, different sum values correspond to different usage scenarios.
  • the use scenarios can be divided into use scenarios that require the response speed of the sliding operation and use scenarios that have no demand.
  • the above are only examples.
  • the mobile terminal can identify the device status such as currently running applications, screen usage status, network status, etc., and determine the current usage scenario of the mobile terminal. It is understandable that the mobile terminal can determine the device status in different usage scenarios according to the above divided usage scenarios, and associate the device status with the usage scenario, so that the mobile terminal can determine the usage scenario of the mobile terminal according to the identified device status .
  • the specific manner of detecting the usage scenario in which the mobile terminal is located may not be limited.
  • Step S120 Determine a reporting threshold corresponding to the usage scenario.
  • the mobile terminal after the mobile terminal determines the usage scenario, it can determine the reporting threshold corresponding to the usage scenario.
  • the reporting threshold can be understood as the aforementioned preset threshold for anti-jitter. That is, the touch screen system at the bottom of the operating system of the mobile terminal compares the difference between each frame of touch coordinates and the initial touch coordinates of the touch event during the occurrence of the touch event with the reporting threshold, and the difference is greater than the reporting threshold.
  • the touch event information is reported only when the threshold is reached, so as to avoid the click operation when shaking, the data of each frame of touch coordinates are reported in real time, and the sliding event is triggered by mistake.
  • the specific value of the reporting threshold may not be a limitation, for example, it may be 2, it may be 5, and so on.
  • the Android system framework includes the kernel layer, the core class library layer, the framework layer and the application layer from bottom to top.
  • the kernel layer provides core system services, including security, memory management, process management, network protocol stacks, and hardware drivers.
  • the hardware driver in the kernel layer is recorded as the driver layer, and the driver layer includes touch display driver, camera driver, etc.
  • the core class library layer includes Android Runtime and Libraries. Among them, the Android runtime environment provides most of the functions available in the core class library of the Java programming language, including the core library (CoreLibraries) and the Dalvik virtual machine (Dalvik VM).
  • Each Android application is an instance in the Dalvik virtual machine, running in its own process.
  • the class library is used by the various components of the Android system, including the following functions: Media Framework, Surface Manager, SQLite (Relational Database Engine), Free Type (Bitmap and Vector Font Rendering), etc., and its various functions It is exposed to developers through the framework layer of the Android system.
  • the framework layer provides a series of class libraries needed to develop Android applications, so that developers can carry out rapid application development, facilitate the reuse of components, and can also achieve personalized extensions through inheritance.
  • the services provided include component management services and windows. Management services, system data source components, spatial framework, resource management services and installation package management services, etc.
  • the application layer includes all kinds of applications that directly interact with users, or service programs written in Java that run in the background, including desktop applications, contact applications, call applications, camera applications, image browsers, games, maps, and web Programs such as browsers, and other applications developed by developers.
  • the bottom layer of the operating system may include a touch screen system in the kernel layer, and the touch screen system may monitor touch events on the touch screen. For example, when a press event is detected, it is determined that a touch event to the touch screen is detected. When the touch screen system detects a touch event, it can report the touch event information to the application layer so that the application layer can recognize the touch event and perform related processing and control.
  • different usage scenarios may correspond to different reporting thresholds. If the usage scenario is divided according to the response demand of the click operation and the response demand of the sliding operation at the same time, the reporting threshold can take into account the response demand of the click operation and the sliding operation at the same time. If the usage scenarios are divided according to the response requirements of the sliding operation, the reporting threshold can take into account the usage scenarios with higher response requirements of the sliding operation and the general usage scenarios. The ordinary usage scenarios are those other than the usage scenarios with higher response requirements of the sliding operation. Other scenes.
  • the default reporting threshold (the initial reporting threshold set by the system) can be used as the reference threshold, and the frequency of the sliding operation under different usage scenarios can be calculated in advance.
  • the frequency of these touch operations can be calculated in advance according to different usage scenarios.
  • the reporting threshold needs to be small, and to prevent a click operation from being mistakenly recognized as a sliding operation, the reporting threshold needs to be large.
  • the difference between the first ratio and the second ratio can be calculated, and the sum of the difference added by 1 is multiplied by the initial reporting threshold to obtain the reporting threshold corresponding to the usage scenario.
  • the specific method of calculating the reporting threshold may not be limited. It is understandable that after calculating the reporting thresholds corresponding to different usage scenarios, the corresponding relationship between the usage scenarios and the reporting threshold can be established and stored in the mobile terminal, so that the mobile terminal can directly determine the corresponding relationship in the actual application process.
  • Step S130 When a touch event is detected, report the touch event information including the initial touch coordinates.
  • the mobile terminal can control the reporting of touch event information in the process of reporting touch event information when a touch event occurs according to the reporting threshold.
  • the touch screen system can obtain the initial touch coordinates corresponding to the initial point of the touch, record the initial touch coordinates, and report the touch event information including the initial touch coordinates.
  • the type of the event is a press event, so the reported touch event information can also include press events.
  • Step S140 When the touch event is continuously detected, if the difference between the current touch coordinate and the initial touch coordinate is greater than the reporting threshold, report the touch event information including the current touch coordinate.
  • the touch screen system can continue to monitor touch events, that is, continuously scan touch signals.
  • touch event When a touch event is continuously detected, it can control the reporting of each detected touch coordinate according to the reporting threshold.
  • the touch screen system continuously detects a touch event, it compares the difference between the current touch coordinate and the initial touch coordinate of the touch event with the reporting threshold, and performs the touch event only when the difference is greater than the reporting threshold Information reporting, so as to avoid the click operation when shaking, the data of each frame of touch coordinates are reported in real time, and the sliding event is triggered by mistake.
  • the current touch coordinates are (120,101)
  • the initial touch coordinates are (120,105)
  • the difference between the current touch coordinates and the initial touch coordinates is 4, and if the reported threshold is 3, the current touch coordinates and the initial touch
  • the difference between the coordinates is greater than the reporting threshold.
  • the reporting threshold corresponding to the use scenario is used. At this time, the reporting threshold is small, so it will not delay the identification of the sliding event, so as to quickly respond to the sliding operation. .
  • the mobile terminal can detect the usage scene in which it is in when it recognizes the usage scene change, so that a new reporting threshold can be determined according to the usage scene, and the reporting threshold can be updated.
  • the touch event processing method determines the reporting threshold corresponding to the usage scenario by detecting the usage scenario currently spoken by the mobile terminal. After the reporting threshold is determined, when a touch event is detected, the report includes the initial touch The touch event information of the coordinate. When the touch event is continuously detected, if the difference between the current touch coordinate and the initial touch coordinate is greater than the reporting threshold, the touch event information including the current touch coordinate is reported, so as to realize the mobile terminal according to the usage scenario
  • the corresponding reporting threshold controls the reporting of touch event information in the process of reporting touch event information when a touch event occurs, avoiding false triggering of sliding events, and quickly responding to sliding events in demand scenarios. And realize that the reporting threshold is updated for different usage scenarios to meet the requirements for touch operations in different usage scenarios.
  • FIG. 2 shows a schematic flowchart of a touch event processing method provided by another embodiment of the present application.
  • the touch event processing method can be applied to the above-mentioned mobile terminal.
  • the process shown in FIG. 2 will be described in detail below, and the method for processing the touch event may specifically include the following steps:
  • Step S210 Acquire currently running applications in the mobile terminal.
  • the mobile terminal can determine the usage scenario in which the mobile terminal is located according to the currently running application.
  • the mobile terminal can obtain the currently running application in order to determine the usage scenario.
  • the mobile terminal can obtain the currently running application through the process management of the operating system, and can obtain the status and information of the running application, such as the application running in the foreground or the background, the processor resources occupied by the application running, and the current application The called hardware module, etc.
  • the manner of obtaining the currently running application in the mobile terminal may not be a limitation.
  • Step S220 Determine the current usage scenario of the mobile terminal according to the currently running application.
  • the mobile terminal after the mobile terminal obtains the currently running application, it can determine the current usage scenario of the mobile terminal according to the currently running application.
  • the usage scenario may include a first usage scenario and a second usage scenario, and the priority of the sliding operation in the first usage scenario is higher than the priority of the sliding operation in the second usage scenario.
  • the priority of the sliding operation can be divided into the first priority and the second priority.
  • the priority of the sliding operation is the first priority.
  • the priority of the sliding operation is the second priority, and the first priority is higher than the second priority. It is understandable that the use scenarios that require quick response to the sliding operation are considered, and the use scenarios are divided.
  • the first use scenario is the use scenario that requires quick response to the sliding operation
  • the second use scenario is other use scenarios.
  • step S220 may include:
  • Step S221A Determine the application running in the foreground among the currently running applications.
  • the mobile terminal can determine that the application is running in the foreground or running in the background based on the running state of the currently running application.
  • Step S222A Determine whether the application running in the foreground is in the preset list.
  • the mobile terminal stores a preset list, and the preset list stores multiple applications of the first usage scenario, that is, when these applications require quick response to the sliding operation. If any of these applications is running in the foreground, the mobile terminal is in the first usage scenario. Therefore, it can be judged whether the application running in the foreground is in the preset list, and the usage scenario of the mobile terminal can be determined according to the judgment result. It is understandable that if the currently running application is in the preset list, the mobile terminal is in the first usage scenario, and if the currently running application is not in the preset list, the mobile terminal is in the second usage scenario.
  • Step S223A If it is in the preset list, it is determined that the mobile terminal is in the first usage scenario.
  • Step S224A If it is not in the preset list, it is determined that the mobile terminal is in the second usage scenario.
  • step S220 may include:
  • Step S221B Determine the application running in the foreground among the currently running applications.
  • Step S222B Determine whether the type of the application running in the foreground is a set type.
  • Step S223B If it is the set type, it is determined that the mobile terminal is in the first usage scenario.
  • Step S224B If it is not the set type, it is determined that the mobile terminal is in the second usage scenario.
  • the mobile terminal can also judge whether the type of the application running in the foreground is based on the type of the application running in the foreground. To set the type, and then determine the usage scenario of the mobile terminal according to the judgment result. Specifically, if the type of the application running in the foreground is the set type, it is determined that the mobile terminal is in the first usage scenario; if the type of the application running in the foreground is not the set type, it is determined that the mobile terminal is in the second usage scenario. By determining whether the type of the application is a set type, the usage scenario of the mobile terminal can be quickly and conveniently determined. Among them, the mobile terminal can determine the type of the application according to the identifier of the application currently running in the foreground, the running interface, the called hardware module, etc., which is not limited here.
  • the mobile terminal may select one of the above two implementation manners to determine the usage scenario of the mobile terminal according to a preset strategy or a manner selected by the user.
  • Step S230 If the usage scenario is the first usage scenario, determine that the reporting threshold is the first threshold.
  • Step S240 If the usage scenario is the second usage scenario, determine that the reporting threshold is a second threshold, where the first threshold is smaller than the second threshold.
  • the reporting threshold corresponding to the first usage scenario can be set to be smaller than the reporting threshold corresponding to the second usage scenario, that is, the first threshold is less than the second threshold to quickly respond to the first usage scenario. Sliding operation.
  • the second usage scenario since the second usage scenario includes other usage scenarios than the first usage scenario that requires quick response to the sliding operation, the second usage scenario can be understood as a normal usage scenario, and the second threshold can be set as a system setting. If the initial reporting threshold is set, the first threshold is smaller than the initial reporting threshold.
  • the specific first threshold may not be a limitation. For example, when the initial reporting threshold is 3, the first threshold may be 2.
  • Step S250 When a touch event is detected, report the touch event information including the initial touch coordinates.
  • step S250 can refer to the content of the foregoing embodiment, which will not be repeated here.
  • Step S260 When the touch event is continuously detected, if the difference between the current touch coordinate and the initial touch coordinate is greater than the reporting threshold, report the touch event information including the current touch coordinate.
  • the touch screen system when the touch screen system continuously detects a touch event, it compares the difference between the current touch coordinate and the initial touch coordinate of the touch event with the first threshold or the second threshold determined above, and The touch event information is reported only when the difference is greater than the first threshold or the second threshold, so as to avoid the click operation when shaking, the data of each frame of touch coordinates are reported in real time, and the sliding event is triggered by mistake.
  • the first threshold since the first threshold is relatively small, it also enables rapid response to sliding events in the demand scenario and meets the user's use needs.
  • the second threshold since the second threshold is relatively large, it is possible to better avoid false triggering of a sliding event during a click operation during jitter.
  • the use scene is the second use scene
  • reporting touch event information including the current touch coordinates may include: When the difference between the initial touch coordinates is greater than the reporting threshold, and the use scene is the second use scene, the difference between the current touch coordinate and the previous touch coordinate is acquired as the target difference; If the target difference value is greater than a specified threshold, the touch event information including the current touch coordinates is reported.
  • the use scene when it is determined that the difference between the current touch coordinate and the initial touch coordinate is greater than the reporting threshold, it can also be determined between the current touch coordinate and the previous touch coordinate Whether the difference between is greater than a specified threshold, where the previous touch coordinate may refer to the touch coordinate acquired once before the current touch coordinate is acquired.
  • the target difference between the current touch coordinate and the previous touch coordinate is greater than the specified threshold
  • the touch event information including the current touch coordinate is reported, and the target difference is less than or equal to the specified threshold
  • the threshold is set, the touch event information including the current touch coordinates is not reported.
  • the specific size of the specified threshold value may not be a limitation, and it may be a value smaller than the target threshold value.
  • reporting touch event information including the current touch coordinates may include: When the difference between the initial touch coordinates is greater than the reporting threshold, and the use scene is the second use scene, obtain the difference between the detection time corresponding to the current touch coordinate and the detection time corresponding to the previous touch coordinate Time interval; if the time interval is less than the specified interval, report touch event information including the current touch coordinates.
  • the detection time and detection time when the current touch coordinates are detected can also be determined. Whether the time interval between the detection time of the previous touch coordinate is greater than the specified interval, where the previous touch coordinate may refer to the touch coordinate acquired once before the current touch coordinate is acquired. By comparing whether the time interval between two detection moments is greater than the specified interval, when the time interval is greater than the specified interval, the touch event information including the current touch coordinates will be reported, and when the time interval is less than or equal to the specified interval, the current touch event information will not be reported. The touch event information of the touch coordinates.
  • each touch coordinate is reported to cause the click operation and falsely trigger the sliding event.
  • the specific size of the designated time interval may not be a limitation, for example, it may be an interval for the touch screen to scan touch signals.
  • the touch event processing method determines the application currently running on the mobile terminal and determines the usage scenario of the mobile terminal according to the currently running application, which can quickly and conveniently determine the usage scenario of the mobile terminal.
  • Determine the first threshold or the second threshold corresponding to the usage scenario and control the reporting of touch event information when the touch event occurs according to the first threshold or the second threshold corresponding to the usage scenario, so as to realize the mobile terminal according to the corresponding usage scenario
  • the reporting threshold in the process of reporting touch event information when a touch event occurs, controls the reporting of touch event information to avoid false triggering of sliding events, and can also quickly respond to sliding events in demand scenarios. And realize that the reporting threshold is updated for different usage scenarios to meet the requirements for touch operations in different usage scenarios.
  • FIG. 5 shows a schematic flowchart of a touch event processing method provided by another embodiment of the present application.
  • the touch event processing method can be applied to the above-mentioned mobile terminal.
  • the following will elaborate on the process shown in FIG. 5, and the method for processing the touch event may specifically include the following steps:
  • Step S310 Obtain the current screen display state of the mobile terminal.
  • the mobile terminal can determine the usage scenario in which the mobile terminal is located according to the current screen display state.
  • the screen display state may include a horizontal screen state and a vertical screen state.
  • the mobile terminal may include an acceleration sensor.
  • the mobile terminal can detect the screen display status based on the data detected by the acceleration sensor.
  • the data detected by the acceleration sensor may include X-axis, Y-axis, and Z-axis data.
  • the Z-axis data In the vertical screen, the Z-axis data is small, and the X-axis data is close to the acceleration of gravity, while in the horizontal screen, the Z-axis data is small.
  • the axis data is close to the acceleration of gravity. Therefore, it can be determined whether the X-axis data or the Y-axis data is close to the acceleration of gravity and whether the Z-axis data is less than the set acceleration.
  • the specific method of determining the screen display status is not limited
  • Step S320 Determine the current usage scenario of the mobile terminal according to the screen display state.
  • most of the scenes in the horizontal screen state are game scenes that need to quickly respond to sliding operations, while in the vertical screen state, most of them are click events, and there is no need to quickly respond to the sliding operations. Therefore, if the screen display state is the horizontal screen state, it is determined that the mobile terminal is in the first usage scenario; if the screen display state is the vertical screen state, it is determined that the mobile terminal is in the second usage scenario.
  • the first use scene may be a game scene
  • the second use scene may be a scene other than the game scene.
  • the usage scenario of the mobile terminal can also be quickly and conveniently detected.
  • Step S330 If the usage scenario is the first usage scenario, determine that the reporting threshold is the first threshold.
  • Step S340 If the usage scenario is the second usage scenario, determine that the reporting threshold is a second threshold, where the first threshold is smaller than the second threshold.
  • steps S330 and S340 can refer to the content of the previous embodiment, which will not be repeated here.
  • Step S350 When a touch event is detected, report the touch event information including the initial touch coordinates.
  • Step S360 When the touch event is continuously detected, if the difference between the current touch coordinate and the initial touch coordinate is greater than the reporting threshold, report the touch event information including the current touch coordinate.
  • step S350 and step S360 can refer to the content of the foregoing embodiment, which will not be repeated here.
  • the touch event processing method determines the screen display state of the mobile terminal, and determines whether the mobile terminal is in a horizontal screen state or a vertical screen state according to the screen display state.
  • One use scene or second use scene and then determine the first threshold corresponding to the first use scene or the second threshold corresponding to the second use scene, and control the touch event information when the touch event occurs according to the first threshold or the second threshold
  • the mobile terminal controls the reporting of touch event information during the process of reporting touch event information when a touch event occurs, avoiding false triggering of sliding events, and can quickly respond to demand scenarios Sliding event under. And realize that the reporting threshold is updated for different usage scenarios to meet the requirements for touch operations in different usage scenarios.
  • FIG. 6 shows a schematic flowchart of a touch event processing method provided by still another embodiment of the present application.
  • the touch event processing method can be applied to the above-mentioned mobile terminal.
  • the process shown in FIG. 6 will be described in detail below.
  • the method for processing the touch event may specifically include the following steps:
  • Step S410 Detect the current usage scenario of the mobile terminal.
  • Step S420 Determine a reporting threshold corresponding to the usage scenario, and the reporting threshold is used by the mobile terminal in the process of reporting touch event information when the touch event is detected on the touch screen, according to the current touch coordinates and the initial touch The distance between the coordinates and the reporting threshold control the reporting of touch event information.
  • step S410 and step S420 can refer to the content of the foregoing embodiment, and will not be repeated here.
  • Step S430 When a touch event to the touch screen is detected, obtain the initial touch coordinates corresponding to the touch event.
  • the navigation gesture function is to realize the functions of returning to the desktop, returning to the previous level, and viewing recent tasks through the navigation gestures on the system interface or the application interface using physical keys or virtual keys. For example, the user can return to the desktop by sliding up the bottom area of the touch screen.
  • the specific navigation gestures are not limited.
  • the navigation gestures taking into account the navigation gesture function usually slide from the edge to the inner area, and when the user clicks on the edge area, if there is a jitter, it is easy to cause the sliding event to be triggered by mistake, thereby causing the navigation gesture False triggering of functions. Therefore, it is possible to determine the initial touch coordinates when the touch event is generated, determine whether the initial touch coordinates are within the coordinate area of the navigation gesture, and increase the reporting threshold when the initial touch coordinates are within the coordinate area of the navigation gesture to avoid When the coordinate area of the navigation gesture is clicked while shaking, the data of each frame of the touch coordinate is reported in real time, and the sliding event is triggered by mistake, and then the navigation gesture is triggered.
  • Step S440 When the touch coordinates are in the preset coordinate range, increase the reporting threshold to a set threshold.
  • all touch coordinates corresponding to navigation gestures that may trigger the navigation gesture function can be determined, and a preset coordinate range can be constructed for all touch coordinates.
  • the preset coordinate range can be set as 0 ⁇ X ⁇ 100 and 980 ⁇ Y ⁇ 1080, and 0 ⁇ X ⁇ 100 and 2340 ⁇ Y ⁇ 2440.
  • the specific preset coordinate range may not be limited.
  • the mobile terminal can determine whether the initial touch coordinates when the touch event is generated are within the preset coordinate range. If the initial touch coordinates are within the preset coordinate range, it means that the touch event may trigger navigation by mistake. Gesture, and if the initial touch coordinate is not within the preset coordinate range, the navigation gesture will not be triggered by mistake. Therefore, when the initial touch coordinates are in the preset coordinate range, the reporting threshold can be increased to the set threshold, and then the touch event information reporting can be controlled according to the set threshold to avoid jittering when the coordinate area of the navigation gesture is clicked. Each frame of touch coordinate data is reported in real time, and the sliding event is triggered by mistake, which then triggers the navigation gesture.
  • the operating system may issue an instruction to the touch screen system, so that the touch screen system increases the reporting threshold to the set threshold according to the instruction.
  • the reporting threshold of the touch screen system can also be set in this manner.
  • Step S450 When a touch event is detected, report the touch event information including the initial touch coordinates.
  • Step S460 When the touch event is continuously detected, if the difference between the current touch coordinate and the initial touch coordinate is greater than the set threshold, report touch event information including the current touch coordinate.
  • step S450 and step S460 can refer to the content of the foregoing embodiment, and will not be repeated here.
  • the touch event processing method determines the reporting threshold corresponding to the usage scenario by detecting the usage scenario in which the mobile terminal is located, and controls the reporting process of touch event information when the touch event occurs according to the reporting threshold ,
  • the preset coordinate range is the touch coordinate range of the navigation gesture, if the initial touch coordinate is in the preset coordinate range, increase the reporting threshold to set
  • the threshold is set to avoid that when a click operation is performed in the coordinate area of the navigation gesture, if a jitter occurs, it is easy to cause a false triggering of a sliding event, and then trigger the navigation gesture.
  • FIG. 7 shows a schematic flowchart of a touch event processing method provided by yet another embodiment of the present application.
  • the touch event processing method can be applied to the above-mentioned mobile terminal.
  • the process shown in FIG. 7 will be described in detail below, and the method for processing the touch event may specifically include the following steps:
  • Step S510 Detect the current usage scenario of the mobile terminal.
  • Step S520 Determine a reporting threshold corresponding to the usage scenario, where the reporting threshold is used by the mobile terminal in the process of reporting touch event information when the touch event is detected on the touch screen, according to the current touch coordinates and the initial touch The distance between the coordinates and the reporting threshold control the reporting of touch event information.
  • Step S530 When a touch event is detected, the initial touch coordinates corresponding to the pressing event in the touch event are acquired, and touch event information including the pressing event and the initial touch coordinates are reported.
  • the mobile terminal controls the reporting of touch event information when a touch event occurs according to the reporting threshold. This may be that when the touch screen system of the mobile terminal detects the touch event, it acquires the initial touch coordinates, where the initial touch coordinates Is the corresponding touch coordinate when the first press event occurs. After acquiring the initial touch coordinates, the mobile terminal can report the touch event information including the press event and the initial touch coordinates, that is, report it to the application layer for processing.
  • the touch screen can periodically scan and collect the touch signal of the object, and obtain the capacitance difference value according to the touch signal, and calculate the touch coordinates and events.
  • events include pressing events and lifting events.
  • the scanning frequency of the touch screen can be greater than the frequency of reporting data reported by the touch screen system, for example, the scanning frequency is 400KHz, and the frequency of reporting data can be 100-200 Hz.
  • the mobile terminal may also record the initial touch coordinates, so that when the subsequent touch event information is reported in this touch event, it is based on the current touch coordinates and the initial touch coordinates. And the reporting threshold to determine whether to report the touch event information.
  • Step S540 When the touch event is continuously detected, in the process of reporting the touch event information, the current touch coordinates corresponding to the touch event are continuously acquired.
  • the touch screen system can continuously obtain the current touch coordinates corresponding to the touch event during the touch event information reporting process of the touch event to determine whether to report the current touch coordinates and other event information.
  • the current touch coordinates corresponding to the touch event may be acquired according to a first preset frequency.
  • the first preset frequency may be the report point frequency of the data reported by the touch screen system described above, and the specific first preset frequency may not be a limitation.
  • Step S550 Determine whether the difference between the current touch coordinate and the initial touch coordinate is greater than the reporting threshold.
  • the touch screen system at the bottom of the operating system of the mobile terminal can determine whether the difference between the current touch coordinates and the initial touch coordinates is greater than the reporting threshold each time after obtaining the current touch coordinates.
  • the difference can be understood as the distance between two coordinate points. For example, if the current touch coordinates are (80,100) and the initial touch coordinates are (80,97), the difference between the current touch coordinates and the initial touch coordinates is 3, and if the reported threshold is 2, the current touch coordinates are The difference between the initial touch coordinates is greater than the reporting threshold.
  • Step S560 If the difference is greater than the reporting threshold, report touch event information including the press event and the current touch coordinates.
  • Step S570 If the difference is less than or equal to the reporting threshold, the touch event information is not reported.
  • the click operation during shaking is usually shaking around a coordinate point, so if the difference is greater than the reporting threshold, Only when the touch event information is reported, and when the difference is less than or equal to the reporting threshold, the touch event information is not reported, so as to avoid accidentally reporting each frame of touch data during a jittery click operation, which may cause false triggering of the sliding event .
  • the touch screen system when it detects a lift event in a touch event, it can report the lift event and the touch event information of the current touch coordinates, so that the application layer can determine the specific touch operation.
  • the method for processing the touch event may further include:
  • the difference may also be less than or equal to the reporting threshold. Therefore, the second preset frequency can be increased, and the number of times of acquiring the current touch coordinates can be reduced, thereby reducing the processing amount of the touch screen system.
  • the method for processing the touch event may further include: detecting the motion state of the mobile terminal; if the motion state meets a set state condition, increasing the reporting threshold.
  • the main function of the reporting threshold is to prevent the click operation from being misrecognized as a sliding operation in the case of jitter, so the motion state of the mobile terminal can be detected, and the reporting threshold is increased when the motion state meets the set state condition.
  • the set state condition can be used to characterize that the mobile terminal is in a state of severe shaking or shaking.
  • the motion state includes a shaking state
  • increasing the reporting threshold includes: determining a shaking amplitude corresponding to the shaking state; if the shaking state If the amplitude is greater than the set amplitude, increase the reporting threshold. It is understandable that when the shaking amplitude of the mobile terminal is greater than the set amplitude, it indicates that the current mobile terminal shaking is relatively severe, so the reporting threshold can be increased, which can better prevent the click operation during shaking from being mistakenly recognized as a sliding operation.
  • the mobile terminal further includes a gyro sensor
  • the monitoring of the motion state of the mobile terminal includes: acquiring angular velocity data detected by the gyro sensor; and determining the shaking state of the mobile terminal according to the angular velocity data .
  • the touch event processing method determines the reporting threshold corresponding to the usage scenario by detecting the usage scenario currently spoken by the mobile terminal, and the reporting threshold is used for touch event information when the mobile terminal detects a touch event on the touch screen In the reporting process, according to the distance between the current touch coordinate and the initial touch coordinate and the reporting threshold, the touch event information is controlled. After the reporting threshold is determined, the reporting threshold is used to control the touch event information when the touch event occurs. Reporting, so as to realize that the mobile terminal controls the reporting of touch event information during the process of reporting touch event information when a touch event occurs according to the reporting threshold corresponding to the usage scenario, avoiding false triggering of sliding events, and can quickly respond to demand scenarios The sliding event.
  • the reporting threshold is dynamically adjusted, and when the motion state of the mobile terminal meets the set state conditions, the reporting threshold is increased, which can better avoid the misrecognition of click operations during jitter. It is a sliding operation.
  • FIG. 8 shows a structural block diagram of a touch event processing apparatus 400 provided by an embodiment of the present application.
  • the device 400 for processing touch events can be applied to the above-mentioned mobile terminal, and the mobile terminal includes a touch screen.
  • the device 400 for processing the touch event includes a scene detection module 410, a threshold determination module 420, a first reporting module 430, and a second reporting module 440.
  • the scene detection module 410 is used to detect the current use scene of the mobile terminal; the threshold determination module 420 is used to determine a reporting threshold corresponding to the use scene; the first reporting module 430 is used to When a touch event is detected, the touch event information including the initial touch coordinates is reported; the second reporting module 440 is used to continuously detect the touch event, if the difference between the current touch coordinates and the initial touch coordinates is greater than The reporting threshold is to report touch event information including the current touch coordinates.
  • the usage scenario includes a first usage scenario and a second usage scenario, and the priority of the sliding operation in the first usage scenario is higher than the priority of the sliding operation in the second usage scenario.
  • the threshold determination module 420 may be specifically configured to: if the usage scenario is the first usage scenario, determine that the reporting threshold is the first threshold; if the usage scenario is the second usage scenario, determine that the reporting threshold is the second threshold , Wherein the first threshold is less than the second threshold.
  • the second reporting module 440 may be specifically configured to: if the difference between the current touch coordinates and the initial touch coordinates is greater than the reporting threshold, and the usage scenario is the second usage scenario, Obtain the difference between the current touch coordinate and the previous touch coordinate as a target difference; if the target difference is greater than a specified threshold, report touch event information including the current touch coordinate.
  • the device 400 for processing a touch event may further include a first prohibition module.
  • the first prohibition module may be configured to, after acquiring the difference between the previous touch coordinate adjacent to the current touch coordinate as the target difference, if the target difference is less than or equal to the specified threshold, then The touch event information including the current touch coordinates is not reported.
  • the second reporting module 440 may be specifically configured to: if the difference between the current touch coordinates and the initial touch coordinates is greater than the reporting threshold, and the usage scenario is the second usage scenario, The time interval between the detection time corresponding to the current touch coordinate and the detection time corresponding to the previous touch coordinate is acquired; if the time interval is less than a specified interval, the touch event information including the current touch coordinate is reported.
  • the device 400 for processing a touch event may further include a second prohibition module.
  • the second prohibition module may be configured to obtain the time interval between the detection time corresponding to the current touch coordinate and the detection time corresponding to the previous touch coordinate, if the time interval is greater than or equal to the specified interval, then The touch event information including the current touch coordinates is not reported.
  • the scene detection module 420 may include an application acquisition unit and a scene determination unit.
  • the application acquiring unit is configured to acquire the currently running application in the mobile terminal;
  • the first scenario determining unit is configured to determine the current usage scenario of the mobile terminal according to the currently running application.
  • the first scene determining unit may be specifically configured to: determine the application running in the foreground among the currently running applications; determine whether the application running in the foreground is in the preset list; if it is in the preset list If it is not in the preset list, it is determined that the mobile terminal is in the second use scenario.
  • the first scene determining unit may be specifically configured to: determine an application running in the foreground among the currently running applications; determine whether the type of the application running in the foreground is a set type; if it is a set type , It is determined that the mobile terminal is in the first usage scenario; if it is not the set type, it is determined that the mobile terminal is in the second usage scenario.
  • the scene detection module may also include: a display state determination unit and a second scene determination unit.
  • the display state determination unit is used to obtain the current screen display state of the mobile terminal; the second scene determination unit is used to determine the current use scene of the mobile terminal according to the screen display state.
  • the second scene determining unit may be specifically configured to: if the screen display state is a horizontal screen state, determine that the mobile terminal is in the first use scene; if the screen display state is a vertical screen state, determine that all The mobile terminal is in a second usage scenario.
  • the event reporting module 430 may include a coordinate obtaining unit, a threshold increasing unit, and a reporting execution unit.
  • the coordinate acquisition unit is configured to acquire the initial touch coordinates corresponding to the touch event when a touch event to the touch screen is detected;
  • the threshold increasing unit is configured to report the touch coordinates when the touch coordinates are within a preset coordinate range
  • the threshold is increased to a set threshold;
  • the reporting execution unit is used to control the reporting of touch event information according to the set threshold.
  • the reporting execution unit may also be used to control the reporting of touch event information according to the reporting threshold when the touch coordinates are not in the preset coordinate range.
  • the device 400 for processing the touch event may further include a touch coordinate acquisition module, configured to report if the difference between the current touch coordinate and the initial touch coordinate is greater than the reporting threshold.
  • the current touch coordinates are acquired according to the first preset frequency.
  • the event reporting module 430 may also be used to increase the first preset frequency to a second preset frequency when it is detected that the difference value is less than or equal to the reporting threshold for multiple times in succession.
  • the device 400 for processing a touch event may further include a motion detection module and a threshold adjustment module.
  • the motion detection module is used to detect the motion state of the mobile terminal; the threshold adjustment module is used to increase the reporting threshold if the motion state meets a set state condition.
  • the motion state includes a shaking state.
  • the threshold adjustment module may be specifically configured to: determine the shaking amplitude corresponding to the shaking state; if the shaking amplitude is greater than a set amplitude, increase the reporting threshold.
  • the coupling between the modules may be electrical, mechanical or other forms of coupling.
  • each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or software function modules.
  • the solution provided by this application determines the reporting threshold corresponding to the usage scenario by detecting the usage scenario currently spoken by the mobile terminal. After the reporting threshold is determined, when a touch event is detected, the report includes the initial touch coordinates. When the touch event is continuously detected, if the difference between the current touch coordinate and the initial touch coordinate is greater than the reporting threshold, the touch event information including the current touch coordinate is reported, so that the mobile terminal corresponds to the usage scenario.
  • control the reporting of touch event information to avoid false triggering of sliding events, and can also quickly respond to sliding events in demand scenarios.
  • the mobile terminal 100 may be an electronic device capable of running applications, such as a smart phone, a tablet computer, an e-book, or a smart watch.
  • the mobile terminal 100 in this application may include one or more of the following components: a processor 110, a memory 120, a touch screen 130, and one or more application programs, of which one or more application programs may be stored in the memory 120 and configured To be executed by one or more processors 110, one or more programs are configured to execute the methods described in the foregoing method embodiments.
  • the processor 110 may include one or more processing cores.
  • the processor 110 uses various interfaces and lines to connect various parts of the entire mobile terminal 100, and executes by running or executing instructions, programs, code sets, or instruction sets stored in the memory 120, and calling data stored in the memory 120.
  • Various functions and processing data of the mobile terminal 100 may adopt at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA).
  • DSP Digital Signal Processing
  • FPGA Field-Programmable Gate Array
  • PDA Programmable Logic Array
  • the processor 110 may be integrated with one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), a modem, and the like.
  • the CPU mainly processes the operating system, user interface, and application programs; the GPU is used for rendering and drawing of display content; the modem is used for processing wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 110, but may be implemented by a communication chip alone.
  • the memory 120 may include random access memory (RAM) or read-only memory (Read-Only Memory).
  • the memory 120 may be used to store instructions, programs, codes, code sets or instruction sets.
  • the memory 120 may include a program storage area and a data storage area, where the program storage area may store instructions for implementing the operating system and instructions for implementing at least one function (such as touch function, sound playback function, image playback function, etc.) , Instructions used to implement the following various method embodiments, etc.
  • the data storage area can also store data (such as phone book, audio and video data, chat record data) created by the terminal 100 during use.
  • the touch screen 130 can collect the user's touch operations on or near it (for example, the user's operations on the touch screen 130 or near the touch screen 130 using any suitable object or accessory such as a finger, a stylus, etc.), and set it according to a preset
  • the program drives the corresponding connection device.
  • the touch screen 130 may include a touch detection device and a touch controller.
  • the touch detection device detects the user's touch position, detects the signal brought by the touch operation, and transmits the signal to the touch controller;
  • the touch controller receives touch information from the touch detection device, and The touch information is converted into contact coordinates, and then sent to the processor 110, and the command sent by the processor 110 can be received and executed.
  • multiple types such as resistive type, capacitive type, infrared, and surface acoustic wave may be used to implement the touch detection function of the touch screen 130.
  • FIG. 10 shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application.
  • the computer-readable medium 800 stores program code, and the program code can be invoked by a processor to execute the method described in the foregoing method embodiment.
  • the computer-readable storage medium 800 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
  • the computer-readable storage medium 800 includes a non-transitory computer-readable storage medium.
  • the computer-readable storage medium 800 has storage space for the program code 810 for executing any method steps in the above-mentioned methods. These program codes can be read from or written into one or more computer program products.
  • the program code 810 may be compressed in a suitable form, for example.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

本申请公开了一种触摸事件的处理方法、装置、移动终端及存储介质,该触摸事件的处理方法应用于移动终端,该触摸事件的处理方法包括:检测所述移动终端当前所处的使用场景;确定与所述使用场景对应的上报阈值;当检测到触摸事件时,上报包括起始触摸坐标的触摸事件信息;在持续检测到触摸事件时,如果当前触摸坐标与所述起始触摸坐标之间的差值大于所述上报阈值,上报包括所述当前触摸坐标的触摸事件信息。本方法可以根据实际的使用场景动态更新上报触摸事件信息的上报阈值,避免滑动事件的误触发的同时也可以快速响应滑动事件。

Description

触摸事件的处理方法、装置、移动终端及存储介质 技术领域
本申请涉及移动终端技术领域,更具体地,涉及一种触摸事件的处理方法、装置、移动终端及存储介质。
背景技术
移动终端,例如平板电脑、手机等,已经成为人们日常生活中最常用的消费型电子产品之一。随着移动终端的日益智能化,触控技术应用到移动终端中,越来越多的移动终端所设置的显示屏为触控显示屏,触控技术的应用简化了用户操作,给用户带来了更好的使用体验。
发明内容
鉴于上述问题,本申请提出了一种触摸事件的处理方法、装置、移动终端及存储介质。
第一方面,本申请实施例提供了一种触摸事件的处理方法,应用于移动终端,所述移动终端包括触摸屏,所述方法包括:检测所述移动终端当前所处的使用场景;确定与所述使用场景对应的上报阈值;当检测到触摸事件时,上报包括起始触摸坐标的触摸事件信息;在持续检测到触摸事件时,如果当前触摸坐标与所述起始触摸坐标之间的差值大于所述上报阈值,上报包括所述当前触摸坐标的触摸事件信息。
第二方面,本申请实施例提供了一种触摸事件的处理装置,应用于移动终端,所述移动终端包括触摸屏,所述装置包括:场景检测模块、阈值确定模块、第一上报模块以及第二上报模块,其中,所述场景检测模块用于检测所述移动终端当前所处的使用场景;所述阈值确定模块用于确定与所述使用场景对应的上报阈值;所述第一上报模块用于当检测到触摸事件时,上报包括起始触摸坐标的触摸事件信息;所述第二上报模块用于在持续检测到触摸事件时,如果当前触摸坐标与所述起始触摸坐标之间的差值大于所述上报阈值,上报包括所述当前触摸坐标的触摸事件信息。
第三方面,本申请实施例提供了一种移动终端,包括:一个或多个处理器;存储器;一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行上述第一方面提供的触摸事件的处理方法。
第四方面,本申请实施例提供了一种计算机可读取存储介质,所述计算机可读取存储介质中存储有程序代码,所述程序代码可被处理器调用执行上述第一方面提供的触摸事件的处理方法。
本申请提供的方案,通过检测移动终端当前说出的使用场景,确定与使用场景对应的上报阈值,在确定上报阈值后,当检测到触摸事件时,上报包括起始触摸坐标的触摸事件信息,在持续检测到触摸事件时,如果当前触摸坐标与起始触摸坐标之间的差值大于上报阈值,上报包括当前触摸坐标的触摸事件信息,从而实现移动终端根据与使用场景对应的上报阈值,在触摸事件发生时的触摸事件信息上报过程中,控制触摸事件信息的上报,避免滑动事件的误触发,并且也可以快速响应需求场景下的滑动事件。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使 用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1示出了根据本申请一个实施例的触摸事件的处理方法流程图。
图2示出了根据本申请另一个实施例的触摸事件的处理方法流程图。
图3示出了本申请另一个实施例提供的触摸事件的处理方法中步骤S220的一种流程图。
图4示出了本申请另一个实施例提供的触摸事件的处理方法中步骤S220的另一种流程图。
图5示出了根据本申请又一个实施例的触摸事件的处理方法流程图。
图6示出了根据本申请再一个实施例的触摸事件的处理方法流程图。
图7示出了根据本申请又再一个实施例的触摸事件的处理方法流程图。
图8示出了根据本申请一个实施例的触摸事件的处理装置的一种框图。
图9是本申请实施例的用于执行根据本申请实施例的触摸事件的处理方法的移动终端的框图。
图10是本申请实施例的用于保存或者携带实现根据本申请实施例的触摸事件的处理方法的程序代码的存储单元。
具体实施方式
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。
显示屏通常在手机、平板电脑等移动终端中所起到的作用为显示文本、图片、图标或者视频等内容。而随着移动终端的日益智能化,触控技术被广泛的应用于人机交互领域。伴随着触控技术的发展,越来越多的移动终端所设置的显示屏为触控显示屏,在设置触控显示屏的情况下,当检测到用户在触控显示屏上进行拖拽、单击、双击、滑动等触控操作时,可以对用户的触控操作进行响应。触控技术的应用简化了用户操作,给用户带来了更好的使用体验。
但在实践中发现,用户在使用移动终端时,如果处于抖动或者晃动的环境,用户的触控操作极易受干扰。有时候用户只想要触摸点击选中目标,却常常由于终端设备的抖动,导致手指按下触控屏后产生滑动,如果此时终端设备的触控屏同时监听点击和滑动事件,那么就会误将点击指令识别成滑动指令,引起滑动操作的误触发。具体的,在进行点击操作时,如果触摸屏系统将每一帧触摸坐标的数据都实时上报的话,会使得抖动时的点击事件造成滑动事件,这是触摸屏系统根据用户的点击操作造成的坐标抖动引起的。有些场景下,原本用户是点击的操作,因为抖动引起,从而触发滑动事件,造成界面的错误响应。
针对抖动引起的点击操作误触发滑动事件,传统的技术方案中采用统一的防抖动的预设门限,该预设门限用于控制触摸事件产生时触摸事件信息的上报,其中,触摸事件信息可以包括按下事件、抬起事件、屏幕坐标、手按压的压力事件信息、手指接触触摸屏的直径的近似事件信息以及手指的直径的近似事件信息等。通过设置该预设门限,触摸屏系统将触摸事件发生过程中每帧触摸坐标与触摸事件的起始触摸坐标之间的差值,与该预设门限进行比较,在差值大于该预设门限时才进行触摸事件信息的上报,从而避免抖动时的点击操作时,将每一帧触摸坐标的数据都实时上报,而错误的触发滑动事件。
发明人经过长期研究发现,传统技术中,移动终端中设置的防抖动的预设门限通常为固定值,并且全局都采用统一的防抖动的预设门限,即所有使用场景下都使用同一预设门限。而在一些场景下(例如游戏场景等),需快速触发滑动事件,如果门限 较大,则容易被识别为点击事件,而不能快速的响应滑动;而在一些场景下(例如聊天场景等),通常大多为点击操作,如果门限较小,点击操作容易触发滑动事件,造成界面的错误响应。
针对上述问题,发明人提出了本申请实施例提供的触摸事件的处理方法、装置、移动终端以及存储介质,通过确定与使用场景对应的上报阈值,并根据该上报阈值,在该使用场景下触摸事件发生时的触摸事件信息上报过程中,控制触摸事件信息的上报,避免滑动事件的误触发,并且也可以快速响应需求场景下的滑动事件。其中,具体的触摸事件的处理方法在后续的实施例中进行详细的说明。
请参阅图1,图1示出了本申请一个实施例提供的触摸事件的处理方法的流程示意图。所述触摸事件的处理方法用于动态更新与场景对应的上报阈值,并在触摸事件发生时的触摸事件信息上报过程中,根据上报阈值进行触摸事件信息的上报,避免滑动事件的误触发,并且也可以快速响应需求场景下的滑动事件。在具体的实施例中,所述触摸事件的处理方法应用于如图8所示的触摸事件的处理装置400以及配置有所述触摸事件的处理装置400的移动终端100(图9)。下面将以移动终端为例,说明本实施例的具体流程,当然,可以理解的,本实施例所应用的移动终端可以为智能手机、平板电脑、电子书等,在此不做限定。其中,所述移动终端包括触摸屏。下面将针对图1所示的流程进行详细的阐述,所述触摸事件的处理方法具体可以包括以下步骤:
步骤S110:检测所述移动终端当前所处的使用场景。
在本申请实施例中,移动终端在被使用的过程中,移动终端可以检测其所处的使用场景。其中,不同的使用场景对应对滑动操作响应的需求、点击操作响应的需求可以不同,从而后续可根据使用场景,确定用于上报触摸事件信息的上报阈值,使上报阈值与使用场景对应,避免滑动事件的误触发,并能快速响应需求场景下的滑动操作。
在一些实施方式中,移动终端所处的使用场景可以根据不同场景下点击操作发生的频率、点击操作发生的次数、滑动操作发生的频率以及滑动操作发生的次数中的一种或者多种参数,进行划分。例如,使用场景可以根据点击操作发生的频率以及滑动操作发生的频率进行划分,具体通过两个频率的大小,确定对于滑动操作的需求以及对于点击操作的需求,并根据对于滑动操作的需求以及对于点击操作的需求,划分使用场景。
作为一种实施方式,可以分配对于滑动操作的需求的权值以及对于点击操作的需求的权值,然后再同时根据对于滑动操作的需求以及对于点击操作的需求,划分使用场景。例如,通过滑动操作发生的频率占所有触控操作发生的频率的第一比例,第一比例用于表征对于滑动操作的需求,通过点击操作发生的频率占所有触控操作发生的频率的第二比例,第二比例用于表征对于点击操作的需求,然后以第一比例与其对应的权值的第一乘积,第二比例与其对应的权值的第二乘积,计算第一乘积与第二乘积之和,不同的和值对应不同的使用场景。
在一些实施方式中,也可以仅考虑对于滑动操作的需求,而对使用场景进行划分。例如,使用场景可以分为对于滑动操作的响应速度有需求的使用场景,以及无需求的使用场景,当然,以上仅为举例。
在一些实施方式中,移动终端可以识别当前运行的应用程序、屏幕使用状态、网络状态等设备状态,确定移动终端当前所处的使用场景。可以理解的,移动终端可以根据上述划分的使用场景,确定不同使用场景下的设备状态,并将设备状态与使用场景关联,从而移动终端可以根据识别的设备状态,确定移动终端所处的使用场景。当然,检测移动终端所处的使用场景的具体方式可以不作为限定。
步骤S120:确定与所述使用场景对应的上报阈值。
在本申请实施例中,移动终端在确定出使用场景后,则可以确定与使用场景对应的上报阈值。该上报阈值可以理解为前述的防抖动的预设门限。也就是说,移动终端 的操作系统底层的触摸屏系统将触摸事件发生过程中每帧触摸坐标与触摸事件的起始触摸坐标之间的差值,与该上报门限进行比较,在差值大于该上报门限时才进行触摸事件信息的上报,从而避免抖动时的点击操作时,将每一帧触摸坐标的数据都实时上报,而错误的触发滑动事件。上报阈值的具体数值可以不作为限定,例如,可以为2,可以为5等。
示例性的,以操作系统为安卓(Android)系统的移动终端为例,介绍触摸屏系统上报触摸事件信息的原理。安卓系统框架由下至上包括内核层、核心类库层、框架层及应用层。其中,内核层提供核心系统服务,包括安全、内存管理、进程管理、网络协议栈及硬件驱动等。其中,将内核层中的硬件驱动记为驱动层,该驱动层包括触控显示屏驱动、摄像头驱动等。核心类库层包括安卓运行环境(Android Runtime)和类库(Libraries)。其中,安卓运行环境提供大部分在Java编程语言核心类库中可用的功能,包括核心库(CoreLibraries)和Dalvik虚拟机(Dalvik VM)。每一个安卓应用程序是Dalvik虚拟机中的实例,运行在它们自己的进程中。类库供安卓系统的各个组件使用,包括如下功能:媒体库(Media Framework)、界面管理(Surface Manager)、SQLite(关系数据库引擎)及Free Type(位图和矢量字体渲染)等,其各个功能通过安卓系统的框架层暴露给开发者使用。框架层提供开发安卓应用程序所需的一系列类库,使开发人员可以进行快速的应用程序开发,方便重用组件,也可以通过继承实现个性化的扩展,其提供的服务包括组件管理服务、窗口管理服务、系统数据源组件、空间框架、资源管理服务及安装包管理服务等。应用层上包括各类与用户直接交互的应用程序,或由Java语言编写的运行于后台的服务程序,包括桌面应用、联系人应用、通话应用、相机应用、图片浏览器、游戏、地图、web浏览器等程序,以及开发人员开发的其他应用程序。
进一步的,操作系统的底层可以包括内核层中的触摸屏系统,触摸屏系统可以监测对触摸屏的触摸事件。例如,当监测到按下事件时,则确定监测到对触摸屏的触摸事件。触摸屏系统检测到触摸事件时,可以将触摸事件信息上报至应用层,以便应用层识别触摸事件,并进行相关的处理和控制。
在一些实施方式中,不同的使用场景可以对应不同的上报阈值。如果使用场景同时根据对点击操作的响应需求以及滑动操作的响应需求进行划分,则该上报阈值可以同时兼顾点击操作和滑动操作的响应需求。如果使用场景根据滑动操作的响应需求划分,则该上报阈值可以兼顾滑动操作的响应需求较高的使用场景以及普通使用场景,普通使用场景即为除滑动操作的响应需求较高的使用场景以外的其他场景。
示例性的,使用场景同时考虑点击操作和滑动操作的响应需求时,可以将默认的上报阈值(系统设定的初始上报阈值)为参考阈值,预先计算不同使用场景下滑动操作发生的频率占所有触控操作发生的频率的第一比例,以及点击操作发生的频率占所有触控操作发生的频率的第二比例。这些触摸操作发生的频率,可以预先根据不同使用场景统计得到。由于要快速响应滑动操作时,上报阈值需较小,而要避免点击操作被误被识别为滑动操作时,上报阈值需较大。因此,可以求的第一比例与第二比例的差值,并根据将该差值加1后的和值,与初始上报阈值相乘,获得使用场景对应的上报阈值。当然,具体计算上报阈值的方法可以不作为限定。可以理解的,计算不同使用场景对应的上报阈值后,可以建立使用场景与上报阈值的对应关系,并存储于移动终端,以便在实际应用过程中移动终端可以直接根据该对应关系确定。
步骤S130:当检测到触摸事件时,上报包括起始触摸坐标的触摸事件信息。
在本申请实施例中,移动终端在确定出上报阈值后,则可以根据上报阈值,控制触摸事件发生时,触摸事件信息上报过程中的触摸事件信息的上报。触摸屏在检测到触摸事件时,则触摸屏系统可以获取触摸的起始点对应的起始触摸坐标,对起始触摸坐标进行记录,并将包括起始触摸坐标的触摸事件信息进行上报。并且由于刚检测到触摸事件时,事件的类型为按下事件,因此上报的触摸事件信息中还可以包括按下事 件。
步骤S140:在持续检测到触摸事件时,如果当前触摸坐标与所述起始触摸坐标之间的差值大于所述上报阈值,上报包括所述当前触摸坐标的触摸事件信息。
在本申请实施例中,触摸屏系统可以继续监测触摸事件,也就是持续扫描触摸信号,当持续检测到触摸事件时,则可以根据上报阈值,控制每次检测到的触摸坐标的上报。具体的,触摸屏系统在持续检测到触摸事件时,将当前触摸坐标与触摸事件的起始触摸坐标之间的差值,与该上报阈值进行比较,在差值大于该上报阈值时才进行触摸事件信息的上报,从而避免抖动时的点击操作时,将每一帧触摸坐标的数据都实时上报,而错误的触发滑动事件。其中,当前触摸坐标为(120,101),起始触摸坐标为(120,105),则当前触摸坐标与起始触摸坐标之间差值为4,而如果上报阈值为3,则当前触摸坐标与起始触摸坐标之间的差值大于上报阈值。另外,由于对于滑动操作的响应需求较高的使用场景,利用的是与该使用场景对应的上报阈值,此时的上报阈值较小,因此也不会耽误滑动事件的识别,从而快速响应滑动操作。
在一些实施方式中,移动终端可以在识别到使用场景变化时,对所处的使用场景进行检测,以便可以根据使用场景确定新的上报阈值,而实现上报阈值的更新。
本申请实施例提供的触摸事件的处理方法,通过检测移动终端当前说出的使用场景,确定与使用场景对应的上报阈值,在确定上报阈值后,当检测到触摸事件时,上报包括起始触摸坐标的触摸事件信息,在持续检测到触摸事件时,如果当前触摸坐标与起始触摸坐标之间的差值大于上报阈值,上报包括当前触摸坐标的触摸事件信息,从而实现移动终端根据与使用场景对应的上报阈值,在触摸事件发生时的触摸事件信息上报过程中,控制触摸事件信息的上报,避免滑动事件的误触发,并且也可以快速响应需求场景下的滑动事件。并实现针对不同使用场景,而更新上报阈值,满足不同使用场景下对于触摸操作的需求。
请参阅图2,图2示出了本申请另一个实施例提供的触摸事件的处理方法的流程示意图。该触摸事件的处理方法可以应用于上述移动终端。下面将针对图2所示的流程进行详细的阐述,所述触摸事件的处理方法具体可以包括以下步骤:
步骤S210:获取所述移动终端中当前运行的应用。
在一些实施方式中,移动终端可以根据当前运行的应用,确定移动终端所处的使用场景。移动终端可以获取当前运行的应用,以便确定使用场景。其中,移动终端可以通过操作系统的进程管理获取当前运行的应用,并且可以获取到运行的应用的状态和信息等,例如应用在前台运行或者在后台运行,应用运行占用的处理器资源,应用当前调用的硬件模块等。当然,获取移动终端中当前运行的应用的方式可以不作为限定。
步骤S220:根据所述当前运行的应用,确定所述移动终端当前所处的使用场景。
在本申请实施例中,移动终端在获取到当前运行的应用后,则可以根据当前运行的应用,确定移动终端当前所处的使用场景。
在一些实施方式中,使用场景可以包括第一使用场景以及第二使用场景,所述第一使用场景下的滑动操作的优先级高于所述第二使用场景下的滑动操作的优先级。其中,滑动操作的优先级可以分为第一优先级以及第二优先级,对于需求快速响应滑动操作的使用场景(例如游戏场景等),则滑动操作的优先级为第一优先级,而不需要快速性响应滑动操作的其他使用场景(例如聊天场景等),则滑动操作的优先级为第二优先级,并且第一优先级高于第二优先级。可以理解的,对需求快速响应滑动操作的使用场景进行考虑,而对使用场景进行划分,第一使用场景即为需求快速响应滑动操作的使用场景,而第二使用场景则为其他使用场景。
作为一种实施方式,请参见图3,步骤S220可以包括:
步骤S221A:确定所述当前运行的应用中处于前台运行的应用。
可以理解的,移动终端可以当前运行的应用的运行状态,确定应用处于前台运行或者处于后台运行。
步骤S222A:判断所述前台运行的应用是否处于预设名单中。
在本申请实施例中,移动终端存储有预设名单,该预设名单中存储第一使用场景的多个应用,也就是说,当这些应用需求快速响应滑动操作。如果这些应用中任一应用处于前台运行时,则移动终端处于第一使用场景。因此,可以判断前台运行的应用是否处于预设名单中,并根据判断结果,确定移动终端所处的使用场景。可以理解的,如果当前运行的应用处于预设名单中,则移动终端处于第一使用场景,如果当前运行的应用不处于预设名单中,则移动终端处于第二使用场景。
步骤S223A:如果处于所述预设名单中,则确定所述移动终端处于第一使用场景。
步骤S224A:如果未处于所述预设名单中,则确定所述移动终端处于第二使用场景。
该实施方式下,由于通常对于滑动操作的响应需求较高的使用场景下,都是在前台运行有特定的应用程序,例如运行有游戏应用、画图应用等。因此将这些应用设置于上述预设名单,从而通过该预设名单,即可快捷方便的确定移动终端所处的使用场景。
作为另一种实施方式,请参见图4,步骤S220可以包括:
步骤S221B:确定所述当前运行的应用中处于前台运行的应用。
步骤S222B:判断所述前台运行的应用的类型是否为设定类型。
步骤S223B:如果为设定类型,则确定所述移动终端处于第一使用场景。
步骤S224B:如果不为设定类型,则确定所述移动终端处于第二使用场景。
可以理解的,由于通常对于滑动操作的响应需求较高的使用场景下,在前台运行有设定类型的应用程序,移动终端也可以通过前台运行的应用的类型,判断前台运行的应用的类型是否为设定类型,进而根据判断结果,确定移动终端所处的使用场景。具体的,如果前台运行的应用的类型为设定类型,则确定移动终端处于第一使用场景;如果前台运行的应用的类型不为设定类型,则确定移动终端处于第二使用场景。通过确定应用的类型是否为设定类型,即可快捷方便的确定移动终端所处的使用场景。其中,移动终端可以根据当前前台运行的应用的标识、运行的界面、调用的硬件模块等,确定应用的类型,在此不做限定。
在一些实施方式中,移动终端可以根据预先设定的策略,或者用户选择的方式,而从上述两种实施方式中选取一种实施方式确定移动终端所处的使用场景。
步骤S230:如果所述使用场景为第一使用场景,确定所述上报阈值为第一阈值。
步骤S240:如果所述使用场景为第二使用场景,确定所述上报阈值为第二阈值,其中,所述第一阈值小于所述第二阈值。
在本申请实施例中,如果移动终端当前所处的使用场景为第一使用场景,则表示当前场景下需求快速响应滑动操作,而移动终端当前所处的使用场景为第二使用场景,则表示当前场景下不需求快速响应滑动操作,因此,可以设置第一使用场景对应的上报阈值小于第二使用场景对应的上报阈值,即第一阈值小于第二阈值,以快速响应第一使用场景下的滑动操作。
在一些实施方式中,由于第二使用场景包括除了需求快速响应滑动操作的第一使用场景以外的其他使用场景,因此,第二使用场景可以理解为普通使用场景,第二阈值可以设置为系统设定的初始上报阈值,第一阈值则为小于初始上报阈值,具体的第一阈值可以不作为限定,例如,初始上报阈值为3时,则第一阈值可以为2。
步骤S250:当检测到触摸事件时,上报包括起始触摸坐标的触摸事件信息。
在本申请实施例中,步骤S250可以参阅前述实施例的内容,在此不再赘述。
步骤S260:在持续检测到触摸事件时,如果当前触摸坐标与所述起始触摸坐标之 间的差值大于所述上报阈值,上报包括所述当前触摸坐标的触摸事件信息。
在本申请实施例中,触摸屏系统在持续检测到触摸事件时,将当前触摸坐标与触摸事件的起始触摸坐标之间的差值,与前述确定的第一阈值或第二阈值进行比较,在差值大于第一阈值或第二阈值时才进行触摸事件信息的上报,从而避免抖动时的点击操作时,将每一帧触摸坐标的数据都实时上报,而错误的触发滑动事件。在第一使用场景的情况下,由于第一阈值相对较小,也使得能快速响应需求场景下的滑动事件,满足用户的使用需求。在第二使用场景的情况下,由于第二阈值相对较大,可以较好的避免抖动时的点击操作时,错误的触发滑动事件。
在一些实施方式中,当使用场景为第二使用场景时,由于其对快速响应滑动操作的需求不高,可以更加准确的防止抖动时点击操作误触发滑动事件,因此如果当前触摸坐标与起始触摸坐标之间的差值大于上报阈值时,还可以进一步进行防抖动的处理。
作为一种实施方式,如果当前触摸坐标与所述起始触摸坐标之间的差值大于所述上报阈值,上报包括所述当前触摸坐标的触摸事件信息,可以包括:如果当前触摸坐标与所述起始触摸坐标之间的差值大于所述上报阈值,且所述使用场景为第二使用场景时,获取所述当前触摸坐标与前一个触摸坐标之间的差值作为目标差值;如果所述目标差值大于指定阈值,上报包括所述当前触摸坐标的触摸事件信息。
可以理解的,在使用场景为第二使用场景的情况下,当确定出当前触摸坐标与起始触摸坐标之间的差值大于上报阈值时,还可以确定当前触摸坐标与前一个触摸坐标之间的差值是否大于指定阈值,其中,前一个触摸坐标可以指获取到当前触摸坐标之前的一次获取到的触摸坐标。通过比对当前触摸坐标与前一个触摸坐标之间的目标差值是否大于指定阈值,当目标差值大于指定阈值时,才上报包括当前触摸坐标的触摸事件信息,而目标差值小于或等于指定阈值时,不上报包括当前触摸坐标的触摸事件信息。因此更能避免抖动时的点击操作时,将每一个触摸坐标都进行上报而引起点击操作,误触发滑动事件。其中,指定阈值的具体大小可以不作为限定,其可以为小于目标阈值的值。
作为另一种实施方式,如果当前触摸坐标与所述起始触摸坐标之间的差值大于所述上报阈值,上报包括所述当前触摸坐标的触摸事件信息,可以包括:如果当前触摸坐标与所述起始触摸坐标之间的差值大于所述上报阈值,且所述使用场景为第二使用场景时,获取所述当前触摸坐标对应的检测时刻与前一个触摸坐标对应的检测时刻之间的时间间隔;如果所述时间间隔小于指定间隔,上报包括所述当前触摸坐标的触摸事件信息。
可以理解的,在使用场景为第二使用场景的情况下,当确定出当前触摸坐标与起始触摸坐标之间的差值大于上报阈值时,还可以确定检测到当前触摸坐标的检测时刻与检测到前一个触摸坐标的检测时刻之间的时间间隔是否大于指定间隔,其中,前一个触摸坐标可以指获取到当前触摸坐标之前的一次获取到的触摸坐标。通过比对两个检测时刻之间的时间间隔是否大于指定间隔,当时间间隔大于指定间隔时,才上报包括当前触摸坐标的触摸事件信息,而时间间隔小于或等于指定间隔时,不上报包括当前触摸坐标的触摸事件信息。因此能进一步地避免第二使用场景下,抖动时的点击操作时,将每一个触摸坐标都进行上报而引起点击操作,误触发滑动事件。其中,指定时间间隔的具体大小可以不作为限定,例如,其可以为触摸屏扫描触摸信号的间隔等。
本申请实施例提供的触摸事件的处理方法,通过确定移动终端当前运行的应用,并根据当前运行的应用确定移动终端所处的使用场景,可以快捷方便的确定移动终端所处的使用场景,再确定与使用场景对应的第一阈值或者第二阈值,根据与使用场景对应的第一阈值或者第二阈值,控制触摸事件发生时的触摸事件信息的上报,从而实现移动终端根据与使用场景对应的上报阈值,在触摸事件发生时的触摸事件信息上报过程中,控制触摸事件信息的上报,避免滑动事件的误触发,并且也可以快速响应需 求场景下的滑动事件。并实现针对不同使用场景,而更新上报阈值,满足不同使用场景下对于触摸操作的需求。
请参阅图5,图5示出了本申请又一个实施例提供的触摸事件的处理方法的流程示意图。该触摸事件的处理方法可以应用于上述移动终端。下面将针对图5所示的流程进行详细的阐述,所述触摸事件的处理方法具体可以包括以下步骤:
步骤S310:获取所述移动终端当前的屏幕显示状态。
在本申请实施例中,移动终端可以根据当前的屏幕显示状态,确定移动终端所处的使用场景。其中,屏幕显示状态可以包括横屏状态以及竖屏状态。
在一些实施方式中,移动终端可以包括加速度传感器。移动终端根据加速度传感器检测的数据,可以检测出屏幕显示状态。具体的,加速度传感器检测的数据可以包括X轴、Y轴以及Z轴的数据,竖屏下,Z轴数据较小,X轴数据接近重力加速度,而横屏下,Z轴数据较小,Y轴数据接近重力加速度。因此可以通过确定X轴数据或者Y轴数据是否接近重力加速度,并且判断Z轴数据是否小于设定的加速度,如果X轴数据接近重力加速度,并且Z轴数据小于设定的加速度,则确定为竖屏状态,如果Y轴数据接近重力加速度,并且Z轴数据小于设定的加速度,则确定为横屏状态。当然,具体确定屏幕显示状态的方式可以不作为限定
步骤S320:根据所述屏幕显示状态,确定所述移动终端当前所处的使用场景。
在一些实施方式中,通常而言,横屏状态下大多为游戏场景,需要快速响应滑动操作,而竖屏状态下大多为点击事件,而不需要快速响应滑动操作。因此,如果所述屏幕显示状态为横屏状态,则确定所述移动终端处于第一使用场景;如果所述屏幕显示状态为竖屏状态,则确定所述移动终端处于第二使用场景。在一种方式中,第一使用场景可以为游戏场景,第二使用场景可以为除游戏场景以外的其他场景。
该实施方式下,通过确定移动终端的屏幕显示状态处于横屏状态或者竖屏状态,而确定移动终端所处的使用场景,也能快捷方便的检测移动终端所处的使用场景。
步骤S330:如果所述使用场景为第一使用场景,确定所述上报阈值为第一阈值。
步骤S340:如果所述使用场景为第二使用场景,确定所述上报阈值为第二阈值,其中,所述第一阈值小于所述第二阈值。
在本申请实施例中,步骤S330以及S340可以参阅上个实施例的内容,在此不再赘述。
步骤S350:当检测到触摸事件时,上报包括起始触摸坐标的触摸事件信息。
步骤S360:在持续检测到触摸事件时,如果当前触摸坐标与所述起始触摸坐标之间的差值大于所述上报阈值,上报包括所述当前触摸坐标的触摸事件信息。
在本申请实施例中,步骤S350以及步骤S360可以参阅前述实施例的内容,在此不再赘述。
本申请实施例提供的触摸事件的处理方法,通过确定移动终端的屏幕显示状态,并根据屏幕显示状态处于横屏状态或者处于竖屏状态,可以快捷方便的确定移动终端所处的使用场景为第一使用场景或者第二使用场景,再确定与第一使用场景对应的第一阈值或者第二使用场景对应的第二阈值,根据第一阈值或者第二阈值,控制触摸事件发生时的触摸事件信息的上报,从而实现移动终端根据与使用场景对应的上报阈值,在触摸事件发生时的触摸事件信息上报过程中,控制触摸事件信息的上报,避免滑动事件的误触发,并且也可以快速响应需求场景下的滑动事件。并实现针对不同使用场景,而更新上报阈值,满足不同使用场景下对于触摸操作的需求。
请参阅图6,图6示出了本申请再一个实施例提供的触摸事件的处理方法的流程示意图。该触摸事件的处理方法可以应用于上述移动终端。下面将针对图6所示的流程进行详细的阐述,所述触摸事件的处理方法具体可以包括以下步骤:
步骤S410:检测所述移动终端当前所处的使用场景。
步骤S420:确定与所述使用场景对应的上报阈值,所述上报阈值用于所述移动终端在所述触摸屏检测到触摸事件时的触摸事件信息的上报过程中,根据当前触摸坐标与起始触摸坐标之间的距离以及所述上报阈值,控制触摸事件信息的上报。
在本申请实施例中,步骤S410以及步骤S420可以参阅前述实施例的内容,在此不再赘述。
步骤S430:当检测到对所述触摸屏的触摸事件时,获取所述触摸事件对应的起始触摸坐标。
随着移动终端的屏幕的不断增大,移动终端上的下部按键区被逐渐取消。由于移动终端上没有了用于返回主页、回退、查看任务等的按键,因此产生了导航手势功能。其中,导航手势功能为通过系统界面或者应用界面上的导航手势,而实现返回桌面、返回上一级以及查看最近任务等利用实体按键或者虚拟按键完成的功能。例如,用户可以通过触摸屏上底部区域的上滑操作手势实现返回桌面,当然,具体的导航手势可以不作为限定。
在本申请实施例中,考虑到导航手势功能的导航手势通常都是从边缘往内部区域滑动,而用户在点击边缘区域时,如果有抖动,则很容易造成误触发滑动事件,从而造成导航手势功能的误触发。因此,可以确定触摸事件产生时的起始触摸坐标,确定起始触摸坐标是否在导航手势的坐标区域内,并在起始触摸坐标在导航手势的坐标区域内时,增大上报阈值,以避免抖动时的点击导航手势的坐标区域时,将每一帧触摸坐标的数据都实时上报,而错误的触发滑动事件,进而触发导航手势。
步骤S440:当所述触摸坐标处于预设坐标范围时,将所述上报阈值增大为设定阈值。
在本申请实施例中,可以确定可能触发导航手势功能的导航手势对应的所有触摸坐标,并针对所有触摸坐标,构建预设坐标范围。例如,触摸坐标为(X,Y),设置的预设坐标范围可以为,0<X<100且980<Y<1080,以及0<X<100且2340<Y<2440。当然,具体的预设坐标范围可以不做限定。
在一些实施方式中,移动终端可以判断触摸事件产生时的起始触摸坐标是否处于预设坐标范围内,如果起始触摸坐标处于预设坐标范围内,则表示可能本次触摸事件会误触发导航手势,而如果起始触摸坐标不处于预设坐标范围内,则不会误触发导航手势。因此,可以起始触摸坐标在预设坐标范围时,增大上报阈值为设定阈值,后续则根据设定阈值控制触摸事件信息的上报,以避免抖动时的点击导航手势的坐标区域时,将每一帧触摸坐标的数据都实时上报,而错误的触发滑动事件,进而触发导航手势。
在一些实施方式中,操作系统可以向触摸屏系统下发指令,从而触摸屏系统根据该指令,将上报阈值增大至设定阈值。当然,其他实施例中,确定上报阈值后,也可以通过该方式,而设置触摸屏系统的上报阈值。
步骤S450:当检测到触摸事件时,上报包括起始触摸坐标的触摸事件信息。
步骤S460:在持续检测到触摸事件时,如果当前触摸坐标与所述起始触摸坐标之间的差值大于所述设定阈值,上报包括所述当前触摸坐标的触摸事件信息。
在本申请实施例中,步骤S450以及步骤S460可以参阅前述实施例的内容,在此不再赘述。
本申请实施例提供的触摸事件的处理方法,通过检测移动终端所处的使用场景,确定与使用场景对应的上报阈值,并在根据上报阈值,控制触摸事件发生时的触摸事件信息的上报过程中,确定触摸事件发生时的起始触摸坐标是否位于预设坐标范围,该预设坐标范围为导航手势的触摸坐标的范围,如果起始触摸坐标位于预设坐标范围时,增大上报阈值为设定阈值,从而避免导航手势的坐标区域内进行点击操作时,如果发生抖动,而容易引起错误的触发滑动事件,进而触发导航手势。
请参阅图7,图7示出了本申请又再一个实施例提供的触摸事件的处理方法的流程示意图。该触摸事件的处理方法可以应用于上述移动终端。下面将针对图7所示的流程进行详细的阐述,所述触摸事件的处理方法具体可以包括以下步骤:
步骤S510:检测所述移动终端当前所处的使用场景。
步骤S520:确定与所述使用场景对应的上报阈值,所述上报阈值用于所述移动终端在所述触摸屏检测到触摸事件时的触摸事件信息的上报过程中,根据当前触摸坐标与起始触摸坐标之间的距离以及所述上报阈值,控制触摸事件信息的上报。
步骤S530:当检测到触摸事件时,获取所述触摸事件中按下事件对应的起始触摸坐标,上报包括所述按下事件以及所述起始触摸坐标的触摸事件信息。
在本申请实施例中,移动终端根据上报阈值,控制触摸事件发生时的触摸事件信息的上报,可以是移动终端的触摸屏系统检测到触摸事件时,获取起始触摸坐标,其中,起始触摸坐标为第一次按下事件发生时对应的触摸坐标。移动终端在获取到起始触摸坐标后,可以将包括按下事件以及起始触摸坐标的触摸事件信息进行上报,即上报至应用层进行处理。
在一些实施方式中,触摸屏可以定时的扫描和采集物体触摸的信号,并根据触摸信号获取电容差异数值,计算出触摸坐标和事件。其中,事件包括按下事件和抬起事件。另外,触摸屏的扫描频率可以大于触摸屏系统上报数据的报点频率,例如,扫描频率为400KHz,而上报数据的报点频率可以为100~200Hz。
在一些实施方式中,移动终端在获得起始触摸坐标后,还可以将起始触摸坐标进行记录,以便本次触摸事件中后续的触摸事件信息的上报时,根据当前触摸坐标、起始触摸坐标以及上报阈值,而确定是否上报触摸事件信息。
步骤S540:在持续检测到触摸事件时,对触摸事件信息的上报过程中,不断获取所述触摸事件对应的当前触摸坐标。
在本申请实施例中,触摸屏系统在触摸事件的触摸事件信息上报过程中,可以不断获取触摸事件对应的当前触摸坐标,以确定是否将当前触摸坐标以及其他事件信息进行上报。
在一些实施方式中,在所述触摸事件的触摸事件信息的上报过程中,可以按照第一预设频率获取所述触摸事件对应的当前触摸坐标。其中第一预设频率可以为上述的触摸屏系统上报数据的报点频率,具体的第一预设频率可以不作为限定。
步骤S550:判断所述当前触摸坐标与所述起始触摸坐标之间的差值是否大于所述上报阈值。
移动终端的操作系统底层的触摸屏系统在每次获得当前触摸坐标之后,可以判断当前触摸坐标与起始触摸坐标之间的差值是否大于上报阈值。该差值可以理解为两个坐标点之间的距离。例如,当前触摸坐标为(80,100),起始触摸坐标为(80,97),则当前触摸坐标与起始触摸坐标之间差值为3,而如果上报阈值为2,则当前触摸坐标与起始触摸坐标之间的差值大于上报阈值。
步骤S560:如果所述差值大于所述上报阈值,则上报包括所述按下事件以及所述当前触摸坐标的触摸事件信息。
步骤S570:如果所述差值小于或等于所述上报阈值,则不上报触摸事件信息。
可以理解的,由于抖动时通常检测的触摸坐标与起始触摸坐标之间的距离会较小,即抖动时的点击操作通常是在一个坐标点附近抖动,因此可以在如果差值大于上报阈值,才进行触摸事件信息的上报,而差值小于或等于上报阈值时,不上报触摸事件信息,从而避免在抖动时的点击操作时,误将每帧触摸数据进行上报,而引起滑动事件的误触发。
另外,触摸屏系统在检测到触摸事件中的抬起事件时,则可以上报抬起事件以及当前触摸坐标的触摸事件信息,以便应用层进行具体触摸操作的确定。
在一些实施方式中,该触摸事件的处理方法还可以包括:
当连续多次检测到所述差值小于或等于所述上报阈值时,将所述第一预设频率增大为第二预设频率。
可以理解的,如果在触摸事件的触摸事件信息的上报过程中,如果连续多次检测到差值小于或等于上报阈值,则表示此前的操作很可能是抖动情况下的点击操作,而再检测得到的当前触摸坐标,也可能对应的差值小于或等于上报阈值。因此,可以增大第二预设频率,减少获取当前触摸坐标的次数,从而减少触摸屏系统的处理量。
在一些实施方式中,该触摸事件的处理方法还可以包括:检测所述移动终端的运动状态;如果所述运动状态满足设定状态条件时,增大所述上报阈值。
可以理解的,上报阈值主要的作用为防止抖动情况下,点击操作误识别为滑动操作,因此可以检测移动终端的运动状态,并且在运动状态满足设定状态条件时,增大上报阈值。其中,设定状态条件可以用于表征移动终端处于抖动剧烈或者晃动剧烈的状态。
作为一种方式,所述运动状态包括晃动状态,所述如果所述运动状态满足设定状态条件时,增大所述上报阈值,包括:确定所述晃动状态对应的晃动幅度;如果所述晃动幅度大于设定幅度,则增大所述上报阈值。可以理解的,在移动终端晃动幅度大于设定幅度时,表示当前移动终端晃动较为剧烈,因此可以增大上报阈值,能更好的避免抖动时的点击操作误被识别为滑动操作。
其中,所述移动终端还包括陀螺仪传感器,所述监测所述移动终端的运动状态,包括:获取所述陀螺仪传感器检测的角速度数据;根据所述角速度数据,确定所述移动终端的晃动状态。
本申请实施例提供的触摸事件的处理方法,通过检测移动终端当前说出的使用场景,确定与使用场景对应的上报阈值,该上报阈值用于移动终端在触摸屏检测到触摸事件时的触摸事件信息的上报过程中,根据当前触摸坐标与起始触摸坐标之间的距离以及上报阈值,控制触摸事件信息的上报,在确定上报阈值后,根据该上报阈值,控制触摸事件发生时的触摸事件信息的上报,从而实现移动终端根据与使用场景对应的上报阈值,在触摸事件发生时的触摸事件信息上报过程中,控制触摸事件信息的上报,避免滑动事件的误触发,并且也可以快速响应需求场景下的滑动事件。并且在触摸事件的触摸事件信息上报过程中,动态对上报阈值进行调整,以及移动终端的运动状态满足设定状态条件时,增大上报阈值,能够更好的避免抖动时的点击操作误被识别为滑动操作。
请参阅图8,其示出了本申请实施例提供的一种触摸事件的处理装置400的结构框图。该触摸事件的处理装置400可以应用于上述移动终端,移动终端包括触摸屏。该触摸事件的处理装置400包括:场景检测模块410、阈值确定模块420、第一上报模块430以及第二上报模块440。其中,所述场景检测模块410用于检测所述移动终端当前所处的使用场景;所述阈值确定模块420用于确定与所述使用场景对应的上报阈值;所述第一上报模块430用于当检测到触摸事件时,上报包括起始触摸坐标的触摸事件信息;第二上报模块440用于在持续检测到触摸事件时,如果当前触摸坐标与所述起始触摸坐标之间的差值大于所述上报阈值,上报包括所述当前触摸坐标的触摸事件信息。
在一些实施方式中,所述使用场景包括第一使用场景以及第二使用场景,所述第一使用场景下的滑动操作的优先级高于所述第二使用场景下的滑动操作的优先级。阈值确定模块420可以具体用于:如果所述使用场景为第一使用场景,确定所述上报阈值为第一阈值;如果所述使用场景为第二使用场景,确定所述上报阈值为第二阈值,其中,所述第一阈值小于所述第二阈值。
在一些实施方式中,第二上报模块440可以具体用于:如果当前触摸坐标与所述 起始触摸坐标之间的差值大于所述上报阈值,且所述使用场景为第二使用场景时,获取所述当前触摸坐标与前一个触摸坐标之间的差值作为目标差值;如果所述目标差值大于指定阈值,上报包括所述当前触摸坐标的触摸事件信息。
进一步的,该触摸事件的处理装置400还可以包括第一禁止模块。第一禁止模块可以用于在所述获取与所述当前触摸坐标相邻的前一个触摸坐标之间的差值作为目标差值之后,如果所述目标差值小于或等于所述指定阈值,则不上报包括所述当前触摸坐标的触摸事件信息。
在一些实施方式中,第二上报模块440可以具体用于:如果当前触摸坐标与所述起始触摸坐标之间的差值大于所述上报阈值,且所述使用场景为第二使用场景时,获取所述当前触摸坐标对应的检测时刻与前一个触摸坐标对应的检测时刻之间的时间间隔;如果所述时间间隔小于指定间隔,上报包括所述当前触摸坐标的触摸事件信息。
进一步的,该触摸事件的处理装置400还可以包括第二禁止模块。第二禁止模块可以用于在所述获取所述当前触摸坐标对应的检测时刻与前一个触摸坐标对应的检测时刻之间的时间间隔之后,如果所述时间间隔大于或等于所述指定间隔,则不上报包括所述当前触摸坐标的触摸事件信息。
在一些实施方式中,场景检测模块420可以包括应用获取单元以及场景确定单元。应用获取单元用于获取所述移动终端中当前运行的应用;第一场景确定单元用于根据所述当前运行的应用,确定所述移动终端当前所处的使用场景。
作为一种方式,第一场景确定单元可以具体用于:确定所述当前运行的应用中处于前台运行的应用;判断所述前台运行的应用是否处于预设名单中;如果处于所述预设名单中,则确定所述移动终端处于第一使用场景;如果未处于所述预设名单中,则确定所述移动终端处于第二使用场景。
作为另一种方式,第一场景确定单元可以具体用于:确定所述当前运行的应用中处于前台运行的应用;判断所述前台运行的应用的类型是否为设定类型;如果为设定类型,则确定所述移动终端处于第一使用场景;如果不为设定类型,则确定所述移动终端处于第二使用场景。
在一些实施方式中,场景检测模块也可以包括:显示状态确定单元以及第二场景确定单元。显示状态确定单元用于获取所述移动终端当前的屏幕显示状态;第二场景确定单元用于根据所述屏幕显示状态,确定所述移动终端当前所处的使用场景。
进一步的,第二场景确定单元可以具体用于:如果所述屏幕显示状态为横屏状态,则确定所述移动终端处于第一使用场景;如果所述屏幕显示状态为竖屏状态,则确定所述移动终端处于第二使用场景。
在一些实施方式中,事件上报模块430可以包括坐标获取单元、阈值增加单元以及上报执行单元。坐标获取单元用于当检测到对所述触摸屏的触摸事件时,获取所述触摸事件对应的起始触摸坐标;阈值增加单元用于当所述触摸坐标处于预设坐标范围时,将所述上报阈值增大为设定阈值;上报执行单元用于根据所述设定阈值控制触摸事件信息的上报。
在该实施方式下,上报执行单元还可以用于:当所述触摸坐标未处于预设坐标范围时,根据所述上报阈值控制触摸事件信息的上报。
进一步的,该触摸事件的处理装置400还可以包括触摸坐标获取模块,用于在所述如果当前触摸坐标与所述起始触摸坐标之间的差值大于所述上报阈值,上报包括所述当前触摸坐标的触摸事件信息之前,按照第一预设频率获取当前触摸坐标。
该实施方式下,事件上报模块430还可以用于:当连续多次检测到所述差值小于或者等于所述上报阈值时,将所述第一预设频率增大为第二预设频率。
在一些实施方式中,该触摸事件的处理装置400还可以包括:运动检测模块以及阈值调整模块。运动检测模块用于检测所述移动终端的运动状态;阈值调整模块用于 如果所述运动状态满足设定状态条件时,增大所述上报阈值。
作为一种方式,所述运动状态包括晃动状态。阈值调整模块可以具体用于:确定所述晃动状态对应的晃动幅度;如果所述晃动幅度大于设定幅度,则增大所述上报阈值。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述装置和模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,模块相互之间的耦合可以是电性,机械或其它形式的耦合。
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
综上所述,本申请提供的方案,通过检测移动终端当前说出的使用场景,确定与使用场景对应的上报阈值,在确定上报阈值后,当检测到触摸事件时,上报包括起始触摸坐标的触摸事件信息,在持续检测到触摸事件时,如果当前触摸坐标与起始触摸坐标之间的差值大于上报阈值,上报包括当前触摸坐标的触摸事件信息,从而实现移动终端根据与使用场景对应的上报阈值,在触摸事件发生时的触摸事件信息上报过程中,控制触摸事件信息的上报,避免滑动事件的误触发,并且也可以快速响应需求场景下的滑动事件。
请参考图9,其示出了本申请实施例提供的一种移动终端的结构框图。该移动终端100可以是智能手机、平板电脑、电子书、智能手表等能够运行应用程序的电子设备。本申请中的移动终端100可以包括一个或多个如下部件:处理器110、存储器120、触摸屏130以及一个或多个应用程序,其中一个或多个应用程序可以被存储在存储器120中并被配置为由一个或多个处理器110执行,一个或多个程序配置用于执行如前述方法实施例所描述的方法。
处理器110可以包括一个或者多个处理核。处理器110利用各种接口和线路连接整个移动终端100内的各个部分,通过运行或执行存储在存储器120内的指令、程序、代码集或指令集,以及调用存储在存储器120内的数据,执行移动终端100的各种功能和处理数据。可选地,处理器110可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器110可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器110中,单独通过一块通信芯片进行实现。
存储器120可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。存储器120可用于存储指令、程序、代码、代码集或指令集。存储器120可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等。存储数据区还可以存储终端100在使用中所创建的数据(比如电话本、音视频数据、聊天记录数据)等。
触摸屏130可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在所述触摸屏130上或在所述触摸屏130附近的操作),并根据预先设定的程序驱动相应的连接装置。可选的,所述触摸屏130可包括触摸检测装置和触摸控制器。其中,所述触摸检测装置检测用户的触摸方位,并检测触摸操作带来 的信号,将信号传送给所述触摸控制器;所述触摸控制器从所述触摸检测装置上接收触摸信息,并将该触摸信息转换成触点坐标,再送给所述处理器110,并能接收所述处理器110发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现所述触摸屏130的触摸检测功能。
请参考图10,其示出了本申请实施例提供的一种计算机可读存储介质的结构框图。该计算机可读介质800中存储有程序代码,所述程序代码可被处理器调用执行上述方法实施例中所描述的方法。
计算机可读存储介质800可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读存储介质800包括非易失性计算机可读介质(non-transitory computer-readable storage medium)。计算机可读存储介质800具有执行上述方法中的任何方法步骤的程序代码810的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码810可以例如以适当形式进行压缩。
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。

Claims (20)

  1. 一种触摸事件的处理方法,其特征在于,应用于移动终端,所述移动终端包括触摸屏,所述方法包括:
    检测所述移动终端当前所处的使用场景;
    确定与所述使用场景对应的上报阈值;
    当检测到触摸事件时,上报包括起始触摸坐标的触摸事件信息;
    在持续检测到触摸事件时,如果当前触摸坐标与所述起始触摸坐标之间的差值大于所述上报阈值,上报包括所述当前触摸坐标的触摸事件信息。
  2. 根据权利要求1所述的方法,其特征在于,其中,所述使用场景包括第一使用场景以及第二使用场景,所述第一使用场景下的滑动操作的优先级高于所述第二使用场景下的滑动操作的优先级,所述确定与所述使用场景对应的上报阈值,包括:
    如果所述使用场景为第一使用场景,确定所述上报阈值为第一阈值;
    如果所述使用场景为第二使用场景,确定所述上报阈值为第二阈值,其中,所述第一阈值小于所述第二阈值。
  3. 根据权利要求2所述的方法,其特征在于,如果当前触摸坐标与所述起始触摸坐标之间的差值大于所述上报阈值,上报包括所述当前触摸坐标的触摸事件信息,包括:
    如果当前触摸坐标与所述起始触摸坐标之间的差值大于所述上报阈值,且所述使用场景为第二使用场景时,获取所述当前触摸坐标与前一个触摸坐标之间的差值作为目标差值;
    如果所述目标差值大于指定阈值,上报包括所述当前触摸坐标的触摸事件信息。
  4. 根据权利要求3所述的方法,其特征在于,在所述获取与所述当前触摸坐标相邻的前一个触摸坐标之间的差值作为目标差值之后,所述方法还包括:
    如果所述目标差值小于或等于所述指定阈值,则不上报包括所述当前触摸坐标的触摸事件信息。
  5. 根据权利要求2所述的方法,其特征在于,如果当前触摸坐标与所述起始触摸坐标之间的差值大于所述上报阈值,上报包括所述当前触摸坐标的触摸事件信息,包括:
    如果当前触摸坐标与所述起始触摸坐标之间的差值大于所述上报阈值,且所述使用场景为第二使用场景时,获取所述当前触摸坐标对应的检测时刻与前一个触摸坐标对应的检测时刻之间的时间间隔;
    如果所述时间间隔小于指定间隔,上报包括所述当前触摸坐标的触摸事件信息。
  6. 根据权利要求5所述的方法,其特征在于,在所述获取所述当前触摸坐标对应的检测时刻与前一个触摸坐标对应的检测时刻之间的时间间隔之后,所述方法还包括:
    如果所述时间间隔大于或等于所述指定间隔,则不上报包括所述当前触摸坐标的触摸事件信息。
  7. 根据权利要求2所述的方法,其特征在于,所述检测所述移动终端当前所处的使用场景,包括:
    获取所述移动终端中当前运行的应用;
    根据所述当前运行的应用,确定所述移动终端当前所处的使用场景。
  8. 根据权利要求7所述的方法,其特征在于,所述根据所述当前运行的应用,确定所述移动终端当前所处的使用场景,包括:
    确定所述当前运行的应用中处于前台运行的应用;
    判断所述前台运行的应用是否处于预设名单中;
    如果处于所述预设名单中,则确定所述移动终端处于第一使用场景;
    如果未处于所述预设名单中,则确定所述移动终端处于第二使用场景。
  9. 根据权利要求7所述的方法,其特征在于,所述根据所述当前运行的应用,确定所述移动终端当前所处的使用场景,包括:
    确定所述当前运行的应用中处于前台运行的应用;
    判断所述前台运行的应用的类型是否为设定类型;
    如果为设定类型,则确定所述移动终端处于第一使用场景;
    如果不为设定类型,则确定所述移动终端处于第二使用场景。
  10. 根据权利要求2所述的方法,其特征在于,所述检测所述移动终端当前所处的使用场景,包括:
    获取所述移动终端当前的屏幕显示状态;
    根据所述屏幕显示状态,确定所述移动终端当前所处的使用场景。
  11. 根据权利要求10所述的方法,其特征在于,所述根据所述屏幕显示状态,确定所述移动终端当前所处的使用场景,包括:
    如果所述屏幕显示状态为横屏状态,则确定所述移动终端处于第一使用场景;
    如果所述屏幕显示状态为竖屏状态,则确定所述移动终端处于第二使用场景。
  12. 根据权利要求1-11任一项所述的方法,其特征在于,所述根据所述上报阈值,控制触摸事件发生时的触摸事件信息的上报,包括:
    当检测到对所述触摸屏的触摸事件时,获取所述触摸事件对应的起始触摸坐标;
    当所述触摸坐标处于预设坐标范围时,将所述上报阈值增大为设定阈值;
    根据所述设定阈值控制触摸事件信息的上报。
  13. 根据权利要求12所述的方法,其特征在于,所述根据所述上报阈值,控制触摸事件发生时的触摸事件信息的上报,还包括:
    当所述触摸坐标未处于预设坐标范围时,根据所述上报阈值控制触摸事件信息的上报。
  14. 根据权利要求1-13任一项所述的方法,其特征在于,在所述如果当前触摸坐标与所述起始触摸坐标之间的差值大于所述上报阈值,上报包括所述当前触摸坐标的触摸事件信息之前,所述方法还包括:
    按照第一预设频率获取当前触摸坐标。
  15. 根据权利要求14所述的方法,其特征在于,所述方法还包括:
    当连续多次检测到所述差值小于或者等于所述上报阈值时,将所述第一预设频率增大为第二预设频率。
  16. 根据权利要求1-15任一项所述的方法,其特征在于,所述方法还包括:
    检测所述移动终端的运动状态;
    如果所述运动状态满足设定状态条件时,增大所述上报阈值。
  17. 根据权利要求16所述的方法,其特征在于,所述运动状态包括晃动状态,所述如果所述运动状态满足设定状态条件时,增大所述上报阈值,包括:
    确定所述晃动状态对应的晃动幅度;
    如果所述晃动幅度大于设定幅度,则增大所述上报阈值。
  18. 一种触摸事件的处理装置,其特征在于,应用于移动终端,所述移动终端包括触摸屏,所述装置包括:场景检测模块、阈值确定模块、第一上报模块以及第二上报模块,其中,
    所述场景检测模块用于检测所述移动终端当前所处的使用场景;
    所述阈值确定模块用于确定与所述使用场景对应的上报阈值;
    所述第一上报模块用于当检测到触摸事件时,上报包括起始触摸坐标的触摸事件信息;
    所述第二上报模块用于在持续检测到触摸事件时,如果当前触摸坐标与所述起始 触摸坐标之间的差值大于所述上报阈值,上报包括所述当前触摸坐标的触摸事件信息。
  19. 一种移动终端,其特征在于,包括:
    一个或多个处理器;
    存储器;
    一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行如权利要求1-17任一项所述的方法。
  20. 一种计算机可读取存储介质,其特征在于,所述计算机可读取存储介质中存储有程序代码,所述程序代码可被处理器调用执行如权利要求1-17任一项所述的方法。
PCT/CN2019/117605 2019-11-12 2019-11-12 触摸事件的处理方法、装置、移动终端及存储介质 WO2021092768A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201980100129.0A CN114341784A (zh) 2019-11-12 2019-11-12 触摸事件的处理方法、装置、移动终端及存储介质
PCT/CN2019/117605 WO2021092768A1 (zh) 2019-11-12 2019-11-12 触摸事件的处理方法、装置、移动终端及存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/117605 WO2021092768A1 (zh) 2019-11-12 2019-11-12 触摸事件的处理方法、装置、移动终端及存储介质

Publications (1)

Publication Number Publication Date
WO2021092768A1 true WO2021092768A1 (zh) 2021-05-20

Family

ID=75911300

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/117605 WO2021092768A1 (zh) 2019-11-12 2019-11-12 触摸事件的处理方法、装置、移动终端及存储介质

Country Status (2)

Country Link
CN (1) CN114341784A (zh)
WO (1) WO2021092768A1 (zh)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114115673A (zh) * 2021-11-25 2022-03-01 海信集团控股股份有限公司 车载屏幕的控制方法
CN114363049A (zh) * 2021-12-30 2022-04-15 武汉杰创达科技有限公司 基于个性化交互差异的物联设备多id识别方法
CN114995674A (zh) * 2021-09-14 2022-09-02 荣耀终端有限公司 边缘误触的检测方法、电子设备和计算机可读存储介质
CN116204366A (zh) * 2023-05-06 2023-06-02 深圳卓创智能科技有限公司 平板电脑质量检测方法、装置、设备及存储介质
CN116521018A (zh) * 2023-07-04 2023-08-01 荣耀终端有限公司 误触提示方法、终端设备及存储介质
CN117234825A (zh) * 2023-11-10 2023-12-15 江苏纳帝电子科技有限公司 一种中大尺寸触摸屏触摸性能智能测试系统

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20100093999A (ko) * 2009-02-18 2010-08-26 주식회사 엘지유플러스 터치형 단말기의 터치 민감도 조절 방법 및 그 시스템
US20120268378A1 (en) * 2011-04-22 2012-10-25 Sony Ericsson Mobile Communication Japan, Inc. Information processing apparatus
CN106791005A (zh) * 2016-11-28 2017-05-31 努比亚技术有限公司 移动终端及边缘手势防误触方法
CN108111689A (zh) * 2017-12-26 2018-06-01 深圳市万普拉斯科技有限公司 压力触控的动态调节方法、装置及移动终端
CN108733427A (zh) * 2018-03-13 2018-11-02 广东欧珀移动通信有限公司 输入组件的配置方法、装置、终端及存储介质
CN110045908A (zh) * 2019-03-18 2019-07-23 华为技术有限公司 一种控制方法和电子设备
CN110275636A (zh) * 2019-06-11 2019-09-24 广州小鹏汽车科技有限公司 一种触控防抖方法、装置、系统、终端设备及车辆

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20100093999A (ko) * 2009-02-18 2010-08-26 주식회사 엘지유플러스 터치형 단말기의 터치 민감도 조절 방법 및 그 시스템
US20120268378A1 (en) * 2011-04-22 2012-10-25 Sony Ericsson Mobile Communication Japan, Inc. Information processing apparatus
CN106791005A (zh) * 2016-11-28 2017-05-31 努比亚技术有限公司 移动终端及边缘手势防误触方法
CN108111689A (zh) * 2017-12-26 2018-06-01 深圳市万普拉斯科技有限公司 压力触控的动态调节方法、装置及移动终端
CN108733427A (zh) * 2018-03-13 2018-11-02 广东欧珀移动通信有限公司 输入组件的配置方法、装置、终端及存储介质
CN110045908A (zh) * 2019-03-18 2019-07-23 华为技术有限公司 一种控制方法和电子设备
CN110275636A (zh) * 2019-06-11 2019-09-24 广州小鹏汽车科技有限公司 一种触控防抖方法、装置、系统、终端设备及车辆

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114995674A (zh) * 2021-09-14 2022-09-02 荣耀终端有限公司 边缘误触的检测方法、电子设备和计算机可读存储介质
CN114995674B (zh) * 2021-09-14 2023-06-13 荣耀终端有限公司 边缘误触的检测方法、电子设备和计算机可读存储介质
CN114115673A (zh) * 2021-11-25 2022-03-01 海信集团控股股份有限公司 车载屏幕的控制方法
CN114115673B (zh) * 2021-11-25 2023-10-27 海信集团控股股份有限公司 车载屏幕的控制方法
CN114363049A (zh) * 2021-12-30 2022-04-15 武汉杰创达科技有限公司 基于个性化交互差异的物联设备多id识别方法
CN116204366A (zh) * 2023-05-06 2023-06-02 深圳卓创智能科技有限公司 平板电脑质量检测方法、装置、设备及存储介质
CN116204366B (zh) * 2023-05-06 2023-08-11 深圳卓创智能科技有限公司 平板电脑质量检测方法、装置、设备及存储介质
CN116521018A (zh) * 2023-07-04 2023-08-01 荣耀终端有限公司 误触提示方法、终端设备及存储介质
CN116521018B (zh) * 2023-07-04 2023-10-20 荣耀终端有限公司 误触提示方法、终端设备及存储介质
CN117234825A (zh) * 2023-11-10 2023-12-15 江苏纳帝电子科技有限公司 一种中大尺寸触摸屏触摸性能智能测试系统
CN117234825B (zh) * 2023-11-10 2024-01-30 江苏纳帝电子科技有限公司 一种中大尺寸触摸屏触摸性能智能测试系统

Also Published As

Publication number Publication date
CN114341784A (zh) 2022-04-12

Similar Documents

Publication Publication Date Title
WO2021092768A1 (zh) 触摸事件的处理方法、装置、移动终端及存储介质
US20230259231A1 (en) Method and apparatus for a touch display
EP2680110B1 (en) Method and apparatus for processing multiple inputs
US10761722B2 (en) Black screen gesture detection method and device, storage medium, and mobile terminal
US20230021260A1 (en) Gesture instruction execution method and apparatus, system, and storage medium
WO2016165066A1 (zh) 一种手势控制方法、装置、终端设备和存储介质
WO2019218886A1 (zh) 应用预加载管理方法、装置、存储介质及智能终端
EP3435215B1 (en) Method, device, storage medium and mobile terminal for recognizing an off-screen gesture
CN111026464A (zh) 一种识别方法及电子设备
US20220083189A1 (en) Display method and terminal device
WO2020098605A1 (zh) 菜单显示方法、装置、设备及存储介质
WO2019019818A1 (zh) 加快黑屏手势处理的方法、装置、存储介质及移动终端
WO2021121225A1 (zh) 应用程序安装方法及电子设备
CN111338525A (zh) 一种电子设备的控制方法及电子设备
US11526320B2 (en) Multi-screen interface control method and terminal device
CN112199005A (zh) 内容显示方法、装置、存储介质及移动终端
CN111596836A (zh) 一种分屏显示方法及电子设备
WO2021068112A1 (zh) 触摸事件的处理方法、装置、移动终端及存储介质
WO2019024507A1 (zh) 一种触摸控制方法、装置及终端
CN113093961A (zh) 窗口切换方法、存储介质及相关设备
CN114968010A (zh) 协处理芯片的启动方法、装置、存储介质及电子装置
WO2016018331A1 (en) Cursor locator
CN110874141A (zh) 图标移动的方法及终端设备
WO2023016193A1 (zh) 设备控制方法、装置、电子设备以及存储介质
WO2018140292A1 (en) Capturing pen input by a pen-aware shell

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19952609

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19952609

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 31.10.2022)

122 Ep: pct application non-entry in european phase

Ref document number: 19952609

Country of ref document: EP

Kind code of ref document: A1