Input event processing method and related device

By detecting user input operations and generating input events that adapt to control types, the problem that applications in the prior art cannot respond well to input operations is solved, and better user experience and application adaptability are achieved.

CN120216045APending Publication Date: 2025-06-27HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311804291.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-25
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

The prior art is difficult to effectively handle input events generated by input operations, making the application unable to respond well to user input operations, resulting in a poor user experience.

Method used

By detecting user input operations, input events adapted to control type are generated to ensure that the application can handle input operations normally. The specific method includes: when an input operation is detected, determining the control type to which the operation is used, and generating corresponding input events according to the type, or mapping according to the application preset event type.

Benefits of technology

It improves the application's response ability to user input operations, improves the user's operating experience, reduces the workload of application developers to adapt to applications, and expands application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120216045A_ABST
    Figure CN120216045A_ABST
Patent Text Reader

Abstract

The invention discloses an input event processing method and a related device, the method can generate a first input event according to a first input operation after the first input operation acting on a first application is detected, the event type of the first input event corresponds to the control type of a first control acted by the first input operation, or the event type of the first input event corresponds to the control type of the first control acted by the first input operation. The first input event belongs to an event type preset by the first application for the first control, and then processing the first input event through the first application. Therefore, according to the method, the input event can be generated according to the control acted by the operation, so that the input operation acted on the application can be mapped into the input operation which can be processed by the application, the operation acted on the application by the user can have good operation feedback, and the operation experience feeling of the user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of terminal and computer technologies, and in particular, to an input event processing method and related devices. Background Art

[0002] An input device is an external device on an electronic device and is one of the main devices for information exchange between a user and the electronic device. For example, a keyboard, a mouse, a touch screen, a touchpad, a camera, etc. all belong to input devices. The electronic device can detect an input operation performed by the user on the input device, send the input event corresponding to the input operation to the corresponding application for processing, and the application implements the corresponding function based on the input event, so as to achieve the purpose that the user controls the electronic device through the input device.

[0003] However, for the input events corresponding to some input operations, some applications cannot handle them well, so that when the user controls the electronic device through the input operation, the application cannot respond well to the operation, resulting in a large difference between the function responded by the application and the result expected by the user, and causing a poor user experience. Summary of the Invention

[0004] This application provides an input event processing method and related devices, which can adjust the input events generated by the input operations, enable the application to better respond to the user's input operations, and improve the user's operation experience of the application.

[0005] In a first aspect, an embodiment of this application provides an input event processing method, which is characterized in that the method includes: the electronic device detects a first input operation acting on a first application; the electronic device generates a first input event according to the first input operation, the event type of the first output event corresponds to the control type of the first control on which the first output event acts, or the first input event belongs to the event type preset by the first application for the first control; the electronic device processes the first input event through the first application.

[0006] By implementing the method provided in the first aspect, the electronic device can input the input event corresponding to the input operation according to the control on which the input operation acts, so that the application can better respond to the user's input operation, the operation performed by the user on the application can obtain good operation feedback, and the user's operation experience is improved.

[0007] In combination with the first aspect, in one implementation, the event type of the first output event corresponds to the control type of the first control on which the first output event acts. The electronic device generates a first input event according to the first input operation, specifically including: when the first application does not preset an event type for the first control, the electronic device generates a first input event according to the first input operation and the control type of the first control.

[0008] That is to say, before the electronic device generates an input event, it can first check whether the application has preset the event type expected by the control. If not, it can then determine the event type of the input event according to the control type of the control, enabling the electronic device to directly generate an input event in combination with the control type of the control, reducing the workload of application developers for application adaptation, expanding the application scenarios of this solution, and facilitating the popularization of this solution.

[0009] In combination with the first aspect, in one implementation, event types corresponding to different control types are stored in the electronic device.

[0010] In this way, after the electronic device determines the control type of the control on which the input operation acts, it can determine the input event that this input operation can be mapped to according to this control type. In this way, the electronic device can map the input operation to an event type that the application can adapt to and can handle normally according to the control type of the control on which the user's input operation acts, realizing the normal response of the application to this input operation.

[0011] In combination with the first aspect, in one implementation, before the electronic device generates a first input event according to the first input operation, the method further includes: the electronic device determines that the control on which the first input operation acts is the first control.

[0012] That is to say, before the electronic device generates an adapted input event, it needs to first determine the control on which the input operation acts, and then generate an input event according to this control.

[0013] In combination with the first aspect, in one implementation, the first input event is determined according to the control type of the first control on which the first input operation acts. After the electronic device determines that the control on which the first input operation acts is the first control and before generating a first input event according to the first input operation, the method further includes: the electronic device obtains the control type of the first control fed back by the first application.

[0014] That is to say, after the electronic device finds the control on which the input operation acts, it can obtain the control type of the control on which this input operation acts through the feedback of the application, so as to generate an adapted input event based on the control type.

[0015] In combination with the first aspect, in one implementation, the first input operation is a touch operation. After the electronic device detects the first input operation acting on the first application, the method further includes: during the process that the user initiates the first input operation, the electronic device generates a second input event, and the second input event includes one or more touch events; the electronic device determines that the control on which the first input operation acts is the first control, specifically including: the electronic device determines that the control on which the first input operation acts is the first control by distributing the second input event.

[0016] It can be seen that during the process that the user initiates an input operation, the control on which the input operation acts can be detected by some input events generated by the electronic device based on this input operation, so that the electronic device can quickly determine the input events adapted to the application and ensure the normal response of the application to the user operation.

[0017] In combination with the first aspect, in one implementation, after the electronic device generates the second input event, the method further includes: during the process that the user initiates the first input operation, the electronic device generates a third input event, and the third input event includes one or more touch events; the electronic device maps the first input operation to a first input event, specifically including: the electronic device deletes the second input event and converts the third input event into the first input event.

[0018] That is to say, the electronic device only needs to use some input events to detect the control on which the input operation acts during the process that the user initiates the input operation, and in the case of determining that the input event needs to be adjusted, adjust the input events generated subsequently, so that the electronic device can timely adjust the input event corresponding to the input operation according to this control and ensure that the electronic device can adjust the input event to an input event adapted to the control. Moreover, since the time intervals between the generation of the two input events before and after are very short and the user can hardly perceive it, the method provided by the embodiments of the present application can well improve the touch experience of the user when controlling the application and meet the user's manipulation requirements for various applications through the input device.

