Touch event processing method and device, equipment and storage medium

By detecting the touch event in the user interface and determining the response relationship of the view node, identify and execute the scheduled gesture, solve the problem of the traditional touch technology when coordinating the interaction of various gestures, and realize the high accuracy interactive experience and cross -operating operating system system. Interaction consistency.

CN119376608AActive Publication Date: 2025-01-28BEIJING ZITIAO NETWORK TECH CO LTD

Patent Information

Application Number
CN202411515622.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-01-28
Estimated Expiration
2044-10-28

AI Technical Summary

Technical Problem

Traditional touch technology is prone to conflict when coordinating the interaction of multiple gestures, affecting the accuracy of operations and interactive experience. At the same time, there are differences in the processing logic of touch events in different operating systems, resulting in different interaction methods of the same application on different operating systems. .

Method used

By detecting the touch event of the user interface, determine the candidate view node associated with the event from multiple view nodes, and determine its response relationship based on the associated relationship between the candidate view node. Then, the corresponding operation of the corresponding scheduled gesture based on the touch event identification and perform the corresponding operation through the target view node.

Benefits of technology

Effectively avoid gesture conflict, ensure the accuracy of gesture recognition and response, and realize the consistency of interactive methods of cross -operating system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119376608A_ABST
    Figure CN119376608A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a touch event processing method and device, equipment and a storage medium. The method comprises the steps that a detected touch event on a user interface is responded, at least one candidate view node associated with the touch event is determined from multiple view nodes of the user interface, and the at least one candidate view node is provided with a corresponding preset gesture; determining a response relationship of the at least one candidate view node to the touch event based on an association relationship between the at least one candidate view node; according to the response relationship, identifying a corresponding predetermined gesture for a candidate view node in the at least one candidate view node based on the touch event; and in response to a corresponding predetermined gesture identified for a target view node in the at least one candidate view node, executing a corresponding target operation based on the touch event through the target view node.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Example embodiments of the present disclosure generally relate to the computer field, and more particularly, to a touch event processing method, apparatus, device, computer-readable storage medium, and computer program product. Background Art

[0002] With the development of computer technology, touch screen technology has been widely used in various electronic devices. Not only are various mobile terminal devices equipped with touch screens, but also display devices of many sizes, fixed terminal devices, household appliances, etc. are also equipped with touch screens. Users can flexibly operate these electronic devices through a variety of gestures such as clicking, long pressing, dragging, inertial sliding, etc. However, the performance of traditional touch technology in coordinating multiple gestures still needs to be improved. Summary of the invention

[0003] In a first aspect of the present disclosure, a touch event processing method is provided. The method includes: in response to detecting a touch event on a user interface, determining at least one candidate view node associated with the touch event from multiple view nodes of the user interface, wherein the at least one candidate view node has a corresponding predetermined gesture; based on the association relationship between the at least one candidate view node, determining the response relationship of the at least one candidate view node to the touch event; according to the response relationship, identifying a corresponding predetermined gesture for a candidate view node in the at least one candidate view node based on the touch event; and in response to identifying a corresponding predetermined gesture for a target view node in the at least one candidate view node, performing a corresponding target operation based on the touch event through the target view node.

[0004] In a second aspect of the present disclosure, a device for handling touch events is provided. The device includes: a response module, configured to respond to the detection of a touch event on a user interface, determine at least one candidate view node associated with the touch event from multiple view nodes of the user interface, and at least one candidate view node has a corresponding predetermined gesture; a determination module, configured to determine the response relationship of at least one candidate view node to the touch event based on the association relationship between at least one candidate view node; an identification module, configured to identify the corresponding predetermined gesture for a candidate view node in at least one candidate view node based on the touch event according to the response relationship; and an execution module, configured to respond to the identification of the corresponding predetermined gesture for a target view node in at least one candidate view node, and execute the corresponding target operation based on the touch event through the target view node.

[0005] In a third aspect of the present disclosure, an electronic device is provided. The device includes at least one processing unit; and at least one memory, the at least one memory is coupled to the at least one processing unit and stores instructions for execution by the at least one processing unit. When the instructions are executed by the at least one processing unit, the device executes the method of the first aspect.

[0006] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein a computer program is stored on the computer-readable storage medium, and the computer program can be executed by a processor to implement the method of the first aspect.

[0007] In a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the method according to the first aspect of the present disclosure is implemented.

[0008] It should be understood that the contents described in this content section are not intended to limit the key features or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:

[0010] Figure 1 A schematic diagram showing an example environment in which embodiments according to the present disclosure may be implemented;

[0011] Figure 2 A flowchart showing a process of touch event processing according to some embodiments of the present disclosure is shown;

[0012] FIG. 3A to FIG. 6C Schematic diagrams respectively showing examples of user interfaces according to some embodiments of the present disclosure;

[0013] Figure 7 and Figure 8 Schematic diagrams showing examples of response flow graphs according to some embodiments of the present disclosure are shown respectively;

[0014] Fig. 9 A schematic structural block diagram showing an example apparatus for touch event processing according to some embodiments of the present disclosure; and

[0015] Fig.10 A block diagram of an electronic device capable of implementing various embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0016] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0017] It should be noted that the titles of any sections / subsections provided herein are not restrictive. Various embodiments are described throughout this article, and any type of embodiment may be included under any section / subsection. In addition, the embodiments described in any section / subsection may be combined in any manner with any other embodiments described in the same section / subsection and / or different sections / subsections.

[0018] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The term "some embodiments" should be understood as "at least some embodiments". Other explicit and implicit definitions may be included below. The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may be included below.