[0019] In combination with the first aspect, in one implementation, the second input event and the third input event form a single-finger sliding event.

[0020] In combination with the first aspect, in one implementation, the electronic device includes or is connected to a keyboard, the first input operation is a two-finger sliding operation on a touchpad of the keyboard, and the first input event includes one or more mouse scroll events.

[0021] It can be seen that the input event adjustment method provided by the embodiments of the present application can solve the problem that there is a large gap between the two-finger sliding operation of the user on the touchpad of the keyboard-equipped electronic device and the expected response result, map the two-finger sliding operation to a mouse scrolling event, and transmit it to the application for processing, ensuring that the user has a good operation experience when initiating a two-finger sliding operation on the device.

[0022] In combination with the first aspect, in one implementation, before the electronic device detects a first input operation on a first application, the method further includes: the electronic device displays a first page of the first application; the electronic device processes the first input event through the first application, specifically including: the electronic device scrolls and displays the first page of the first application in response to the first input event.

[0023] Exemplarily, the first application may include: CAJ, WPS, Edraw, and so on.

[0024] It can be seen that after applying the method provided by the embodiments of the present application, the electronic device can well slide the page of the application according to the two-finger sliding operation of the user, ensuring the smooth sliding of the application page by the user.

[0025] In a second aspect, an embodiment of the present application provides an electronic device, including a memory, one or more processors, and one or more programs; when the one or more processors execute the one or more programs, the electronic device implements the method described in the first aspect or any one of the implementation manners in the first aspect.

[0026] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, including instructions, when the instructions run on an electronic device, the electronic device is caused to execute the method described in the first aspect or any one of the implementation manners in the first aspect.

[0027] In a fourth aspect, an embodiment of the present application provides a computer program product, when the computer program product runs on a computer, the computer is caused to execute the method described in the first aspect or any one of the implementation manners in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 It is a schematic overall flow chart of the input event processing method provided by the embodiments of the present application;

[0029] Figure 2 It is a schematic diagram of the interaction of each software module in the electronic device 100 for processing input events provided by the embodiments of the present application;

[0030] Figure 3 It is a schematic diagram of an application scenario provided by the embodiments of the present application;

[0031] Figure 4 The detailed processing procedure of the two-finger sliding operation by the electronic device 100 provided in the embodiments of the present application;

[0032] Figure 5 The processing timing diagram of the two-finger sliding operation provided in the embodiments of the present application;

[0033] Figure 6 The schematic hardware structure diagram of the electronic device 100 provided in the embodiments of the present application;

[0034] Figure 7 It is the software structure block diagram of the electronic device 100 in the embodiments of the present application. Specific embodiments

[0035] Next, the technical solutions in the embodiments of the present application will be clearly and elaborately described with reference to the accompanying drawings. Among them, in the description of the embodiments of the present application, unless otherwise specified, " / " means "or". For example, A / B may represent A or B; "and / or" in the text is only a description of the association relationship between associated objects, indicating that there can be three relationships. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0036] Hereinafter, the terms "first" and "second" are only for descriptive purposes and cannot be understood as implying or suggesting relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" is two or more than two.

[0037] The term "user interface (UI)" in the following embodiments of the present application is a media interface for interaction and information exchange between an application program or an operating system and a user, and it realizes the conversion between the internal form of information and the form acceptable to the user. The user interface is source code written in specific computer languages such as Java and Extensible Markup Language (XML). The interface source code is parsed and rendered on the electronic device and finally presented as content recognizable by the user. The common manifestation form of the user interface is the graphical user interface (GUI), which refers to the user interface related to computer operations displayed in a graphical manner. It can be visible interface elements such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and Widgets displayed on the display screen of the electronic device.

[0038] An embodiment of the present application provides an input event processing method. After detecting a first input operation on a first application, the method can generate a first input event according to the first input operation. The first input event is determined according to the control type of the first control on which the first input operation acts, or the first input event is the event type preset for the first control. Then, the first application processes the first input event.

[0039] Among them, the input operation can refer to operations such as mouse input operations, keyboard input operations, touch operations, etc. performed by the user on different input devices. A control is an element for developing and constructing the user interface of an application. Controls are classified according to the control type, and controls can include: ListView controls, EditView controls, Button controls, RadioButton controls, CheckBox controls, etc.

[0040] After detecting an input operation, the electronic device generates an input event, which is information that the system can process. The input event can include information related to the input operation, such as time, position coordinates, event type, etc. The electronic device can respond to the input operation by processing the input event. According to different types of input devices, the event type can include: mouse events, keyboard events, touch events, etc. Among them, the input events under mouse events can include: mouse click events, mouse scroll events, mouse double-click events, etc. after being recognized and processed by the View framework. The input events under touch events can include: single-finger click events, single-finger swipe events, two-finger swipe events, etc. after being recognized and processed by the View framework.

[0041] In one implementation, during the application development stage, the application developer can pre-set the event types adapted to different controls in advance. In this way, when the electronic device detects an input operation on the control, it can directly map the input operation according to the event type preset for the control, ensuring the normal response of the application to the user's input operation.

[0042] In another implementation, the event types adapted to different control types can be pre-set in the electronic device in advance. In this way, after the electronic device determines the control type of the control on which the input operation acts, it can determine the input event that the input operation can be mapped to according to the control type. In this way, the electronic device can map the input operation to an event type that is adapted to the application and can be normally processed according to the control type of the control on which the user's input operation acts, realizing the normal response of the application to the input operation.

[0043] Generally speaking, the input event processing method provided by the embodiments of this application can map the input operations acting on an application into input events that the application can process, ensuring a good operation experience for various applications installed on the electronic device. Moreover, this method does not require the application to adapt itself, reducing the workload of application developers for application adaptation, expanding the application scenarios of this solution, and facilitating the popularization of this solution.

[0044] Figure 1 It is a schematic diagram of the overall process of the input event processing method provided by the embodiments of this application.

[0045] As Figure 1 shown, the input event processing method may include:

[0046] S101. The electronic device 100 detects a first input operation acting on a first application.

[0047] The electronic device 100 may refer to devices such as mobile phones, tablets, computers, etc. The embodiments of this application do not limit the device type of the electronic device 100.

[0048] Among them, the first application may refer to any application installed in the electronic device 100, and the embodiments of this application do not limit this.

[0049] Before the electronic device 100 detects a first input operation acting on the first application, the electronic device 100 may display the user interface of the first application. The first input operation acting on the first application may refer to an input operation on the user interface of the first application.

[0050] Among them, according to the different input devices used by the user, the input operation may have different input types. Among them, the input devices may include: mouse, keyboard, touch screen, touchpad, etc. The input operation may include: mouse input operation, keyboard input operation, touch operation, etc.

[0051] S102. The electronic device 100 determines whether the first control on which the first input operation acts has a preset expected event type.

[0052] Exemplarily, during the application development stage, developers can set the expected event type of the control through the set() method. Correspondingly, the electronic device 100 can obtain the expected event type of the control through the get() method.

[0053] Therefore, when the electronic device 100 detects an input operation acting on the first application, it can first determine whether the first application has the expected event type of the control. If so, the electronic device 100 executes step S103; otherwise, the electronic device 100 executes step S104.

[0054] S103. The electronic device 100 maps the first input operation to a first input event under the expected event type.

[0055] An input event is information obtained after the electronic device 100 converts an input operation in order to process the input operation. The input event may include: the time and position coordinates when the user initiates the input operation, the event type corresponding to the input event, and other information.

[0056] For example, when the user presses a certain key on the keyboard, the electronic device 100 converts the key information into an electrical signal and hands it over to the system for processing. Another example is that when the user clicks the mouse or touch screen or touchpad, the electronic device 100 converts the user's operation into an electrical signal and hands it over to the system for processing.

[0057] The electronic device 100 maps the first input operation to a first input event under the expected event type, which can map the user's input operation to an input event adapted to the application, ensuring the normal response of the application to the input operation. Moreover, the electronic device 100 directly uses the expected event type preset by the control to map the input operation, reducing the trouble of the electronic device 100 determining the event type adapted to the control.

[0058] It can be understood that steps S102 - S103 are optional steps. The electronic device 100 can also not consider whether the control on which the input operation acts has a preset expected event type. After the electronic device 100 detects the input operation, it can directly determine the event type that the application can process according to the control type of the control on which the input operation acts. That is to say, the electronic device 100 can execute step S104 after executing step S101.

[0059] S104. The electronic device 100 determines the event type adapted to the first control according to the control type of the first control.

[0060] The electronic device 100 can preset the event types adapted to different control types. Among them, the event types adapted to different control types can be obtained by developers through testing the responses of different controls under different event types. In this way, after the electronic device 100 obtains the control type of the first control on which the first input operation acts, it can determine the event type adapted to the first control.

[0061] Exemplarily, the control type may include: listView, scrollView, recycleView, editText, editorView, and so on.

[0062] For example, if the first input operation is a two-finger swipe operation, without considering the event type for control adaptation, the electronic device 100 will default to mapping this two-finger swipe operation to a swipe event and passing it to the control for processing. If the control type of the first control is listView, this type of control usually consists of multiple option bars, and the user can swipe left and right or up and down to select one of the option bars. For the two-finger swipe operation on this first control, compared to mapping it to a swipe event, mapping it to a scroll event is more in line with the user's operation idea. This is because the two-finger swipe operation usually follows the same swipe trajectory as the user's two-finger swipe operation. For listView, usually only the horizontal two-finger swipe operation or the vertical two-finger swipe operation during the user's two-finger swipe operation needs to be responded to, and the scroll event only needs to consider the swipe situation in the horizontal or vertical direction during the user's two-finger swipe operation, which is more in line with the user's operation expectation. Therefore, if the first input operation is a two-finger swipe operation, the event type adapted for this type of control like listView is a scroll event.

[0063] In one implementation, when the electronic device 100 first detects an input operation acting on the first control, during the process of the control responding to this input operation, it records the control type of the first control and saves it locally, which is convenient for the electronic device 100 to adapt the input operation based on the control type of the first control after detecting the input operation acting on the first control again.

[0064] In another implementation, if the first input operation includes a series of consecutive operations acting on the first control, then during the process when the electronic device 100 detects the user initiating the first input operation, it first finds the control type of the first control based on the first input operation, and then adjusts the event type mapped by the first input operation based on this control type.

[0065] S105. The electronic device 100 maps the first input operation to a first input event under the event type adapted for the first control.

[0066] That is to say, the electronic device 100 can use the control type of the control to determine the event type mapped by the first input operation, which can prevent the electronic device 100 from mapping the first input operation according to the default event type, resulting in the result of the application's response to the input event not meeting the user's expectation and affecting the user experience.

[0067] It can be understood that in addition to determining the input event through the control type of the control, it can also be determined according to the application.

[0068] This is because different application developers design the response results of the application to different input operations during the development of the application. This causes the application to respond according to the developer's design when the user uses the application, resulting in the failure of some user operations to achieve the expected effects.

[0069] Therefore, in order to improve the response problems existing in this part of the applications, when the electronic device 100 detects a first input operation acting on the first application, it can determine whether the first application is a preset application. If so, for this type of application, the first input operation is mapped to an input event adapted to this type of application.

[0070] Among them, the preset application can be an application that fails to achieve the expected effects for the user's operations during the testing by developers, or an application with poor operation effects feedback by users. The input events adapted to this type of application can be selected by developers during the testing phase according to the response effects of the application to different input events.

[0071] S106. The electronic device 100 processes the first input event through the first application.

[0072] After the electronic device 100 maps the user's first input operation to an input event adapted to the first application, the electronic device 100 can pass the first input event to the corresponding first application for processing, and the first application then performs corresponding operations according to the received first input event.

[0073] Specifically, during the process of the first application processing the first input event, the first application can pass the first input event to the first control affected by the first input operation for processing, and the first control responds to the first input event to perform corresponding functions.