[0019] The embodiments of the present disclosure may involve user data, data acquisition and / or use, etc. These aspects are subject to the corresponding laws, regulations and relevant provisions. In the embodiments of the present disclosure, all data collection, acquisition, processing, processing, forwarding, use, etc. are carried out on the premise that the user knows and confirms. Accordingly, when implementing each embodiment of the present disclosure, the type, scope of use, usage scenario, etc. of the data or information that may be involved should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with the relevant laws and regulations. The specific notification and / or authorization method can vary according to the actual situation and application scenario, and the scope of the present disclosure is not limited in this respect.

[0020] In this specification and the embodiments, if personal information processing is involved, it will be processed on the premise of having a legal basis (such as obtaining the consent of the subject of personal information, or it is necessary to perform a contract, etc.), and will only be processed within the scope of regulations or agreements. If a user refuses to process personal information other than the necessary information for basic functions, it will not affect the user's use of basic functions.

[0021] As mentioned above, with the development of computer technology, touch screen technology has been widely used in various electronic devices. Not only are various mobile terminal devices equipped with touch screens, but also display devices of many sizes, fixed terminal devices, household appliances, etc. are also equipped with touch screens. Users can flexibly operate these electronic devices through a variety of gestures such as clicking, long pressing, dragging, inertial sliding, etc. However, on the one hand, in the scenario of coordinating the interaction of multiple gestures, traditional touch technology is prone to conflicts between multiple gestures, affecting the accuracy of touch operations and interactive experience. On the other hand, traditional touch technology relies on the operating system to process and distribute touch events. Due to the differences in the processing logic of touch events in different operating systems, the interaction methods of the same application on different operating systems are different.

[0022] An embodiment of the present disclosure proposes an improved scheme for handling touch events. In the scheme, in response to detecting a touch event on a user interface, at least one candidate view node associated with the touch event is determined from multiple view nodes of the user interface. The at least one candidate view node has a corresponding predetermined gesture. Based on the association relationship between at least one candidate view node, the response relationship of at least one candidate view node to the touch event is determined. According to the response relationship, a corresponding predetermined gesture is identified for a candidate view node in at least one candidate view node based on the touch event. If a target view node in the at least one candidate view node identifies the corresponding predetermined gesture, a corresponding target operation is performed based on the touch event through the target view node.

[0023] In this way, the embodiment of the present disclosure allocates touch events to view nodes according to the response relationship between view nodes of the user interface to touch events. In this way, it can be ensured that each view node can perform gesture recognition and gesture response according to the response relationship, thereby avoiding gesture conflicts. In addition, the embodiment of the present disclosure does not rely on the operating system to process and allocate touch events. For the same application, even if it is deployed on different operating systems, the consistency of interaction mode can be achieved.

[0024] Various example implementations of the solution are described in detail below in conjunction with the accompanying drawings.

[0025] Example Environment

[0026] Figure 1 A schematic diagram of an example environment 100 in which embodiments of the present disclosure can be implemented is shown. In the example environment 100, an application 120 is installed in a terminal device 110. A user 140 can interact with the application 120 via the terminal device 110 and / or an attached device of the terminal device 110.

[0027] In the embodiments of the present disclosure, the application 120 may be any appropriate application, and the embodiments of the present disclosure do not limit the functions of the application 120 and the service content provided. Figure 1 In the environment, if the application 120 is in an active state, the terminal device 110 can present an interface 150 of the application 120. The interface 150 can include various interfaces that the application 120 can provide.

[0028] In some embodiments, the terminal device 110 communicates with the server device 130 to provide services for the application 120. The terminal device 110 can be any type of mobile terminal, fixed terminal or portable terminal, including a mobile phone, a desktop computer, a laptop computer, a notebook computer, a netbook computer, a tablet computer, a media computer, a multimedia tablet, a personal communication system (PCS) device, a personal navigation device, a personal digital assistant (PDA), an audio / video player, a digital camera / camcorder, a positioning device, a television receiver, a radio broadcast receiver, an e-book device, a gaming device, or any combination of the foregoing, including accessories and peripherals of these devices or any combination thereof. In some embodiments, the terminal device 110 can also support any type of interface for the user (such as a "wearable" circuit, etc.). The server device 130 can be various types of computing systems / servers that can provide computing capabilities, including but not limited to mainframes, edge computing nodes, computing devices in cloud environments, and the like.

[0029] It should be understood that the structure and function of the various elements in the environment 100 are described for exemplary purposes only and do not imply any limitation on the scope of the present disclosure.

[0030] Some example embodiments of the present disclosure will be described below with continued reference to the accompanying drawings.

[0031] Example Process

[0032] Figure 2 FIG. 2 is a flow chart showing a process 200 of touch event processing according to some embodiments of the present disclosure. Figure 1 The environment 100 in the embodiment of the present disclosure is described from the perspective of the terminal device 110, but this is only exemplary. In some embodiments, the actions described with respect to the terminal device can be completed by the terminal device coordinating with the service end.

[0033] In box 210 of process 200, in response to detecting a touch event on a user interface, the terminal device 110 determines at least one candidate view node associated with the touch event from a plurality of view nodes of the user interface. The user interface may be an interface 150 of an application 120 running on the terminal device 110, or may be other interfaces of the terminal device 110. A view node is a component unit or component element of a user interface, and a user interface may include a plurality of view nodes. A view node may include visible elements in a user interface, such as options, buttons, text, images, and the like. A view node may also include invisible elements in a user interface, such as containers, frames, and the like.

[0034] A touch event may include an event in which a touch input source (e.g., a finger or a stylus, etc.) detected by the touch screen or the touch sensor contacts the touch screen. In some embodiments, the touch event may include at least one of the following: a touch down sub-event, a touch move sub-event, a touch end sub-event, or a touch cancel sub-event. For a touch start sub-event, the terminal device 110 may trigger a touch start sub-event in response to detecting that the touch input source contacts the touch screen. For a touch move sub-event, the terminal device 110 may continuously trigger a touch move sub-event in response to detecting that one or more touch points continue to move on the touch screen. For a touch end sub-event, the terminal device 110 may trigger a touch end sub-event in response to detecting that the touch input source is out of contact with the touch screen. For a touch cancel sub-event, the terminal device 110 may trigger a touch cancel sub-event in response to a touch being interrupted and not ending normally (e.g., a touch interruption caused by other system events). In some embodiments, in response to detecting a touch start sub-event on the user interface, the terminal device 110 may determine at least one candidate view node related to the touch start sub-event from a plurality of view nodes of the user interface.

[0035] The at least one candidate view node has a corresponding predetermined gesture. In some embodiments, the predetermined gesture may include at least one of the following: a tap gesture, a long press gesture, a pan gesture, or a fling gesture. A tap gesture refers to a gesture in which the touch input source is in short contact with the touch screen (for example, the contact time does not exceed the first time threshold). A long press gesture refers to a gesture in which the touch input source is in long contact with the touch screen (for example, the contact time exceeds the second time threshold) and does not move (for example, the distance between the position of the touch start sub-event and the position of the touch end sub-event is less than the displacement threshold). The first time threshold and the second time threshold may be the same, or the second time threshold may be greater than the first time threshold. A fling gesture is a continuous gesture that can identify the dragging behavior of the touch input source on the screen. The terminal device 110 may determine that a drag gesture is detected in response to the touch input source being in continuous contact with the touch screen and the touch input source moving a first predetermined distance. For a fling gesture, the terminal device 110 may determine that a fling gesture is detected in response to the touch input source moving a second predetermined distance on the touch screen and the moving speed of the touch input source when it is out of contact with the touch screen is greater than the speed threshold. In some embodiments, a candidate view node can be bound to an event recognizer, and the event recognizer can be configured to recognize a predetermined gesture of the bound view node based on a touch event.

[0036] In some embodiments, the view node associated with the touch event may include a view node having a position correlation with the touch event and an execution logic correlation. In some embodiments, the terminal device 110 may determine the view node selected by the touch event and the view hierarchy structure of multiple view nodes in response to detecting a touch event on the user interface. Afterwards, the terminal device 110 may determine at least one candidate view node based on the position of the view node selected by the touch event in the view hierarchy structure. Exemplarily, the terminal device 110 may determine the touch position of the touch start sub-event in response to detecting a touch start sub-event. Based on the touch position, determine the view node selected by the touch start sub-event. The terminal device 110 may also obtain the execution scripts of multiple view nodes of the user interface, and determine the view hierarchy structure of multiple view nodes based on the execution scripts of the multiple view nodes. Afterwards, the terminal device 110 may determine at least one candidate view node related to the touch start sub-event based on the position of the view node selected by the touch start sub-event in the view hierarchy structure. For example, the terminal device 110 may determine the path between the view node selected by the touch start sub-event and the root node of the view hierarchy structure in the view hierarchy structure. A view node located on the path and bound with an event identifier is determined as at least one candidate view node related to the touch event.

[0037] In some embodiments, the event recognizer may have at least one of the following states: an undefined state, a start state, an active state, a failed state, or an end state. The undefined state may be the initial state of the event recognizer. The undefined state indicates that the event recognizer has not performed a predetermined gesture recognition. The start state indicates that the event recognizer is performing gesture recognition, but does not indicate whether the gesture recognition is successful or failed. The active state indicates that the event recognizer recognizes a predetermined gesture, and the event recognizer performs an operation corresponding to the predetermined gesture in response to recognizing a predetermined finger, for example, in response to recognizing a predetermined gesture based on a touch event, the operation corresponding to the predetermined gesture is performed through a callback. The failed state indicates that the event recognizer fails to recognize the predetermined gesture. An event recognizer in a failed state may have been in an active state, but has currently switched to a failed state, for example, a drag gesture is recognized based on a touch event, but the current touch input source has been out of contact with the touch screen, and the touch event is switched to a failed state. The end state indicates that the processing and response to the touch event are terminated. It should be noted that the state of the event recognizer here may also be referred to as the state of the predetermined gesture corresponding to the event recognizer.

[0038] In block 220 of process 200, terminal device 110 determines a response relationship of at least one candidate view node to a touch event based on an association relationship between at least one candidate view node. The response relationship of at least one candidate view node to a touch event may include, but is not limited to, a delivery relationship, a collaboration relationship, a waiting relationship, a continuation relationship, and a competition relationship of at least one candidate view node to a touch event.

[0039] In some embodiments, the terminal device 110 may determine a hierarchical relationship between at least one candidate view node based on a view hierarchy of multiple view nodes. The terminal device 110 may determine a response relationship based on the hierarchical relationship between the at least one candidate view node. Alternatively or additionally, the transfer relationship of the at least one candidate view node in a predetermined direction of the view hierarchy may be determined as a response relationship of the at least one candidate view node to a touch event. The predetermined direction may be a direction from the view node selected by the touch event to the root node of the view hierarchy.

[0040] As an example, an example of a Document Object Model (DOM) of a user interface is shown in the following table.

[0041] Table 1

[0042]