[0074] Generally speaking, the input event processing method provided by the embodiments of the present application can determine the event type adapted to the application according to the preset expected event type of the control or the control type of the control affected by the input operation, avoiding the application from being processed according to the input events generated by the system by default, and ensuring that the user has a good control experience for different applications through the input device.

[0075] Figure 2 It is a schematic diagram of the interaction of each software module in the electronic device 100 for processing input events provided by the embodiments of the present application.

[0076] As Figure 2 shown, after the electronic device 100 detects an input operation and maps the input operation to an input event, the processing of the input event mainly involves the interaction between the systemserver process and the application process, which may include:

[0077] The systemserver process reads the input event.

[0078] The input event may refer to an input event generated by the electronic device 100 after detecting an input operation. Among them, the input operation may refer to an operation performed by the user on the input device, such as a two-finger swipe operation on the touchpad. For the specific description of the input operation, please refer to the relevant content in step S101 above, which will not be elaborated here.

[0079] The input event may include information such as the time and position coordinates when the user initiates the input operation, and the event type corresponding to the input event.

[0080] It should be understood that the input event read by the systemserver process may be the input event default-mapped by the electronic device 100 according to the operation type of the input operation. At this time, the electronic device 100 does not consider the event type adapted by the application to adapt the input operation.

[0081] S202. The systemserver process determines the application window corresponding to the input event.

[0082] Among them, the systemserver process can determine the application window corresponding to the input event according to information such as the position coordinates included in the input event.

[0083] S203. The systemserver process distributes the input event to the application window.

[0084] After determining the application window corresponding to the input event, the systemserver process can distribute the input event to its corresponding application window, and the application processes the input event.

[0085] S204. The application process distributes the input event layer by layer according to the View hierarchy.

[0086] After the application obtains the input event, the application can distribute the input event layer by layer through its application process to find the control for responding to the input event.

[0087] Specifically, the application can implement the layer-by-layer distribution of the input event through the ViewRoot in the WindowManager. Among them, WindowManager is an interface, and the common methods in it are: adding View, updating View, and deleting View. It is mainly used to manage the Window. ViewRoot is used to be responsible for the event handling and logic processing of the control View.

[0088] S205. The application process determines the control type of the target control to which the input event is distributed.

[0089] After finding the target control to which the input event is distributed, the control type of the target control can be recorded, so that when mapping the input event based on the input operation later, the input operation can be mapped to an input event adapted to the application based on the control type of the target control.

[0090] S206. After the application process finishes processing the input event, it sends a message indicating that the input event has been processed and the control type of the target control to the systemserver process.

[0091] After the application process finishes processing the input event, that is, after the target control responds to the input event and executes the corresponding function, a message indicating that the input event has been processed and the recorded control type of the target control can be returned to the systemserver process. In this way, when the electronic device 100 maps the input operation next time, the input event corresponding to the input operation can be determined according to the control type of the target control recorded last time.

[0092] It should be noted that Figure 2 shows the processing process of an input event by the electronic device 100, and the process of obtaining the control type of the control on which the input operation acts during the processing process of this input event by the electronic device 100. If the electronic device 100 generates multiple input events in sequence for a user's input operation, each input event can be executed according to a process similar to the above steps S201 - S206. The difference is that for the first input event or multiple input events generated by the electronic device 100, they can be executed completely according to the above steps S201 - S206. After obtaining the control type of the control on which the input operation acts, when the electronic device 100 processes the subsequently generated input events, step S105 does not need to be executed, and the information fed back in step S106 does not include the control type of the target control. And, after step S201, if the electronic device 100 determines that it needs to adjust the input event, it can also adjust the event type of the input event according to the control type after reading the input event, or directly generate an input event adapted to the control type.

[0093] It can be seen that the electronic device 100 can achieve adaptation to the input operation through the systemServer process. In this way, there is no need for the application to adapt the input operation detected by the electronic device 100 by itself, but a capability to adapt the input operation at the framework layer is provided, reducing the workload of application developers and facilitating the commercial promotion of this method.

[0094] To better understand the application of this solution, the following describes the specific implementation process of this solution with a specific application scenario.

[0095] Figure 3 A schematic diagram of an application scenario provided by an embodiment of the present application.

[0096] In Figure 3 In the application scenario shown, the electronic device 100 may refer to a tablet computer with an external keyboard. Among them, the keyboard may include a touchpad, and the electronic device 100 may detect a user's touch operation through the touchpad and execute corresponding functions.

[0097] As Figure 3 As shown in (a), the electronic device 100 displays an editing interface 110 for File 1 provided by an office application. The editing interface 110 may include a page display area 111, and the page display area 111 may be used to display part of the content of File 1.

[0098] Exemplarily, the office application may refer to applications such as WPS, CAJ, Edraw, etc.

[0099] Exemplarily, the first input operation may refer to Figure 3 The two-finger sliding operation on the touchpad shown in (a). The sliding trajectory of the two-finger sliding operation can be seen from the dotted line in area X, and the sliding trajectory is obliquely upward.

[0100] If this solution is not used, then as Figure 3 As shown in (b), the electronic device 100 will directly map the two-finger sliding operation belonging to the touch operation to a single-finger sliding event under the touch event and pass it to the office application for processing.

[0101] In a possible case, the two-finger sliding operation initiated by the user may cause the cursor to move obliquely upward along the sliding trajectory of the two-finger sliding operation, and the content in the page display area 111 cannot be scrolled.

[0102] In another possible case, the two-finger sliding operation initiated by the user may cause the cursor to move obliquely upward along the sliding trajectory of the two-finger sliding operation. And, during the movement of the cursor, when the cursor does not leave the page display area 111, the content in the page display area 111 can be scrolled upward a small distance. Once the cursor leaves the page display area 111 during the movement, the content in the page display area 111 cannot be scrolled.

[0103] And, during the upward movement of the cursor, if the cursor moves to the top of the page display area 111, it may trigger the office application to roll back the content in the page display area 111, so that the content at the very beginning of File 1 is displayed in the page display area 111.

[0104] In addition, if the moving distance of the two-finger sliding operation is small or the sliding speed is too slow, the electronic device 100 may not map it to a sliding event, resulting in the problem that the page display area 111 cannot be scrolled.

[0105] Combined with Figure 3 As can be seen from (a) and (b) in it, for the two-finger sliding operation of the user on the touchpad, the electronic device generally maps the two-finger sliding operation to a sliding event without considering the adaptation degree of different applications to different input events, resulting in that some applications may not be able to respond to the sliding event, or the response result does not meet the expectation, causing the user to be unable to scroll the page or the page scrolling process is not smooth through the two-finger sliding operation on the touchpad.

[0106] If this solution is used, the electronic device 100 can find the control that the two-finger sliding operation acts on, that is, the control corresponding to the page display area 111, and map the two-finger sliding operation to a scroll event under the mouse event according to its preset expected event type or the control type of the control, and transmit it to the office application for processing.

[0107] Such as Figure 3 As shown in (c) in it, when the user initiates a two-finger sliding operation obliquely upward, the electronic device 100 maps the two-finger sliding operation to an upward scroll event, and the office application responds to the scroll event, and scrolls up the content of File 1 in the page display area 111 according to the sliding distance of the two-finger sliding operation in the vertical direction, so as to realize the normal scrolling of the page by the user through the two-finger sliding operation on the touchpad.

[0108] It can be seen that through the input event processing method provided by the embodiment of the present application, the electronic device can adjust the touch event input by the user through the touchpad to the event type adapted by the application, meeting the touch requirements of the user to control the electronic device through the touchpad.

[0109] The following details the processing process of the two-finger sliding operation by the electronic device 100 through the input event processing method provided by the embodiment of the present application in the Figure 3 shown application scenario.

[0110] Since a touch operation is usually composed of gestures such as pressing, moving, and lifting initiated by the user, during the process of the electronic device 100 detecting a touch operation, the electronic device 100 will generate multiple input events following the touch operation, including: down event, move event, up event. Among them, the down event indicates the start of a user gesture, the up event indicates the end of a user gesture, and the move event indicates the process of a user gesture.

[0111] That is to say, the input events generated corresponding to a user's touch operation at one time may include: one down event, multiple move events, and one up event. The electronic device 100 can identify the gesture corresponding to the user's touch operation, such as click, double-click, slide, long press, etc., through these three input events generated corresponding to one touch operation.

[0112] The input event processing method provided by the embodiments of the present application can map a two-finger slide operation to an input event adapted to the application. In a specific implementation, since the electronic device 100 generates one down event, multiple move events, and one up event corresponding from the start to the end of the user gesture during the detection of the two-finger slide operation, therefore, when the two-finger slide operation is just initiated, that is, when the electronic device 100 has only generated some input events, such as only one down event is generated, the electronic device 100 can determine the target control to which these partial input events are distributed, and record the control type of the target control during the process of the target control responding to these partial input events. Then, the electronic device 100 determines whether it is necessary to adjust the event type of the input event according to the control type. If not, the electronic device 100 can continue to generate subsequent move events and up events according to the two-finger slide operation. If necessary, it can cancel some of the previously distributed input events, and continue to generate adjusted input events according to the two-finger slide operation, and distribute the subsequently generated input events to the application for the application to process the input events, ensuring that the application can normally respond to the two-finger slide operation.

[0113] Figure 4 This is the detailed processing process of the two-finger slide operation by the electronic device 100 provided by the embodiments of the present application.

[0114] S301. The electronic device 100 first generates a down event according to the two-finger slide operation.

[0115] During the process that the electronic device 100 detects the user's two-finger slide operation through the touchpad, the electronic device 100 generates a series of input events based on the user's two-finger slide operation. Among them, the first input event generated by the electronic device 100 is the down event, and this down event represents the start of the user's current touch operation.

[0116] In the embodiments of the present application, the two-finger slide operation can also be referred to as the first input operation, and this down event can also be referred to as the second input event.

[0117] S302. The electronic device 100 distributes the down event.

[0118] Exemplarily, the electronic device 100 can monitor input events generated by the electronic device 100 through the InputReader module. After the InputReader module monitors an input event generated by the electronic device, the InputReader module will pass the input event to the InputDispatch module, and the InputDispatch module will distribute the input event, including finding the application window corresponding to the input event, passing the input event to the application, and the application distributing it to the control affected by the input event.

[0119] That is to say, after the down event is generated by the electronic device 100, the down event can be distributed through the InputDispatch module.

[0120] S303. The electronic device 100 determines whether the control to which the input event is distributed is set with the scroll event as the expected event type.

[0121] Since the electronic device 100 can know the control to which the down event is distributed after distributing the down event, the electronic device 100 can check whether the control to which the down event is distributed is set with the expected event type.

[0122] If the control to which the down event is distributed is set with the scroll event as the expected event type, the electronic device 100 executes step S308; otherwise, it executes step S304.

[0123] It can be understood that if the control to which the down event is distributed is not set with the expected event type, the event types that the control can handle by default may be the down event, move event, and up event in the sliding event. Therefore, the electronic device 100 can also execute step S and directly process according to the input events mapped by the electronic device 100 by default.

[0124] S304. The electronic device 100 obtains the control type of the control to which the input event is distributed.

[0125] Since the electronic device 100 can know the control to which the down event is distributed after distributing the down event, the electronic device 100 can obtain the control type of the control to which the input event is distributed.

[0126] It can be understood that the electronic device 100 first executes step S302 and then executes steps S303 and S304 because the electronic device 100 needs to first distribute some input events in order to find the control on which the two-finger swipe operation initiated by the user acts, so as to determine whether the control is set with the expected event type or obtain the control type of the control. It can be understood that in addition to distributing one input event, that is, the down event mentioned in step S302, the electronic device 100 can also determine whether the control is set with the expected event type or obtain the control type of the control by first sending multiple input events, such as a down event and a move event. That is to say, the embodiments of the present application do not limit the number of input events distributed by the electronic device 100 before executing steps S303 and S304.

[0127] S305. The electronic device 100 determines whether the event type adapted to the control type is a scroll event.

[0128] Among them, the electronic device 100 can preset the event types adapted to different control types.

[0129] For example, for controls with control types of listView, ScrollView, and recycleView, the event type adapted to the control is a Scroll event. For the remaining control types, such as controls with control types of editText and editorView, the event types adapted to them are down event, move event, and up event.