[0043] As can be seen from the above table, the DOM structure includes three view nodes, namely, the list "list", the scroll view "scroll-view" and the internal view "view-inner", and the list "list", the scroll view "scroll-view" and the internal view "view-inner" are bound to the event identifiers "panA", "panB" and "panC" respectively. The hierarchical relationship of these three view nodes is that the list "list" is located in the innermost layer, the scroll view "scroll-view" is the parent node of the list "list", and the internal view "view-inner" is the root node. On this basis, the terminal device 110 can determine that the response relationship of the three view nodes to touch events includes the list "list", the scroll view "scroll-view", and the internal view "view-inner" responding to touch events in sequence.

[0044] In some embodiments, the terminal device 110 may obtain at least one execution script corresponding to at least one candidate view node. The execution script in the at least one execution script includes an event identifier of the corresponding candidate view node, and the event identifier is configured to identify a predetermined gesture of the corresponding candidate view node based on a touch event. The terminal device 110 may determine the response relationship of at least one candidate view node to a touch event based on the interaction relationship between the respective event identifiers of the at least one candidate view node. Additionally, the interaction relationship between the event identifiers of the at least one candidate view node may include, but is not limited to, a collaborative relationship, a waiting relationship, a continuation relationship, a competitive relationship, and the like. The collaborative relationship may include a collaborative relationship between multiple event identifiers of the same view node and a collaborative relationship between event identifiers of different view nodes.

[0045] Multiple event recognizers on the same view node and in a collaborative relationship can be active at the same time, that is, one event recognizer being active will not cause another event recognizer to switch to a failed state. FIG. 3A to FIG. 3C An exemplary introduction is given to the system relationship between multiple event recognizers of the same view node. FIG. 3A to FIG. 3CSchematic diagrams of examples 300A to 300C of user interfaces according to some embodiments of the present disclosure are shown. In the user interfaces of examples 300A to 300C, view node 301 and touch input source 302 (e.g., finger) are shown. View node 301 may be bound with an event recognizer for recognizing a long press gesture and an event recognizer for recognizing a drag gesture, and the two event recognizers may be configured to have a collaborative relationship. Touch input source 302 long presses view node 301, and the event recognizer for recognizing a long press gesture switches to an activated state based on the touch event recognition of the long press gesture, for example, switching from the state shown in example 300A to the state shown in example 300B. If touch input source 302 remains in contact with the touch screen and moves relative to the touch screen, the event recognizer for recognizing a drag gesture recognizes the drag gesture and also switches to an activated state, and does not cause the event recognizer for recognizing a long press gesture to switch to a failed state. As touch input source 302 moves, view node 301 follows.

[0046] Multiple event recognizers located in the same view node and used to recognize different predetermined gestures may have a competitive relationship. Multiple event recognizers with a competitive relationship. If one event recognizer switches to an active state, it will exclude the remaining event recognizers from switching to an active state, thereby causing the remaining event recognizers to be in a failed state. As an example, Figure 3A , Figure 3B and Figure 3D As shown, view node 301 may be bound to an event recognizer for recognizing a long press gesture and an event recognizer for recognizing a drag gesture, and the two event recognizers may be configured to have a competitive relationship. Touch input source 302 long-presses view node 301, and the event recognizer for recognizing a long press gesture recognizes the long press gesture based on the touch event, and switches to an activated state, for example, switching from the state shown in example 300A to the state shown in example 300B. If touch input source 302 remains in contact with the touch screen and moves relative to the touch screen, although the event recognizer for recognizing a drag gesture can recognize the drag gesture, it is in a failed state due to the competitive relationship, and view object 301 will not move as touch input source 302 moves.

[0047] Multiple event recognizers located at different view nodes and used to recognize the same predetermined gesture may have a one-way collaborative relationship. For multiple event recognizers with a one-way recognition relationship, the previous event recognizer in the collaborative direction will have a different state from the next event recognizer in the collaborative direction, but the next event recognizer in the collaborative direction will not synchronize the state with the previous event recognizer in the collaborative direction. That is, multiple event recognizers with a collaborative relationship will synchronize the state along the collaborative direction, but will not synchronize the state in the opposite direction of the collaborative direction.

[0048] As an example, FIG. 4A to FIG. 4CSchematic diagrams of examples 400A to 400C of user interfaces according to some embodiments of the present disclosure are respectively shown. In examples 400A to 400C, view nodes 401, 402, 403 and touch input source 404 (e.g., finger) are shown. The event recognizers of view nodes 401, 402, 403 are all used to recognize the drag gesture, and the event recognizer of view node 401 has a one-way collaborative relationship with the event recognizers of view nodes 402 and 403. Specifically, the event recognizer of view node 401 is configured to synchronize the state with the event recognizers of view nodes 402 and 403, but the event recognizer of view node 403 will not synchronize the state with the event recognizer of view node 401. On this basis, touch input source 404 drags view node 401, and the event recognizer of view node 401 switches to an activated state after recognizing the drag gesture, and synchronizes the state with the event recognizers of view nodes 402 and 403, and view nodes 401, 402, 403 move synchronously. However, when touch input source 404 drags view node 403, the event identifier of view node 403 recognizes the drag gesture, but the event identifier of view node 403 does not synchronize the state with the event identifiers of view nodes 401 and 402, so only view node 403 itself moves.