[0130] If the event type adapted to the control type is a scroll event, it means that the electronic device 100 needs to adjust the input events corresponding to this two-finger swipe operation, that is, execute step S308. Otherwise, it means that the electronic device 100 does not need to adjust the input events corresponding to this two-finger swipe operation, that is, execute step S306.

[0131] S306. The electronic device 100 continues to generate move events and up events according to the two-finger swipe operation.

[0132] In the case where the electronic device 100 determines that the control to which the input event is distributed is not set with the scroll event as the expected event type, or the event type adapted to the control to which the input event is distributed is not a scroll event, the electronic device 100 can continue to generate default input events according to the two-finger swipe operation of the user. That is, the electronic device 100 can continue to generate move events and up events according to this two-finger swipe operation during the detection of the two-finger swipe operation. The up event is the last input event generated by the electronic device 100 according to this two-finger swipe operation.

[0133] In the embodiments of the present application, the subsequently generated move event and up event can also be referred to as the third input event.

[0134] S307. The electronic device 100 distributes the move event and the up event.

[0135] Exemplarily, after generating the move event and the up event, the electronic device 100 can distribute the move event and the up event through the InputDispatch module.

[0136] S308. The electronic device 100 issues a cancel event.

[0137] Among them, the electronic device 100 can issue a cancel event to the control that has been issued with the input event when it is determined that the control to which the input event is distributed is set with a scroll event as the expected event type, or when it is determined that the event type adapted by the control to which the input event is distributed is a scroll event. This cancel event is used to cancel the input events that have been issued by the electronic device 100 during this two-finger swipe operation.

[0138] S309. The electronic device 100 converts the input events subsequently generated according to the two-finger swipe operation into scroll events.

[0139] Since before the two-finger swipe operation ends, the electronic device 100 will still continue to generate move events and up events according to this two-finger swipe operation. Therefore, after the electronic device 100 issues a cancel event, the input events subsequently generated according to this two-finger swipe operation can be converted into scroll events. In this way, the two-finger swipe operation initiated by the user can be converted into an input event adapted by the application.

[0140] It can be understood that in addition to converting the input events generated by the electronic device 100 according to the two-finger swipe operation into scroll events, the electronic device 100 can also directly map the swipe operation to a scroll event, saving the trouble of the electronic device 100 converting the input events.

[0141] In the embodiments of the present application, one or more scroll events converted by the electronic device 100 can also be referred to as the first input event.

[0142] S310. The electronic device 100 distributes the scroll event.

[0143] Exemplarily, after obtaining the scroll event, the electronic device 100 can distribute the scroll event through the InputDispatch module.

[0144] S311. The electronic device 100 processes the input events distributed by the application.

[0145] After the electronic device 100 distributes the input events to the corresponding application, the application can respond to the input events through the controls and execute the corresponding functions. Among them, before the electronic device 100 receives the two-finger swipe operation, the electronic device 100 can display the page of the application. If the input event is a scroll event, when the electronic device 100 processes the input events distributed by the application, it can be manifested as the electronic device 100 scrolling to display the page of the application.

[0146] It should be understood that after the electronic device 100 distributes the input events to the application, the application can respond to the input event through the control, without waiting until all the input events corresponding to the two-finger swipe operation are distributed before executing. That is to say, the order of appearance of step S311 and other steps does not constitute the order of execution of step S311 and other steps. Step S311 can be executed after any step of the electronic device 100 distributing the input events until the application finishes processing all the input events distributed to it.

[0147] For a better understanding of the execution process of steps S301 - S311, Figure 5 the following is the processing timing diagram of the two-finger swipe operation provided by the embodiment of the present application.

[0148] Among them, Figure 5 (a) in shows the processing timing diagram of the two-finger swipe operation by the electronic device 100 without using the input event processing method provided by the embodiment of the present application.

[0149] As Figure 5 shown in (a), if the electronic device 100 does not adjust the input events, the electronic device 100 will successively and continuously distribute multiple input events to the application during the process of the user initiating the two-finger swipe operation: down event, move event,..., move event, up event, so that the application processes these multiple input events.

[0150] In addition, Figure 5 (b) in shows the processing timing diagram of the two-finger swipe operation by the electronic device 100 when using the input event processing method provided by the embodiment of the present application.

[0151] Combining Figure 5 (a) and (b) in, if the electronic device 100 needs to adjust the input events, the electronic device 100 will delete the input events that have been sent during this two-finger swipe operation, such as the down event, and then convert the subsequent generated move events and up events into scroll events. In this way, the events obtained by the application are all adjusted input events.

[0152] From Figure 5 As can be seen, during the process of the user initiating a two-finger swipe operation, the electronic device 100 can first use the few input events generated by default at first to "detect", that is, determine the expected event type of the control or determine the control type of the control, so as to judge whether it is necessary to adjust the input event type. In the case of determining that it is necessary to adjust the input event type, then adjust the input events generated by the subsequent electronic device 100. Since the time interval between the generation of the two input events is very short and the user can hardly perceive it, the method provided by the embodiments of the present application can well improve the touch experience of the user when controlling the application, meet the user's control requirements for various applications through the input device, and at the same time, the application developer does not need to adjust the application in order for the application to adapt to the input device, reducing the workload of the application developer.

[0153] Figure 6 FIG. 7 is a schematic hardware structure diagram of the electronic device 100 provided by the embodiments of the present application.

[0154] The electronic device 100 may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, as well as a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, a vehicle-mounted device, a smart home device, and / or a smart city device. The embodiments of the present application do not impose special restrictions on the specific type of the electronic device.

[0155] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0156] It can be understood that the structure schematically shown in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figures, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figures may be implemented in hardware, software, or a combination of software and hardware.

[0157] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.

[0158] In some embodiments, the processor 110 may be configured to map an input operation to an input event after detecting the input operation, and control the application to process the input event. Moreover, in the embodiments of the present application, the processor 110 is further configured to record the control type of the control affected by the input event during the process of the application processing the input event, and adjust the type of the input event according to the control type, etc.

[0159] The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0160] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory may save the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0161] The wireless communication function of the electronic device 100 may be implemented by the antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modulation and demodulation processor, and baseband processor, etc.

[0162] The antenna 1 and the antenna 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example: The antenna 1 can be multiplexed as the diversity antenna of the wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0163] The mobile communication module 150 may provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc. applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 may receive electromagnetic waves by the antenna 1, filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modulation and demodulation processor and convert it into electromagnetic waves through the antenna 1 for radiation. In some embodiments, at least some functional modules of the mobile communication module 150 may be provided in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be provided in the same device.

[0164] The modulation and demodulation processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. Subsequently, the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays an image or video through the display screen 194. In some embodiments, the modulation and demodulation processor may be an independent device. In other embodiments, the modulation and demodulation processor may be independent of the processor 110 and be provided in the same device as the mobile communication module 150 or other functional modules.

[0165] The wireless communication module 160 may provide solutions for wireless communications applied to the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite systems (GNSSs), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, demodulates and filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive the signals to be transmitted from the processor 110, frequency-modulate and amplify them, and convert them into electromagnetic waves via the antenna 2 for radiation.

[0166] The electronic device 100 realizes the display function through the GPU, the display screen 194, and the application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to execute mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change the display information.

[0167] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some embodiments, the electronic device may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0168] In some embodiments, the display screen 194 can be used to display the user interface of an application, as well as the changed user interface after the application responds to user-initiated input operations, etc. For details, please refer to the foregoing Figure 3 .

[0169] The electronic device 100 can implement the shooting function through the ISP, camera 193, video codec, GPU, display screen 194, application processor, etc.

[0170] The internal memory 121 can include one or more random access memories (RAM) and one or more non-volatile memories (NVM).

[0171] In some embodiments, the internal memory 121 can be used to store input events generated based on input operations, the control types of the controls on which the input events act, and the input event types adapted to different control types.

[0172] The random access memory can be directly read and written by the processor 110. It can be used to store the operating system or the executable programs (such as machine instructions) of other running programs, and can also be used to store the data of users and application programs, etc.

[0173] The non-volatile memory can also store executable programs and store the data of users and application programs, etc. It can be pre-loaded into the random access memory for the processor 110 to directly read and write.

[0174] The touch sensor 180K, also known as the "touch control device". The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also known as the "touch control screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can transmit the detected touch operations to the application processor to determine the touch event type. Visual output related to the touch operation can be provided through the display screen 194. In some other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, at a different position from the display screen 194.

[0175] In the embodiments of the present application, the electronic device 100 can include or be connected to a keyboard. The input operation acting on the electronic device 100 can refer to an operation on the touchpad of the keyboard, such as a two-finger sliding operation. Exemplarily, the electronic device 100 can refer to devices such as a tablet computer, a notebook computer, a desktop computer, etc.

[0176] The electronic device can be a portable terminal device running Harmony, iOS, Android, Microsoft or other operating systems, such as a mobile phone, a tablet computer, a wearable device, etc., or a non-portable terminal device such as a laptop computer with a touch-sensitive surface or a touch panel, or a desktop computer with a touch-sensitive surface or a touch panel. The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In the embodiments of the present invention, taking the Android system with a layered architecture as an example, the software structure of the electronic device 100 will be exemplarily described.

[0177] Figure 7 It is the software structure block diagram of the electronic device 100 in the embodiments of the present application.

[0178] The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, which are the application layer, the application framework layer, the Android runtime and the system libraries, and the kernel layer.

[0179] The application layer may include a series of application packages.

[0180] As Figure 7 shown, the application packages may include applications such as a camera, a gallery, a calendar, a call, a map, a navigation, a WLAN, a Bluetooth, music, a video, a short message, etc.

[0181] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions.

[0182] As Figure 7 shown, the application framework layer may include a window manager, a content provider, a view system, a telephone manager, a resource manager, a notification manager, etc.

[0183] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0184] The content provider is used to store and obtain data, and make this data accessible to applications. The data may include videos, images, audio, dialed and received calls, browsing history and bookmarks, a phone book, etc.

[0185] The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a short message notification icon can include a view for displaying text and a view for displaying pictures.

[0186] The phone manager is used to provide the communication functions of the electronic device 100. For example, the management of call states (including answering, hanging up, etc.).

[0187] The resource manager provides various resources for applications, such as localized strings, icons, pictures, layout files, video files, and so on.

[0188] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages, which can automatically disappear after a short stay without user interaction. For example, the notification manager is used to inform that the download is completed, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as the notification of a background-running application, or a notification that appears in the form of a dialogue window on the screen. For example, it prompts text information in the status bar, emits a prompt sound, the electronic device vibrates, the indicator light flashes, etc.

[0189] Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for the scheduling and management of the Android system.

[0190] The core libraries contain two parts: one part is the functional functions that need to be called by the Java language, and the other part is the core libraries of Android.

[0191] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0192] The system libraries can include multiple functional modules. For example: surface manager, Media Libraries, 3D graphics processing library (such as: OpenGL ES), 2D graphics engine (such as: SGL), etc.

[0193] The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.

[0194] The media library supports the playback and recording of multiple common audio and video formats, as well as static image files, etc. The media library can support multiple audio and video coding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0195] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc.

[0196] The 2D graphics engine is a drawing engine for 2D drawing.

[0197] The kernel layer is the layer between hardware and software. The kernel layer at least includes a display driver, a camera driver, an audio driver, and a sensor driver.

[0198] The following combines the capture and photo-taking scenario to exemplarily illustrate the working processes of the software and hardware of the electronic device 100.

[0199] When the touch sensor 180K receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including information such as touch coordinates and the timestamp of the touch operation). The raw input event is stored in the kernel layer. The application framework layer obtains the raw input event from the kernel layer and identifies the control corresponding to the input event. Taking the touch operation as a touch click operation and the control corresponding to the click operation as the control of the camera application icon as an example, the camera application calls the interface of the application framework layer to start the camera application, and then starts the camera driver by calling the kernel layer to capture a static image or video through the camera 193.

[0200] It should be understood that the steps in the above method embodiments can be completed by the integrated logic circuit of the hardware in the processor or the instructions in software form. The method steps disclosed in combination with the embodiments of the present application can be directly embodied as being executed and completed by the hardware processor, or executed and completed by the combination of the hardware and software modules in the processor.