[0049] If the event recognizers of the view nodes with inner and outer nesting relationships are used to recognize the same predetermined gesture, these event recognizers can have a waiting relationship. The event recognizers with a waiting relationship will recognize the predetermined gesture in the order indicated by the waiting relationship, and perform the corresponding predetermined operation after recognizing the predetermined gesture. As an example, FIG. 5A to FIG. 5C Schematic diagrams of examples 500A to 500C of user interfaces according to some embodiments of the present disclosure are respectively shown. View nodes 501, 502 and touch input source 503 are shown in the user interfaces of examples 500A to 500C. View node 501 can be an outer container, view node 502 can be an inner container, and view nodes 501 and 502 have an inner-outer nested relationship. The event identifiers of view nodes 501 and 502 are both used to recognize drag gestures. The event identifier of view node 502 can be configured to wait for the event identifier of view node 501. When touch input source 503 drags the user interface, the event identifier of view node 501 and the event identifier of view node 502 can both recognize the drag gesture. However, only the event identifier of view node 501 switches to an activated state, and the event identifier of view node 502 does not switch to an activated state. At this time, view node 501 moves upward in response to recognizing the drag gesture, as shown in FIG. FIG. 5A to FIG. 5B When view node 501 moves to the top of the user interface, the event identifier of view node 501 switches to the failed state. The event identifier of view node 502 switches to the activated state, and view node 502 moves upward, as shown in FIG. FIG. 5B to FIG. 5C shown.

[0050] Event recognizers located in different view nodes and used to recognize the same predetermined gesture can have a connection relationship. These view nodes can have a nested relationship or a parallel relationship. Event recognizers with a connection relationship can respond to the same predetermined gesture in a connection order. For example, FIG. 6A to FIG. 6C Schematic diagrams of examples 600A to 600C of user interfaces according to some embodiments of the present disclosure are respectively shown. In the user interfaces of examples 600A to 600C, view nodes 601, 602 and touch input source 603 are shown. The event recognizer of view node 601 and the event recognizer of view node 602 may have a connection relationship. When touch input source 603 drags view node 601, the event recognizer of view node 601 can recognize the drag gesture, and view node 601 moves upward, as shown in FIG. FIG. 6A to FIG. 6B When view node 601 moves to the bottom, the event recognizer of view node 601 switches to a failed state. The event recognizer of view node 601 transmits the drag gesture to the event recognizer of view node 602, and the event recognizer of view node 602 takes over the event recognizer of view node 601 to respond to the drag gesture, and view node 602 moves upward, as shown in FIG. FIG. 6B to FIG. 6C shown.

[0051] It is understandable that the above interaction relationship is only exemplary, and in actual application, any appropriate relationship can be configured between the event identifiers of the view nodes according to actual needs. The embodiments of the present disclosure are not specifically limited in this regard.

[0052] To illustrate that the terminal device 110 determines the response relationship of the at least one candidate view node to the touch event based on the interaction relationship between the event identifiers of the at least one candidate view node, based on the DOM structure shown in Table 1, an example of executing a script in another part of the user interface is shown.

[0053] Table 2

[0054]

[0055] As can be seen from the above table, there is a waiting relationship between event recognizer "panA" and event recognizer "panB", and there is a collaborative relationship between event recognizer "panB" and event recognizer "panC". On this basis, the response relationship of the three view nodes, list "list", scroll view "scroll-view" and inner view "view-inner", to touch events includes scroll view "scroll-view" and inner view "view-inner" responding to touch events first based on the collaborative relationship, and then list "list" responds to touch events based on the waiting relationship.

[0056] In block 230 of process 200, terminal device 110 identifies a corresponding predetermined gesture for a candidate view node in at least one candidate view node based on the touch event according to the response relationship. In some embodiments, terminal device 110 may generate a response flow graph indicating the response relationship according to the response relationship. Based on the response flow graph, the touch event is assigned to a first view node in at least one candidate view node. A first predetermined gesture corresponding to the first view node is identified based on the touch event by the first view node.

[0057] In some embodiments, the event identifier includes a determination condition for a predetermined gesture of the associated candidate view node. The determination condition here may vary depending on the predetermined gesture. For example, in the case where the predetermined gesture is a click gesture, the determination condition may include that the contact time between the touch input source and the touch screen does not exceed a first time threshold. For another example, in the case where the predetermined gesture is a long press gesture, the determination condition may include that the contact time between the touch input source and the touch screen exceeds a second event threshold, and the distance between the position of the touch start sub-event and the position of the touch end sub-event is less than a displacement threshold. It will be understood that the above determination conditions are only exemplary. In actual applications, any appropriate conditions may be selected according to actual needs. The embodiments of the present disclosure are not limited to this.

[0058] The terminal device 110 may assign the touch event to a first event identifier associated with a first view node in at least one candidate view node according to the response relationship. Afterwards, the terminal device 110 may identify a first predetermined gesture of the first view node according to the determination condition and the touch event included in the first event identifier.

[0059] In the example shown in Table 1, the response relationship of the three view nodes, list "list", scroll view "scroll-view" and inner view "view-inner", to touch events includes that the list "list", scroll view "scroll-view", and inner view "view-inner" respond to touch events in sequence. On this basis, the following can be generated: Figure 7In the response flow diagram 700 shown, box 710 indicates the list "list", box 720 indicates the scroll view "scroll-view", and box 730 indicates the inner view "view-inner". Based on the response flow diagram 700, the terminal device 110 first assigns the touch event to the event recognizer "panA" of the list "list". The event recognizer "panA" may include a determination condition for the drag gesture, and the event recognizer "panA" may recognize the drag gesture based on the determination condition for the drag gesture and the touch event.

[0060] In the example shown in Table 2, the response relationship of the three view nodes, list "list", scroll view "scroll-view" and inner view "view-inner", to touch events includes that scroll view "scroll-view" and inner view "view-inner" respond to touch events first based on the collaborative relationship, and then list "list" responds to touch events based on the waiting relationship. On this basis, the following can be generated: Figure 8 Response flow chart 800 is shown. In response flow chart 800, box 810 indicates scroll view "scroll-view", box 820 indicates inner view "view-inner", and box 830 indicates list "list". Based on response flow chart 800, terminal device 110 first assigns the touch event to event recognizer "panB" of scroll view "scroll-view". Event recognizer "panB" may include a determination condition for a drag gesture, and event recognizer "panB" may recognize a drag gesture based on the determination condition for the drag gesture and the touch event.

[0061] In some embodiments, in response to the first view node not recognizing the first predetermined gesture based on the touch event, the terminal device 110 assigns the touch event to the second view node after the first view node according to the response relationship. Thereafter, the second view node recognizes the second predetermined gesture corresponding to the second view node based on the touch event. Additionally, the terminal device 110 may, according to the response flow graph, assign the touch event to the second view node after the first view node, and recognize the second predetermined gesture corresponding to the second view node based on the touch event through the second view node.

[0062] In some embodiments, the terminal device 110 may determine the first event recognizer as a failed state in response to the first event recognizer not recognizing the first predetermined gesture based on the touch event. In response to the first event recognizer being in a failed state, the touch event is assigned to a second event recognizer of a second view node after the first view node according to the response relationship. Thereafter, the terminal device 110 may recognize the second predetermined gesture of the second view node according to the determination condition and the touch event included in the second event recognizer.

[0063] In box 240 of process 200, the terminal device 110 performs a corresponding target operation based on a touch event through the target view node in response to recognizing a corresponding predetermined gesture for a target view node in at least one candidate view node. In some embodiments, the terminal device 110 may determine the event identifier of the target view node as being in an activated state in response to recognizing a corresponding predetermined gesture through the target view node. In response to the event identifier of the target view node being in an activated state, the corresponding target operation is performed based on a touch event through the target view node. For example, if a first predetermined gesture is recognized through a first event identifier of a first view node, the terminal device 110 may determine the first event identifier as being in an activated state. Thereafter, the terminal device 110 may perform a corresponding target operation based on a touch event through the first view node in response to the first event identifier being in an activated state.

[0064] As an example, in example 700, if the event recognizer "panA" of the list "list" recognizes a drag gesture, the terminal device 110 determines the event recognizer "panA" as being in an activated state. Afterwards, the terminal device 110 can control the list "list" to scroll according to the drag gesture.

[0065] As another example, in example 800, if the event recognizer "panB" of the scroll view "scroll-view" recognizes a drag gesture, the terminal device 110 determines the event recognizer "panB" as being activated. Afterwards, the terminal device 110 can control the scroll view "scroll-view" to scroll according to the drag gesture.

[0066] It is understandable that the above operations are only exemplary. In actual application, the terminal device 110 may also perform any appropriate operation according to actual needs, and the embodiments of the present disclosure are not limited to this.

[0067] In this way, the embodiment of the present disclosure allocates touch events to view nodes according to the response relationship between view nodes of the user interface to touch events. In this way, it can be ensured that each view node can perform gesture recognition and gesture response according to the response relationship, thereby avoiding gesture conflicts. In addition, the embodiment of the present disclosure does not rely on the operating system to process and allocate touch events. For the same application, even if it is deployed on different operating systems, the consistency of interaction mode can be achieved.

[0068] Example devices and equipment

[0069] The embodiments of the present disclosure also provide corresponding devices for implementing the above methods or processes. Fig. 9A schematic structural block diagram of an example apparatus 900 for touch event processing according to some embodiments of the present disclosure is shown. The apparatus 900 may be implemented as or included in the terminal device 110. Each module / component in the apparatus 400 may be implemented by hardware, software, firmware, or any combination thereof.

[0070] like Fig. 9 As shown, the device 900 includes: a response module 910, configured to respond to detecting a touch event on a user interface, determine at least one candidate view node associated with the touch event from multiple view nodes of the user interface, and at least one candidate view node has a corresponding predetermined gesture; a determination module 920, configured to determine a response relationship of at least one candidate view node to the touch event based on an association relationship between at least one candidate view node; an identification module 930, configured to identify a corresponding predetermined gesture for a candidate view node in at least one candidate view node based on the touch event according to the response relationship; and an execution module 940, configured to respond to identifying a corresponding predetermined gesture for a target view node in at least one candidate view node, and to perform a corresponding target operation based on the touch event through the target view node.

[0071] In some embodiments, the response module 910 is further configured to: in response to detecting a touch event on the user interface, determine a view node selected by the touch event and a view hierarchy structure of multiple view nodes; and determine at least one candidate view node based on a position of the view node selected by the touch event in the view hierarchy structure.

[0072] In some embodiments, the determination module 920 is further configured to: determine a hierarchical relationship between at least one candidate view node according to a view hierarchy structure of multiple view nodes; and determine a response relationship based on the hierarchical relationship between at least one candidate view node.

[0073] In some embodiments, the determination module 920 is further configured to: obtain at least one execution script corresponding to at least one candidate view node, wherein the execution script in the at least one execution script includes an event identifier of the corresponding candidate view node, and the event identifier is configured to identify a predetermined gesture of the corresponding candidate view node based on a touch event; and determine a response relationship of at least one candidate view node to the touch event based on an interaction relationship between the respective event identifiers of at least one candidate view node.

[0074] In some embodiments, the identification module 930 is further configured to: generate a response flow graph indicating the response relationship based on the response relationship; assign the touch event to a first view node among at least one candidate view node based on the response flow graph; and identify a first predetermined gesture corresponding to the first view node based on the touch event through the first view node.