[0201] The present application also provides an electronic device, which may include: a memory and a processor. Among them, the memory can be used to store a computer program; the processor can be used to call the computer program in the memory so that the electronic device executes the method executed by the electronic device 100 in any one of the above embodiments.

[0202] The present application also provides a chip system, and the chip system includes at least one processor for implementing the functions involved in the method executed by the electronic device 100 in any one of the above embodiments.

[0203] In a possible design, the chip system further includes a memory, and the memory is used to save program instructions and data, and the memory is located inside or outside the processor.

[0204] The chip system can be composed of chips, or can include chips and other discrete devices.

[0205] Optionally, the processor in the chip system can be one or more. The processor can be implemented by hardware or by software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented by software, the processor can be a general-purpose processor that implements functions by reading software code stored in a memory.

[0206] Optionally, the memory in the chip system can also be one or more. The memory can be integrated with the processor or can be separately provided from the processor, which is not limited in the embodiments of the present application. Exemplarily, the memory can be a non-transitory processor, such as a read-only memory (ROM), which can be integrated with the processor on the same chip or can be separately provided on different chips. The embodiments of the present application do not specifically limit the type of the memory and the setting manner of the memory and the processor.

[0207] Exemplarily, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processing unit (CPU), a network processor (NP), a digital signal processing circuit (DSP), a microcontroller unit (MCU), a programmable logic device (PLD), or other integrated chips.

[0208] The present application also provides a computer program product, which includes: a computer program (which can also be referred to as code or instruction). When the computer program is run, it causes a computer to execute the method performed by any one of the electronic devices 100 in any one of the above embodiments.

[0209] The present application also provides a computer-readable storage medium, which stores a computer program (which can also be referred to as code or instruction). When the computer program is run, it causes a computer to execute the method performed by any one of the electronic devices 100 in any one of the above embodiments.

[0210] It should be understood that the processor in the embodiments of the present application may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method embodiments can be completed by the integrated logic circuit in the hardware of the processor or instructions in the form of software. The above-mentioned processor may be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as being executed and completed by the hardware decoding processor, or executed and completed by a combination of the hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the steps of the above method.

[0211] In addition, the embodiments of the present application further provide a device. The device may specifically be a component or a module. The device may include one or more processors and a memory connected to each other. Among them, the memory is used to store a computer program. When the computer program is executed by one or more processors, the device is caused to execute the methods in the above method embodiments.

[0212] Among them, the device, computer-readable storage medium, computer program product, or chip provided in the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved by them can refer to the beneficial effects in the corresponding methods provided above, and will not be elaborated here.

[0213] The various embodiments of the present application can be combined arbitrarily to achieve different technical effects.

[0214] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in this application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (such as coaxial cable, fiber optic, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that the computer can access or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state disk (SSD)), etc.

[0215] Those of ordinary skill in the art can understand that all or part of the processes in the above method embodiments can be completed by relevant hardware instructed by a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above method embodiments. The foregoing storage media include: various media such as ROM or random access memory RAM, magnetic disks, or optical discs that can store program codes.

[0216] In summary, the above are only embodiments of the technical solutions of the present invention and are not used to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made based on the disclosure of the present invention should be included within the protection scope of the present invention.

Claims

1. An input event processing method, characterized in that, The method includes: The electronic device detects a first input operation acting on a first application; The electronic device generates a first input event according to the first input operation, where the event type of the first output event corresponds to the control type of a first control on which the first output event acts, or the first input event belongs to an event type preset by the first application for the first control; The electronic device processes the first input event through the first application.

2. The method according to claim 1, wherein The event type of the first output event corresponds to the control type of the first control on which the first output event acts. The electronic device generating a first input event according to the first input operation specifically includes: In a case where the first application does not preset an event type for the first control, the electronic device generates a first input event according to the first input operation and the control type of the first control.

3. The method according to claim 1 or 2, characterized in that, Event types corresponding to different control types are stored in the electronic device.

4. The method according to any one of claims 1 to 3, characterized in that, Before the electronic device generates a first input event according to the first input operation, the method further includes: The electronic device determines that the control on which the first input operation acts is the first control.

5. The method according to claim 4, characterized in that, The first input event is determined according to the control type of the first control on which the first input operation acts. After the electronic device determines that the control on which the first input operation acts is the first control and before generating a first input event according to the first input operation, the method further includes: The electronic device obtains the control type of the first control fed back by the first application.

6. The method according to claim 4 or 5, characterized in that, The first input operation is a touch operation. After the electronic device detects a first input operation acting on a first application, the method further includes: During the process of the user initiating the first input operation, the electronic device generates a second input event, and the second input event includes one or more touch events; The electronic device determining that the control on which the first input operation acts is the first control specifically includes: The electronic device determines that the control on which the first input operation acts is the first control by distributing the second input event.

7. The method according to claim 6, characterized in that, After the electronic device generates a second input event, the method further includes: During the process of the user initiating the first input operation, the electronic device generates a third input event, and the third input event includes one or more touch events; The electronic device mapping the first input operation to a first input event specifically includes: The electronic device deletes the second input event and converts the third input event into the first input event.

8. The method according to claim 6 or 7, characterized in that The second input event and the third input event form a single-finger swipe event.

9. The method according to any one of claims 1-8, characterized in that, The electronic device includes or is connected to a keyboard, the first input operation is a two-finger swipe operation on a touchpad of the keyboard, and the first input event includes one or more mouse scroll events.

10. The method according to claim 9, wherein Before the electronic device detects a first input operation acting on a first application, the method further includes: The electronic device displays a first page of the first application; The electronic device processing the first input event through the first application specifically includes: In response to the first input event, the electronic device scrolls to display a first page of the first application.

11. An electronic device, characterized in that, Comprising a memory, one or more processors, and one or more programs; when the one or more processors execute the one or more programs, the electronic device is caused to implement the method according to any one of claims 1 to 10.

12. A computer-readable storage medium, comprising instructions, characterized in that, When the instruction runs on the electronic device, the electronic device is caused to execute the method according to any one of claims 1 to 10.