[0075] In some embodiments, the identification module 930 is further configured to: in response to not recognizing a first predetermined gesture based on a touch event through the first view node, assign the touch event to a second view node following the first view node according to a response flow graph; and recognize a second predetermined gesture corresponding to the second view node based on the touch event through the second view node.

[0076] In some embodiments, at least one candidate view node is respectively associated with an event identifier, the event identifier includes a determination condition for a predetermined gesture of the associated candidate view node, and the recognition module 930 is further configured to: assign the touch event to a first event identifier associated with a first view node in at least one candidate view node based on a response relationship; and recognize a first predetermined gesture of the first view node based on the determination condition and touch event included in the first event identifier.

[0077] In some embodiments, the identification module 930 is also configured to: in response to the first event identifier not recognizing the first predetermined gesture based on the touch event, determine the first event identifier as a failure state; in response to the first event identifier being in a failure state, assign the touch event to a second event identifier of a second view node after the first view node according to a response relationship; and identify a second predetermined gesture of the second view node based on the determination condition and touch event included in the second event identifier.

[0078] In some embodiments, the execution module 940 is further configured to: in response to recognizing a first predetermined gesture through a first event identifier of the first view node, determine the first event identifier as an activated state; and in response to the first event identifier being in an activated state, perform a corresponding target operation based on the touch event through the first view node.

[0079] In some embodiments, the touch event includes at least one of the following: a touch start sub-event, a touch move sub-event, a touch end sub-event, or a touch cancel sub-event.

[0080] The units and / or modules included in the device 900 can be implemented in various ways, including software, hardware, firmware, or any combination thereof. In some embodiments, one or more units and / or modules can be implemented using software and / or firmware, such as machine executable instructions stored on a storage medium. In addition to or as an alternative to machine executable instructions, some or all of the units and / or modules in the device 900 can be implemented at least in part by one or more hardware logic components. As an example and not limitation, exemplary types of hardware logic components that can be used include field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0081] Fig.10 1 shows a block diagram of an electronic device 1000 in which one or more embodiments of the present disclosure may be implemented. It should be understood that Fig.10 The electronic device 1000 shown is merely exemplary and should not constitute any limitation on the functionality and scope of the embodiments described herein. Fig.10 The electronic device 1000 shown may include or be implemented as Figure 1 The terminal device 110, or Fig. 9 Device 900.

[0082] like Fig.10 As shown, the electronic device 1000 is in the form of a general electronic device. The components of the electronic device 1000 may include, but are not limited to, one or more processors or processing units 1010, a memory 1020, a storage device 1030, one or more communication units 1040, one or more input devices 1050, and one or more output devices 1060. The processing unit 1010 may be an actual or virtual processor and is capable of performing various processes according to a program stored in the memory 1020. In a multi-processor system, multiple processing units execute computer executable instructions in parallel to improve the parallel processing capability of the electronic device 1000.

[0083] The electronic device 1000 typically includes a plurality of computer storage media. Such media may be any accessible media that is accessible to the electronic device 1000, including but not limited to volatile and non-volatile media, removable and non-removable media. The memory 1020 may be a volatile memory (e.g., a register, a cache, a random access memory (RAM)), a non-volatile memory (e.g., a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. The storage device 1030 may be a removable or non-removable medium, and may include a machine-readable medium, such as a flash drive, a disk, or any other medium, which may be capable of being used to store information and / or data and may be accessed within the electronic device 1000.

[0084] The electronic device 1000 may further include additional removable / non-removable, volatile / non-volatile storage media. Fig.10 As shown in , a disk drive for reading or writing from a removable, non-volatile disk (e.g., a "floppy disk") and an optical drive for reading or writing from a removable, non-volatile optical disk may be provided. In these cases, each drive may be connected to the bus (not shown) by one or more data media interfaces. Memory 1020 may include a computer program product 1025 having one or more program modules that are configured to perform various methods or actions of various embodiments of the present disclosure.

[0085] The communication unit 1040 implements communication with other electronic devices through a communication medium. Additionally, the functions of the components of the electronic device 1000 can be implemented in a single computing cluster or multiple computing machines that can communicate through a communication connection. Therefore, the electronic device 1000 can operate in a networked environment using a logical connection with one or more other servers, a network personal computer (PC), or another network node.

[0086] The input device 1050 may be one or more input devices, such as a mouse, a keyboard, a tracking ball, etc. The output device 1060 may be one or more output devices, such as a display, a speaker, a printer, etc. The electronic device 1000 may also communicate with one or more external devices (not shown) through the communication unit 1040 as needed, such as a storage device, a display device, etc., communicate with one or more devices that allow a user to interact with the electronic device 1000, or communicate with any device that allows the electronic device 1000 to communicate with one or more other electronic devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface (not shown).

[0087] According to an exemplary implementation of the present disclosure, a computer-readable storage medium is provided, on which computer-executable instructions are stored, wherein the computer-executable instructions are executed by a processor to implement the method described above. According to an exemplary implementation of the present disclosure, a computer program product is also provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, and the computer-executable instructions are executed by a processor to implement the method described above.

[0088] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices, equipment, and computer program products implemented according to the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0089] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0090] Computer-readable program instructions can be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, so that the instructions executed on the computer, other programmable data processing apparatus, or other device implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0091] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple implementations of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of a module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some implementations as replacements, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a special hardware-based system that performs the function or action of the specification, or can be realized by a combination of special hardware and computer instructions.

[0092] The above descriptions of various implementations of the present disclosure are exemplary, non-exhaustive, and not limited to the disclosed implementations. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described implementations. The selection of terms used herein is intended to best explain the principles of the implementations, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the various implementations disclosed herein.

Claims

1. A touch event processing method, comprising: In response to detecting a touch event on a user interface, determining at least one candidate view node associated with the touch event from a plurality of view nodes of the user interface, wherein the at least one candidate view node has a corresponding predetermined gesture; Determining, based on the association relationship between the at least one candidate view node, a response relationship of the at least one candidate view node to the touch event; identifying, according to the response relationship, a corresponding predetermined gesture for a candidate view node in the at least one candidate view node based on the touch event; as well as In response to recognizing a corresponding predetermined gesture for a target view node among the at least one candidate view node, a corresponding target operation is performed based on the touch event through the target view node.

2. The method of claim 1 , wherein determining at least one candidate view node associated with the touch event from a plurality of view nodes of the user interface comprises: In response to detecting a touch event on the user interface, determining a view node selected by the touch event and a view hierarchy structure of the plurality of view nodes; as well as The at least one candidate view node is determined based on a position of the view node selected by the touch event in the view hierarchy structure.

3. The method according to claim 1, wherein determining the response relationship of the at least one candidate view node to the touch event comprises: Determining a hierarchical relationship between the at least one candidate view node according to the view hierarchical structure of the plurality of view nodes; as well as The response relationship is determined based on the hierarchical relationship between the at least one candidate view node.

4. The method according to claim 1, wherein determining the response relationship of the at least one candidate view node to the touch event comprises: Acquire at least one execution script corresponding to the at least one candidate view node, wherein the execution script in the at least one execution script includes an event recognizer of the corresponding candidate view node, and the event recognizer is configured to recognize a predetermined gesture of the corresponding candidate view node based on a touch event; as well as Based on the interaction relationship between the event recognizers of the at least one candidate view node, a response relationship of the at least one candidate view node to the touch event is determined.

5. The method according to claim 1, wherein identifying a corresponding predetermined gesture for a candidate view node in the at least one candidate view node comprises: According to the response relationship, generating a response flow graph indicating the response relationship; assigning the touch event to a first view node among the at least one candidate view node based on the response flow graph; as well as A first predetermined gesture corresponding to the first view node is identified based on the touch event by the first view node.

6. The method according to claim 5, wherein identifying a corresponding predetermined gesture for a candidate view node in the at least one candidate view node further comprises: In response to the first view node not recognizing the first predetermined gesture based on the touch event, assigning the touch event to a second view node subsequent to the first view node according to the response flow graph; as well as A second predetermined gesture corresponding to the second view node is identified based on the touch event by the second view node.

7. The method according to claim 1, wherein the at least one candidate view node is respectively associated with an event recognizer, the event recognizer including a determination condition for a predetermined gesture of the associated candidate view node, and Wherein identifying a corresponding predetermined gesture for a candidate view node in the at least one candidate view node comprises: According to the response relationship, assigning the touch event to a first event recognizer associated with a first view node among the at least one candidate view node; as well as A first predetermined gesture of the first view node is recognized according to the determination condition included in the first event recognizer and the touch event.

8. The method according to claim 7, wherein identifying a corresponding predetermined gesture for a candidate view node in the at least one candidate view node further comprises: In response to failure to recognize the first predetermined gesture based on the touch event by the first event recognizer, determining the first event recognizer to be in a failed state; In response to the first event recognizer being in the failed state, assigning the touch event to a second event recognizer of a second view node following the first view node according to the response relationship; as well as A second predetermined gesture of the second view node is recognized according to the determination condition included in the second event recognizer and the touch event.

9. The method according to claim 7, wherein performing a corresponding target operation based on the touch event comprises: In response to recognizing the first predetermined gesture by a first event recognizer of the first view node, determining the first event recognizer to be in an activated state; as well as In response to the first event recognizer being in an activated state, a corresponding target operation is performed based on the touch event through the first view node.

10. The method according to claim 1, wherein the touch event comprises at least one of the following: Touch to start sub-event, Touch move sub-event, Touch the end sub-event, or Touch to cancel the sub-event.

11. A device for touch event processing, comprising: a response module, configured to, in response to detecting a touch event on a user interface, determine at least one candidate view node associated with the touch event from a plurality of view nodes of the user interface, wherein the at least one candidate view node has a corresponding predetermined gesture; a determination module configured to determine a response relationship of the at least one candidate view node to the touch event based on an association relationship between the at least one candidate view node; an identification module configured to identify a corresponding predetermined gesture for a candidate view node in the at least one candidate view node based on the touch event according to the response relationship; as well as The execution module is configured to, in response to recognizing a corresponding predetermined gesture for a target view node among the at least one candidate view node, execute a corresponding target operation based on the touch event through the target view node.

12. An electronic device comprising: at least one processing unit; as well as At least one memory, the at least one memory being coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions causing the electronic device to perform the method according to any one of claims 1 to 10 when executed by the at least one processing unit.

13. A computer-readable storage medium having a computer program stored thereon, wherein the computer program can be executed by a processor to implement the method according to any one of claims 1 to 10.

14. A computer program product, comprising a computer program, wherein the computer program implements the method according to any one of claims 1 to 10 when executed by a processor.

Citation Information

Patent Citations

  • Buttonless operation method and device of unmanned aerial vehicle

    CN107861683A

  • Method and device for processing gesture event, equipment and storage medium

    CN115344121A

  • User activity shortcut suggestion

    CN116301492A

  • Event Recognition

    US20110179380A1

Cited By

  • Touch event processing method and apparatus, device, and storage medium

    WO2026091792A1