A system key processing method and device, electronic equipment and storage medium
By pre-processing key events on smart terminals and processing them according to input device identifiers and priority logic, the problem of scattered and rigid key processing logic is solved, realizing unified processing and flexible configuration of key events, and improving the system's response consistency and scalability.
Patent Information
- Application Number
- CN202611320193.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-28
- Publication Date
- 2026-11-03
AI Technical Summary
In existing technologies, the button processing logic of smart terminals is scattered and lacks a unified processing entry point. This results in a lack of priority relationship between processing logic when the same button event meets multiple conditions, leading to duplicate responses or conflicts. Unnecessary button events consume resources, and the relationship between button events and actions is fixed in the program code, making it difficult to configure flexibly, which affects system expansion and maintenance.
Before a key event enters the system's default dispatch process, the system determines whether the input device is a preset target device by obtaining the input device identifier. Multiple key processing operations are executed according to preset priorities, including rule matching and callback query. Low-priority processing is terminated after the high-priority processing is determined. The triggering conditions and action relationships of key events are stored in configuration data outside the system service and support dynamic updates.
It achieves a unified entry point for key processing, reduces redundant processing and conflicts, improves the consistency and flexibility of key response, reduces resource consumption of non-target device events, reduces system maintenance complexity, and improves the configurability and decoupling of key rules.
Smart Images

Figure CN123030085A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of smart terminal input event processing technology, and in particular to a system key processing method, device, electronic device, and computer-readable storage medium. Background Technology
[0002] As smart terminals become increasingly feature-rich, terminals such as conference tablets, educational whiteboards, smart display devices, and smart TVs typically need to receive key events generated by remote controls, physical keypads, virtual key devices, external keyboards, and other input devices, and execute corresponding system or application functions based on these key events.
[0003] In some existing system input event handling schemes, key events generated by input devices are typically sent to the current application or corresponding system components according to the distribution mechanism pre-set by the operating system. Different types of key handling logic, such as ordinary hotkey handling, combination key handling, action key handling corresponding to different press durations, and key interception handling for specific business modules, may be set in different processing modules.
[0004] As terminal systems support more button functions and require more customized services, the aforementioned decentralized button processing approach is prone to duplicate judgments between different processing modules, making it difficult to establish a unified and clear processing order. When the same button event simultaneously meets multiple processing conditions, such as system state restrictions, combination key rules, action key rules, or ordinary hotkey rules, the lack of a clear priority relationship between different processing logics may lead to the same button event being processed repeatedly by multiple processing modules, or conflicts between different processing results, thereby reducing the determinism of the button response result.
[0005] On the other hand, key events generated by different input devices can often enter the same or similar system input processing links. For example, when a smart terminal is simultaneously connected to a remote control, keypad, barcode scanner, or ordinary external keyboard, key events generated by input devices that do not need to participate in specific system key processing may still enter the subsequent complex key judgment process, causing unnecessary processing overhead.
[0006] Furthermore, different terminal products, customer projects, or application scenarios may have different button function requirements. If the correspondence between the triggering conditions of button events and specific business actions is directly fixed in the system service program or system framework code, then when the button behavior changes, it is usually necessary to modify the corresponding program code and recompile, re-release, or verify it, thereby increasing the complexity of system maintenance and version management.
[0007] Therefore, it is necessary to provide a system key processing solution that can perform unified processing before key events enter the system's default distribution process, and can determine the subsequent processing method of key events by combining the input device source, configuration rules, processing priority, and consumption results returned by the target processing module. Summary of the Invention
[0008] This application provides a system key processing method, apparatus, electronic device, and storage medium, which solves the technical problems in existing key processing solutions, such as: scattered key processing logic of different types; lack of a unified key event processing entry point; lack of clear priority arbitration relationship between different processing logics when the same key event meets multiple processing conditions, which easily leads to duplicate responses or processing conflicts; key events generated by input devices from different sources entering the same processing link, causing key events generated by input devices that do not need to perform customized key processing to occupy subsequent processing resources; the relationship between the triggering conditions of key events and the corresponding actions being fixed in the program code, which is not convenient for configuration or updates according to different application scenarios; and the high degree of coupling between key recognition and rule processing logic and specific business execution logic, which is not conducive to system expansion and maintenance.
[0009] To achieve the above objectives, this application adopts the following technical solution: Firstly, a system key processing method is provided, including: The key event is acquired before it enters the system's default dispatch process; Obtain the input device identifier corresponding to the key event, and determine whether the input device that generated the key event belongs to the preset target device based on the input device identifier; if the input device does not belong to the preset target device, hand the key event over to the system default dispatch process for processing; When the input device belongs to the preset target device, multiple key processing operations are performed on the key event in sequence according to the preset priority. The multiple key processing operations include at least a rule matching operation performed based on the configuration rules and a callback query operation initiated to the target processing module. If the current key processing operation determines that the key event has been consumed, terminate the execution of key processing operations with a lower priority than the current key processing operation. If the rule matching operation matches the configuration rule corresponding to the key event, the action identifier corresponding to the key event is determined according to the matched configuration rule; The action identifier and the key information corresponding to the key event are sent to the target processing module, and the consumption result returned by the target processing module is obtained; Based on the consumption result, the key event can be intercepted, or the key event can be handed over to the system's default distribution process for further processing.
[0010] In conjunction with the first aspect described above, in one possible implementation, determining whether the input device generating the key event belongs to a preset target device based on the input device identifier includes: Obtain the device name of the input device; Match the device name with a preset set of target device names; If the device name matches at least one device name in the preset target device name set, the input device is determined to belong to the preset target device.
[0011] In conjunction with the first aspect described above, in one possible implementation, the preset target device name set includes at least one of the device names corresponding to virtual key devices, keypad devices, and remote control devices.
[0012] In conjunction with the first aspect described above, in one possible implementation, determining whether the input device generating the key event belongs to a preset target device based on the input device identifier includes: Obtain the device manufacturer identifier and device product identifier of the input device; The device identifier combination consisting of the device manufacturer identifier and the device product identifier is matched with a preset target device identifier set; If the device identifier combination matches the target device identifier combination in the preset target device identifier set, the input device is determined to belong to the preset target device.
[0013] In conjunction with the first aspect described above, in one possible implementation, the configuration rules are stored in configuration data outside of system services, and the configuration data is at least used to characterize the mapping relationship between the triggering conditions of key events and action identifiers.
[0014] The configuration data is loaded when the system starts up, and the configuration rules are stored in the rule matching cache.
[0015] In conjunction with the first aspect described above, in one possible implementation, the configuration data includes at least one of hotkey configuration data, combination key configuration data, and behavior key configuration data.
[0016] Each configuration rule includes a key code field, a device source field, a trigger condition field, and an action identifier field.
[0017] The rule matching operation determines the action identifier corresponding to the key event based on at least two of the key code, device source, and triggering conditions.
[0018] In conjunction with the first aspect described above, in one possible implementation, it further includes: Listen for configuration change notifications corresponding to the configuration data; In response to the configuration change notification, retrieve the updated configuration data from the storage layer; The rule matching cache is updated according to the updated configuration data so that subsequent key events are matched according to the updated configuration rules.
[0019] In conjunction with the first aspect described above, in one possible implementation, multiple key processing operations are performed on the key events sequentially according to a preset priority, including sequentially executing: The system lock state detection operation is used to intercept the key events when the system is in a preset lock state; The first callback query operation is used to initiate a first-priority callback query to the target processing module, and terminate the subsequent key processing operation when the target processing module determines to consume the key event; The key combination matching operation is used to perform key combination sequence matching on the key events according to preset key combination rules. The power button processing operation is used to perform debouncing when the power button is pressed in the corresponding key event. The second callback query operation is used to initiate a second-priority callback query to the target processing module, and terminate the subsequent key processing operation when the target processing module determines that the key event has been consumed. The behavior key matching operation is used to match corresponding behavior key rules based on the press behavior of the key event; and The hotkey matching operation is used to match the corresponding hotkey rules based on the key events.
[0020] The first callback query operation has a higher priority than the second callback query operation.
[0021] In conjunction with the first aspect described above, in one possible implementation, the behavior key matching operation includes: Determine the press duration corresponding to the key event; If the press duration is less than a first duration threshold, the button event is determined to correspond to a first press action; If the press duration is greater than or equal to the first duration threshold and less than the second duration threshold, the button event is determined to correspond to the second press behavior. If the press duration is greater than or equal to the second duration threshold, the button event is determined to correspond to a third press action; The action identifier is determined based on the matched action key rule according to the determined press action.
[0022] In conjunction with the first aspect described above, in one possible implementation, the key matching operation includes: Maintain the key sequence buffer; The key codes corresponding to multiple key events acquired within a preset time window are stored in the key sequence buffer in the order of input. Match the key code sequence in the key sequence buffer with the pre-stored combination key sequence; If the key code sequence matches the key combination sequence, the key combination action identifier is determined according to the configuration rules corresponding to the key combination sequence.
[0023] In conjunction with the first aspect described above, in one possible implementation, the consumption outcome includes complete consumption, no consumption, and conditional consumption.
[0024] If the consumption result is complete consumption, the key press event is intercepted.
[0025] If the consumption result is no consumption, the key event will be handed over to the system's default dispatch process for further processing.
[0026] If the consumption result is conditional consumption, the current system state is obtained, and based on whether the current system state meets the preset state conditions corresponding to the conditional consumption, it is determined whether to intercept the key event or hand the key event over to the system default distribution process for further processing.
[0027] In conjunction with the first aspect described above, in one possible implementation, the key information includes at least one of the key code corresponding to the key event, the input device type, and the input device name, as well as the action identifier.
[0028] The target processing module includes at least one of an application, a system service process, a dynamically loaded module, or a remotely bound service.
[0029] Secondly, this application also provides a system key processing device, comprising: The event acquisition module is used to acquire the key event before the key event enters the system's default distribution process; The device filtering module is used to obtain the input device identifier corresponding to the key event, determine whether the input device that generated the key event belongs to the preset target device based on the input device identifier, and if the input device does not belong to the preset target device, hand the key event over to the system default distribution process for processing. The hierarchical arbitration module is used to, when the input device belongs to the preset target device, sequentially call multiple key processing modules to process the key event according to a preset priority, and stop calling key processing modules with a lower priority than the current key processing module when the current key processing module determines that the key event has been consumed; The rule processing module is used to perform rule matching on the key event according to the configuration rules, and determine the corresponding action identifier when the configuration rule corresponding to the key event is matched; The communication module is used to initiate a callback query to the target processing module, and to send the action identifier and the key information corresponding to the key event to the target processing module and obtain the consumption result returned by the target processing module; and The distribution control module is used to determine whether to intercept the key event based on the consumption result, or to hand over the key event to the system's default distribution process for further processing.
[0030] In conjunction with the second aspect described above, in one possible implementation, the rule processing module includes a configuration loading unit, a combination key matching unit, a behavior key matching unit, and a hotkey matching unit.
[0031] The configuration loading unit is used to obtain configuration data and establish a rule matching cache.
[0032] The key combination matching unit, the behavior key matching unit, and the hotkey matching unit are respectively used to obtain the corresponding type of configuration rules from the rule matching cache and perform corresponding rule matching on the key event.
[0033] The hierarchical arbitration module calls at least one of the combination key matching unit, the behavior key matching unit, and the hotkey matching unit according to the preset priority.
[0034] Thirdly, this application also provides an electronic device, including a processor and a memory.
[0035] The memory stores a computer program, and the processor executes the computer program to enable the electronic device to perform any of the above-described system key processing methods.
[0036] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the processor performs any of the above-described system key processing methods.
[0037] Beneficial effects: 1. This application obtains key events before they enter the system's default distribution process and determines the target device for the input device that generated the key event, thus forming a unified pre-processing entry point for key events. Key events generated by devices other than the preset target device can be directly handled by the system's default distribution process, thereby reducing the likelihood of key events from non-target devices entering subsequent complex processing links.
[0038] 2. This application executes multiple key processing operations sequentially according to preset priorities, and terminates the execution of low-priority processing operations after the current high-priority processing operation determines that the key event has been consumed. This can reduce the possibility of the same key event being processed repeatedly by multiple processing logics or causing processing conflicts, and improve the certainty and consistency of key processing results.
[0039] 3. This application establishes a unified arbitration mechanism for different types of key processing logic by setting up processing operations with preset priority relationships, such as system lock state detection, first callback query, combination key matching, power key processing, second callback query, behavior key matching, and hotkey matching.
[0040] 4. This application reduces the coupling between key rules and system service program code by setting the mapping relationship between the triggering conditions of key events and the action identifier in the configuration data outside the system service and loading it into the rule matching cache when the system starts.
[0041] 5. This application improves the configurability and update flexibility of key rules by listening to configuration change notifications corresponding to configuration data and using the updated configuration data to update the matching cache. This enables subsequent key events to be matched according to the updated configuration rules.
[0042] 6. This application enables the same key code to correspond to different action identifiers under different input device sources or different trigger conditions by matching at least two of the key code, device source, and trigger condition, thereby improving the expressive power of key configuration.
[0043] 7. This application decouples the key event recognition and rule processing logic from the specific target processing logic by sending the action identifier and key information to the target processing module and controlling whether the key event continues to enter the system default distribution process based on the consumption result returned by the target processing module.
[0044] 8. By setting consumption results such as full consumption, no consumption, and conditional consumption, this application can further control the distribution method of key events in combination with the processing results of the target processing module and the current state of the system, thereby improving the flexibility of key event processing. Attached Figure Description
[0045] Figure 1 This is a schematic diagram of the overall architecture of a system key processing device provided in an embodiment of this application.
[0046] Figure 2 This is a schematic diagram of the overall flow of a system key processing method provided in an embodiment of this application.
[0047] Figure 3 This is a schematic diagram of a hierarchical arbitration method for button processing provided in an embodiment of this application.
[0048] Figure 4 This is a schematic diagram of a configuration rule and consumption control interaction provided in an embodiment of this application.
[0049] Attached label: 110—Input device and key events; 120—Event acquisition and device filtering module; 130—Hierarchical arbitration and rule processing module; 140—Configuration data and rule matching cache; 150 – Communication and target processing module; 160 – Distribution control and system default distribution process; 201 – Intercept key events; 202 – System default distribution process; 301 – System lock status detection operation; 302 – First callback query operation; 303 – Combination key matching operation and power button processing operation; 304 – Second callback query operation; 305 – Behavior key matching operation; 306 – Hotkey matching operation; 401 – Key events and key information; 402 – Rule processing module; 403 – Target processing module; 404 – Configuration data; 405 – Rule matching cache; 406 – Distribution control module. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0051] It should be understood that the described embodiments are merely some, not all, of the embodiments in this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.
[0052] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the embodiments of this application. The singular forms “a,” “the,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0053] In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims. In the description of this application, it should be understood that the terms "first," "second," "third," etc., are used only to distinguish similar objects and are not necessarily used to describe a specific order or sequence, nor should they be construed as indicating or implying relative importance. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0054] Furthermore, in the description of this application, unless otherwise stated, "multiple" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0055] The system key processing method provided in this embodiment can be executed by a system key processing device. This device can be implemented through software and / or hardware. The system key processing device can consist of two or more physical entities, or it can consist of a single physical entity. The system key processing device can be any electronic device with data processing software installed, such as a computer, mobile phone, tablet, or interactive whiteboard, or other smart device.
[0056] For ease of understanding, the embodiments use an interactive flat panel as an example to describe the system button processing. The interactive flat panel can be an integrated device that uses touch technology to control content displayed on a flat panel and achieve human-computer interaction. It integrates one or more functions such as a projector, electronic whiteboard, screen, speakers, television, and video conferencing terminal.
[0057] Generally, an interactive flat panel includes at least one display screen. For example, an interactive flat panel may have a touch-enabled display screen, which can be resistive, capacitive, infrared, electromagnetic, or surface acoustic wave (SAW) type. In one embodiment, a user can perform touch operations by touching the display screen with their finger or a stylus. The interactive flat panel detects the touch location and determines a response scheme based on the corresponding display content, thus implementing the touch function. For example, if the touch location indicates that the corresponding display content is a control for a specific function, the response scheme is to execute that function. It is understood that in practical applications, users can also perform control operations using a keyboard, mouse, physical buttons, etc.
[0058] Typically, an interactive flat panel is equipped with at least one operating system, including but not limited to Android, Linux, and Windows. In one embodiment, the interactive flat panel can install at least one application based on the operating system; for example, it may have an electronic whiteboard application with drawing capabilities. This application can be a built-in application of the operating system or an application downloaded from a third-party device or server. The touch data compression device can also be the application itself. Optionally, in addition to drawing capabilities, the application may also have other editing functions, such as writing, inserting tables, inserting images, inserting multimedia, inserting graphics, and drawing tables.
[0059] The interactive flat panel may include one or more processing cores, which can implement the system key processing method of this application through pure software or through a combination of software and hardware. For example, it can be implemented using at least one hardware form selected from digital signal processing, field-programmable gate arrays, and programmable logic arrays. It can integrate one or more of the following: a central processing unit, an image processor, and a modem. The interactive flat panel can run an application program for the system key processing method. The application program can be presented in a form adapted to the interactive flat panel, such as an APP application. In some examples, it can also be presented in the form of system plugins, web page plugins, etc.
[0060] Example 1 This embodiment provides a system key processing device and a general key event processing method implemented based on the device.
[0061] See Figure 1 The system key processing device may include an input device and key event 110, an event acquisition and device filtering module 120, a hierarchical arbitration and rule processing module 130, a configuration data and rule matching cache 140, a communication and target processing module 150, and a distribution control and system default distribution process 160.
[0062] Input devices may include virtual key devices, keypad devices, remote control devices, and other input devices capable of generating key events.
[0063] After an input device generates a key event, the key event first reaches the event acquisition and device filtering module 120.
[0064] The event acquisition and device filtering module 120 is located before the system default distribution process, enabling the system to obtain the current key event before the key event enters the system default distribution process.
[0065] The event acquisition and device filtering module 120 acquires the input device identifier corresponding to the key event, and determines whether the input device that generated the current key event belongs to the preset target device based on the input device identifier.
[0066] When the input device does not belong to the preset target device, the event acquisition and device filtering module 120 sends the current key event to the distribution control and system default distribution process 160, so that the key event continues to be distributed according to the original system processing mechanism.
[0067] When the input device belongs to the preset target device, the event acquisition and device filtering module 120 sends the current key event to the hierarchical arbitration and rule processing module 130.
[0068] The hierarchical arbitration and rule processing module 130 performs multiple key processing operations on the current key event according to the preset priority.
[0069] The multiple button processing operations include at least rule matching operations and callback query operations, and may also include system lock status detection, power button processing, and other operations.
[0070] Configuration data and rule matching cache 140 is used to provide configuration rules to the rule processing process.
[0071] Configuration data can be set outside of system services. When the system starts, it can retrieve the configuration data and load the corresponding configuration rules into the rule matching cache.
[0072] During system operation, it can also respond to configuration change notifications and update rule matching cache.
[0073] When the hierarchical arbitration and rule processing module 130 performs rule matching, it obtains the corresponding configuration rules from the rule matching cache and uses the information corresponding to the current key event for matching.
[0074] When the configuration rule is matched, the action identifier corresponding to the current key event is determined.
[0075] The communication and target processing module 150 is used to realize information interaction between the system key processing device and the target processing module.
[0076] For example, when performing a callback query operation, you can send query information to the target processing module and obtain the query result returned by the target processing module as to whether the current key event has been consumed.
[0077] After obtaining the action identifier, the action identifier and the key information corresponding to the current key event can be sent to the target processing module, and the consumption result returned by the target processing module can be obtained.
[0078] Distribution control and system default distribution process 160: Determine whether to continue distributing the current key event based on the corresponding processing result.
[0079] When the current key event needs to be intercepted, it will not be allowed to enter the system's default dispatch process; when the current key event does not need to be intercepted, it will be handed over to the system's default dispatch process for further processing.
[0080] The above structure allows for the establishment of a unified key event handling chain before the system's default distribution process.
[0081] Example 2 This embodiment combines Figure 2 Explain the overall process of the system's key press handling method.
[0082] In step S101, the key event is acquired before the key event enters the system default dispatch process.
[0083] Specifically, after an input device generates a key event, the key event is obtained in the system input event processing chain before the system default key distribution operation.
[0084] Therefore, key events that require system-level processing can be processed before they are sent to regular applications or other system components.
[0085] In step S102, the input device identifier corresponding to the current key event is obtained, and it is determined whether the input device that generated the current key event belongs to the preset target device based on the input device identifier.
[0086] In one implementation, the device name of the input device is obtained based on the input device identifier.
[0087] The system pre-stores a set of preset target device names. The set of preset target device names may include at least one of the following: device names corresponding to virtual key devices, device names corresponding to keypad devices, and device names corresponding to remote control devices.
[0088] Match the device name of the current input device with the preset target device name set.
[0089] If the current device name matches at least one device name in the preset target device name set, then the current input device is determined to belong to the preset target device.
[0090] If the current device name does not match any of the device names in the preset target device name set, then it can be determined that the current input device does not belong to the preset target device.
[0091] For example, in a terminal, the device's keypad, the remote control used with the terminal, and the virtual key devices that generate virtual key events can be set as target devices, while other input devices that do not require system-customized key processing can be excluded from the target device set.
[0092] It should be noted that the above device types are only examples, and the specific target device set can be determined based on the terminal device and application scenario.
[0093] In another implementation, the device manufacturer's identifier and the device product identifier of the input device can be obtained.
[0094] The device manufacturer's identifier and the device product identifier together constitute the device identifier combination corresponding to the current input device.
[0095] The system pre-sets a set of target device identifiers, where each set of target device identifiers may include the corresponding device manufacturer identifier and the device product identifier.
[0096] Match the device identifier combination of the current input device with each target device identifier combination in the target device identifier set.
[0097] When the two match, it is determined that the current input device belongs to the preset target device.
[0098] Compared to making a judgment based solely on the equipment name, a combination of equipment manufacturer identification and equipment product identification can be used to further distinguish equipment models or equipment origins.
[0099] In practice, the device name matching method and the device identifier combination matching method can be used separately or in combination, depending on the specific system.
[0100] If it is determined in step S102 that the current input device does not belong to the preset target device, the current key event will be handed over to the system default dispatch process 202 for further processing.
[0101] If it is determined that the current input device belongs to the preset target device, then proceed to step S103.
[0102] In step S103, multiple key processing operations are performed on the current key event in sequence according to a preset priority.
[0103] Multiple key processing operations include at least rule matching operations based on configuration rules and callback query operations initiated to the target processing module.
[0104] During the execution of multiple key press operations, after each key press operation that determines the event consumption status is completed, it can be determined whether the current key press event has been consumed.
[0105] When the current key handling operation determines that the current key event has been consumed, stop executing key handling operations with lower priority than the current key handling operation.
[0106] Therefore, the consumption result of a higher-priority processing operation can prevent lower-priority processing logic from continuing to respond to the same key event.
[0107] In step S104, when the rule matching operation matches the configuration rule corresponding to the current key event, the action identifier corresponding to the current key event is determined according to the matched configuration rule.
[0108] The action identifier is used to indicate the processing action corresponding to the current key event according to the configuration rules, without directly embedding the specific business execution logic into the rule processing process.
[0109] In step S105, the action identifier and the key information corresponding to the current key event are sent to the target processing module, and the consumption result returned by the target processing module is obtained.
[0110] The key information may include at least one of key code, input device type and input device name, and action identifier.
[0111] The target processing module performs corresponding processing or judgment based on the received action identifier and key information, and returns the consumption result.
[0112] In step S106, it is determined whether to intercept the current key press event based on the consumption result.
[0113] When it is determined that interception is necessary based on the consumption results, execute the key event interception operation shown in 201.
[0114] When it is determined that no interception is needed based on the consumption result, the current key event is handed over to the system default dispatch process 202 for further processing.
[0115] Therefore, the target processing module can participate in determining whether key events should continue to be passed to the system's default dispatch process.
[0116] Example 3 This embodiment combines Figure 3 This section further explains the hierarchical arbitration mechanism for key press operations.
[0117] See Figure 3 After a key event enters the hierarchical arbitration process, multiple key processing operations can be executed sequentially according to the following priority order.
[0118] First, execute system lock status detection operation 301.
[0119] The system lock status detection operation 301 is used to obtain the current system status and determine whether the system is in a preset lock status.
[0120] The preset lock state can be a system state that requires restricting at least some button functions.
[0121] When the system is in a preset locked state and the current key event meets the corresponding interception conditions, it can be determined that the current key event has been consumed, and the execution of subsequent low-priority key processing operations will be stopped.
[0122] If the system lock status detection operation 301 does not consume the current key event, then the first callback query operation 302 is executed.
[0123] The first callback query operation 302 initiates a first-priority callback query to the target processing module.
[0124] The target processing module can determine whether to prioritize consuming the current key event based on the relevant information of the current key event.
[0125] When the target processing module determines that it has consumed the current key event, it stops executing subsequent low-priority key processing operations.
[0126] When the target processing module determines that it will not consume the current key event, it continues to perform the combination key matching operation.
[0127] See Figure 3 For the sake of clarity in the attached diagram, the key combination matching operation and the power button processing operation are both located in the processing area 303, but they are still executed in the order of key combination matching operation first and power button processing operation second.
[0128] The key combination matching operation can maintain a key sequence buffer.
[0129] When key events arrive consecutively, the key codes corresponding to multiple key events obtained within a preset time window are stored in the key sequence buffer in the order of input.
[0130] For example, the key sequence buffer stores the first key code K1, the second key code K2, and the third key code K3 in the order of input.
[0131] The system pre-stores at least one combination key sequence.
[0132] Match the key code sequence in the current key sequence buffer with the pre-stored combination key sequence.
[0133] When a key code sequence matches one of the key combination sequences, the key combination action identifier is determined according to the configuration rules corresponding to that key combination sequence.
[0134] Using the above method, key combinations can be identified based on the input sequence formed by multiple key events within a preset time window, rather than determining whether a key combination rule has been hit based solely on a single key event.
[0135] Then the power button operation is executed.
[0136] When the current key event corresponds to the power button, debouncing can be performed.
[0137] For example, the time interval between adjacent power button events or changes in the power button state can be used to determine whether the current power button event is a valid event that needs to be processed, thereby reducing the possibility of repeated processing caused by repeated power button inputs in a short period of time.
[0138] If the operation in processing area 303 does not consume the current key event, then continue to execute the second callback query operation 304.
[0139] The second callback query operation 304 initiates a second-priority callback query to the target processing module.
[0140] Among them, the first callback query operation 302 has a higher priority than the second callback query operation 304.
[0141] By setting callback queries with different priorities at different processing locations, the target processing module can participate in the consumption and judgment of key events at different stages according to different business processing needs.
[0142] If the second callback query operation 304 does not consume the current key event, then the behavior key matching operation 305 continues to be executed.
[0143] Action key matching operation 305 determines the press duration corresponding to the current key event.
[0144] For example, the press duration t can be determined based on the time difference between the key press event and the corresponding key release event.
[0145] A first duration threshold T1 and a second duration threshold T2 are preset, where T2 is greater than T1.
[0146] When t is less than T1, determine the first press action corresponding to the current key event.
[0147] When t is greater than or equal to T1 and less than T2, determine the second press behavior corresponding to the current key event.
[0148] When t is greater than or equal to T2, determine the third press behavior corresponding to the current key event.
[0149] In one example, the first press action can be a short press action, the second press action can be a medium-long press action, and the third press action can be a long press action.
[0150] Based on the determined press behavior, obtain the corresponding behavior key rule from the rule matching cache and perform matching.
[0151] When a match is successful, the action identifier is determined according to the corresponding behavior key rule.
[0152] If the behavior key matching operation 305 does not consume the current key event, then the hotkey matching operation 306 continues to be executed.
[0153] Hotkey matching operation 306 matches the information corresponding to the current key event with the hotkey rules, and determines the action identifier when the corresponding hotkey rule is matched.
[0154] In the above-mentioned hierarchical arbitration process, if any current key processing operation determines that the current key event has been consumed, then key processing operations with lower priority than the current key processing operation will not be executed.
[0155] Therefore, a defined priority relationship can be established between system lock status detection, first callback query, combination key matching, power key processing, second callback query, behavior key matching, and hotkey matching.
[0156] Example 4 This embodiment combines Figure 4 This section describes the configuration rule loading, rule matching, target processing module communication, and consumption control process.
[0157] See Figure 4 Configuration data is stored outside of system services, resulting in a 404 error.
[0158] Configuration data 404 is used at least to characterize the mapping relationship between the triggering conditions of key events and the action identifiers.
[0159] Configuration data 404 may include at least one of hotkey configuration data, combination key configuration data, and behavior key configuration data.
[0160] Each configuration rule may include a key code field, a device source field, a trigger condition field, and an action identifier field.
[0161] For example, a configuration rule can be abstractly represented as: Keycode field: KeyCode; Device Source field; Trigger Condition field: TriggerCondition; Action identifier field: ActionId.
[0162] The English names mentioned above are only used to describe the meaning of the fields and are not intended to limit the field names in the actual data structure.
[0163] The rule matching operation can perform a match based on at least two of the key codes, device sources, and trigger conditions.
[0164] For example, matching can be performed using key codes and device sources, or by using key codes and trigger conditions, or by using key codes, device sources, and trigger conditions together.
[0165] The storage format for configuration data 404 is not limited to a specific file format.
[0166] For example, JSON, XML, database records, key-value data, or other data structures that can represent the mapping relationship between key event triggering conditions and action identifiers can be used.
[0167] When the system starts, the configuration loading unit retrieves configuration data from the corresponding storage location 404 and loads the configuration rules into the rule matching cache 405.
[0168] In subsequent key event processing, the rule processing module 402 can directly obtain the corresponding configuration rule from the rule matching cache 405.
[0169] By using rule matching to cache 405, the need to reread the complete configuration data from external storage for every key event can be avoided.
[0170] During system operation, it can also monitor configuration change notifications corresponding to configuration data 404.
[0171] For example, when the configuration management module or other configuration providers update the configuration data, a configuration change notification can be generated.
[0172] In response to a configuration change notification, the system retrieves the updated configuration data from the storage layer and updates the cache 405 according to the updated configuration data update rules.
[0173] Therefore, key events that arrive after the rule matching cache has been updated can be matched according to the updated configuration rules without having to fix the configuration rules in the system service program code.
[0174] After the key event and key information 401 enter the rule processing module 402, the rule processing module 402 executes the corresponding rule matching according to the configuration rules in the rule matching cache 405.
[0175] When the corresponding configuration rule is matched, the rule processing module 402 obtains the action identifier corresponding to the current key event.
[0176] The rule processing module 402 sends the action identifier and key information to the target processing module 403 through a communication process.
[0177] The target processing module 403 may include at least one of an application, a system service process, a dynamically loaded module, or a remotely bound service.
[0178] For example, in one implementation, the target processing module 403 can be an application that connects to system services via an inter-process communication mechanism; in another implementation, the target processing module 403 can be a service process within the system.
[0179] Therefore, this application does not require the target processing module to adopt a specific program deployment method.
[0180] After receiving the action identifier and key information, the target processing module 403 can perform corresponding processing according to its own business logic and return the consumption result.
[0181] Consumption outcomes can include complete consumption, no consumption, and conditional consumption.
[0182] The distribution control module 406 determines the subsequent processing method for the current key event based on the consumption result.
[0183] When the consumption result is complete consumption, the distribution control module 406 determines to intercept the current key event, so that the current key event will no longer enter the system default distribution process.
[0184] When the consumption result is no consumption, the distribution control module 406 will hand over the current key event to the system default distribution process for further processing.
[0185] When the consumption result is conditional consumption, the distribution control module 406 further obtains the current system status.
[0186] Conditional consumption corresponds to pre-set state conditions.
[0187] Compare the current state of the system with the preset state conditions.
[0188] If the current system state meets the preset state conditions, the current key event will be intercepted; if the current system state does not meet the preset state conditions, the current key event will be handed over to the system's default dispatch process for further processing.
[0189] For example, preset state conditions can be related to a specific system lock state, system running state, or working mode.
[0190] It should be noted that the above states are only examples and are sufficient to determine whether to intercept the current key press event under conditional consumption conditions.
[0191] Example 5 This embodiment further illustrates the dynamic update process of configuration rules.
[0192] After the system starts up, it can first read the current configuration data from the storage layer corresponding to the configuration data.
[0193] The read configuration data is parsed to obtain multiple configuration rules, and these rules are then established in the rule matching cache according to their type.
[0194] For example, you can create separate sets of composite key rules, behavior key rules, and hotkey rules, or you can use a unified set of rules and distinguish different rules by the rule type field.
[0195] After the rule matching cache is established, the system registers a configuration change listener.
[0196] If configuration data changes during system operation, the configuration provider will generate a corresponding configuration change notification.
[0197] After the system detects a configuration change notification, it rereads the updated configuration data from the storage layer.
[0198] The updated configuration data is parsed and updated configuration rules are generated.
[0199] The rule matching cache is then updated using the updated configuration rules.
[0200] After the rule matching cache is updated, newly acquired key events will be matched according to the updated configuration rules.
[0201] For example, the original configuration rule can map a button K1 generated by a target device to the first action identifier A1.
[0202] After the configuration is updated, button K1 generated by the same device can be mapped to the second action identifier A2.
[0203] After the rule matching cache is updated, the newly arrived button K1 that meets the corresponding trigger conditions can determine the second action identifier A2 according to the updated rules.
[0204] The above mechanism allows for adjustments to the mapping relationship between key trigger conditions and action identifiers at the configuration data level.
[0205] Example 6 This embodiment further illustrates the target processing module and the callback query mechanism.
[0206] The target processing module can participate in the specific processing after the action identifier is generated by rule matching, and it can also participate in the hierarchical arbitration process through the first callback query operation and the second callback query operation.
[0207] In the first callback query operation, the communication module initiates a first-priority callback query to the target processing module.
[0208] The first callback query can carry at least some key information corresponding to the current key event.
[0209] The target processing module determines whether to consume the current key event based on the received information and returns the query result to the system key processing device.
[0210] If the returned result indicates that the current key event has been consumed, the hierarchical arbitration module terminates the execution of subsequent processing operations with a priority lower than the first callback query operation.
[0211] If the returned result indicates that the current key event has not been consumed, the key combination matching operation continues.
[0212] In the second callback query operation, the communication module initiates a second priority callback query to the target processing module.
[0213] If the target processing module determines that it is consuming the current key event, it stops executing the behavior key matching operation and the hotkey matching operation.
[0214] If the target processing module determines that it will not consume the current key press event, it will continue to execute subsequent processing.
[0215] The first callback query operation and the second callback query operation can correspond to the same target processing module, or they can correspond to different target processing modules depending on the specific implementation method.
[0216] After the rule matching operation determines the action identifier, the action identifier and the key information corresponding to the current key event can be sent to the target processing module.
[0217] For example, the sent information can form a key information object, which may include key code, input device type, input device name, and corresponding information in the action identifier.
[0218] The target processing module determines the corresponding processing to be performed based on the action identifier, and returns the result of complete consumption, no consumption, or conditional consumption.
[0219] In this way, the system side can be mainly responsible for input device filtering, priority arbitration, rule matching and action identifier generation, while the specific business logic can be implemented by the target processing module, thereby reducing the direct coupling between the rule recognition process and the specific business execution process.
[0220] Example 7 This embodiment provides a system key processing device.
[0221] The device includes an event acquisition module, a device filtering module, a hierarchical arbitration module, a rule processing module, a communication module, and a distribution control module.
[0222] The event acquisition module is used to acquire the key event before the key event enters the system's default distribution process.
[0223] The device filtering module is used to obtain the input device identifier corresponding to the key event, and determine whether the input device that generated the key event belongs to the preset target device based on the input device identifier.
[0224] If the input device is not a preset target device, the device filtering module will hand over the key event to the system's default distribution process for processing.
[0225] If the input device is a preset target device, the key event will be provided to the hierarchical arbitration module for processing.
[0226] The hierarchical arbitration module sequentially calls multiple key processing modules to process the current key event according to a preset priority.
[0227] When the current key handling module determines that the current key event has been consumed, the hierarchical arbitration module stops calling key handling modules with lower priority than the current key handling module.
[0228] The rule processing module performs rule matching on key events according to the configuration rules, and determines the action identifier when the configuration rule corresponding to the current key event is matched.
[0229] The communication module is used to initiate callback queries to the target processing module.
[0230] The communication module is also used to send the action identifier determined by the rule processing module and the key information corresponding to the current key event to the target processing module, and to obtain the consumption result returned by the target processing module.
[0231] The distribution control module determines whether to intercept the current key event or hand it over to the system's default distribution process for further processing based on the consumption result.
[0232] The rule processing module may further include a configuration loading unit, a combination key matching unit, a behavior key matching unit, and a hotkey matching unit.
[0233] The configuration loading unit is used to obtain configuration data and establish a rule matching cache.
[0234] The key combination matching unit retrieves key combination rules from the rule matching cache and performs key combination matching on key code sequences formed within a preset time window.
[0235] The behavior key matching unit retrieves behavior key rules from the rule matching cache and performs rule matching based on the pressing behavior of the current key event.
[0236] The hotkey matching unit retrieves hotkey rules from the rule matching cache and performs hotkey matching based on the current key event.
[0237] The tiered arbitration module calls the corresponding matching units mentioned above according to the preset priority.
[0238] It should be noted that the above modules are logically divided according to their functions, and do not mean that each module must be implemented using independent hardware, programs, processes or services.
[0239] In practice, multiple modules can be integrated into the same program or system service, or a module can be further divided into multiple sub-modules.
[0240] Example 8 This embodiment provides an electronic device.
[0241] The electronic device includes a processor and a memory.
[0242] The memory contains computer programs.
[0243] The processor is used to read and execute the computer program so that the electronic device performs the system key processing method described in any of the foregoing embodiments.
[0244] The electronic device may include, but is not limited to, a conference tablet, an educational whiteboard, a smart display device, a smart TV, an interactive display terminal, or other electronic devices capable of receiving key input events.
[0245] A memory can be used to store computer programs and the data required to execute those programs.
[0246] The processor can be a central processing unit, a microprocessor, a system-on-a-chip, or other processing unit with data processing capabilities.
[0247] It should be noted that electronic devices may also include input interfaces, display components, communication components, or other components necessary for the normal operation of the electronic device, and this application does not limit this.
[0248] Example 9 This application also provides a computer-readable storage medium storing a computer program thereon, the instructions of which are adapted to be loaded by a processor and executed by the method steps of Embodiment 1 shown above. The specific execution process can be found in the detailed description of the embodiments, and will not be repeated here. The device containing the storage medium can be an electronic device such as a personal computer, laptop computer, smartphone, or tablet computer.
[0249] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The components described as separate parts may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0250] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0251] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function selected in one or more boxes.
[0252] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function selected in one or more boxes.
[0253] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0254] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0255] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0256] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0257] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A system key processing method, characterized in that, include: The key event is acquired before it enters the system's default dispatch process; Obtain the input device identifier corresponding to the key event, and determine whether the input device that generated the key event belongs to a preset target device based on the input device identifier; If the input device does not belong to the preset target device, the key event will be handled by the system's default dispatch process. When the input device belongs to the preset target device, multiple key processing operations are performed on the key event in sequence according to the preset priority. The multiple key processing operations include at least a rule matching operation performed based on the configuration rules and a callback query operation initiated to the target processing module. If the current key processing operation determines that the key event has been consumed, terminate the execution of key processing operations with a lower priority than the current key processing operation. If the rule matching operation matches the configuration rule corresponding to the key event, the action identifier corresponding to the key event is determined according to the matched configuration rule; The action identifier and the key information corresponding to the key event are sent to the target processing module, and the consumption result returned by the target processing module is obtained; Based on the consumption result, the system may decide to intercept the key event or hand it over to the system's default distribution process for further processing.
2. The system key processing method according to claim 1, characterized in that, The step of determining whether the input device that generated the key event belongs to a preset target device based on the input device identifier includes: Obtain the device name of the input device; Match the device name with a preset set of target device names; If the device name matches at least one device name in the preset target device name set, the input device is determined to belong to the preset target device.
3. The system key processing method according to claim 2, characterized in that, The preset target device name set includes at least one of the following: the device name corresponding to the virtual key device, the device name corresponding to the keypad device, and the device name corresponding to the remote control device.
4. The system key processing method according to claim 1, characterized in that, The step of determining whether the input device that generated the key event belongs to a preset target device based on the input device identifier includes: Obtain the device manufacturer identifier and device product identifier of the input device; The device identifier combination consisting of the device manufacturer identifier and the device product identifier is matched with a preset target device identifier set; If the device identifier combination matches the target device identifier combination in the preset target device identifier set, the input device is determined to belong to the preset target device.
5. The system key processing method according to claim 1, characterized in that, The configuration rules are stored in configuration data outside of system services. The configuration data is used at least to characterize the mapping relationship between the triggering conditions of key events and action identifiers. The configuration data is loaded when the system starts up, and the configuration rules are stored in the rule matching cache.
6. The system key processing method according to claim 5, characterized in that, The configuration data includes at least one of hotkey configuration data, combination key configuration data, and behavior key configuration data; Each configuration rule includes a key code field, a device source field, a trigger condition field, and an action identifier field. The rule matching operation determines the action identifier corresponding to the key event based on at least two of the key code, device source, and triggering conditions.
7. The system key processing method according to claim 5, characterized in that, Also includes: Listen for configuration change notifications corresponding to the configuration data; In response to the configuration change notification, retrieve the updated configuration data from the storage layer; The rule matching cache is updated according to the updated configuration data so that subsequent key events are matched according to the updated configuration rules.
8. The system key processing method according to claim 1, characterized in that, The step of performing multiple key processing operations on the key events according to a preset priority includes performing the following operations sequentially: The system lock state detection operation is used to intercept the key events when the system is in a preset lock state; The first callback query operation is used to initiate a first-priority callback query to the target processing module, and terminate the subsequent key processing operation when the target processing module determines to consume the key event; The key combination matching operation is used to perform key combination sequence matching on the key events according to preset key combination rules. The power button processing operation is used to perform debouncing when the power button is pressed in the corresponding button event. The second callback query operation is used to initiate a second-priority callback query to the target processing module, and terminate the subsequent key processing operation when the target processing module determines that the key event has been consumed. The behavior key matching operation is used to match corresponding behavior key rules based on the press behavior of the key event; and Hotkey matching operation, used to match the corresponding hotkey rules based on the key event; The first callback query operation has a higher priority than the second callback query operation.
9. The system key processing method according to claim 8, characterized in that, The behavior key matching operation includes: Determine the press duration corresponding to the key event; If the press duration is less than a first duration threshold, the button event is determined to correspond to a first press action; If the press duration is greater than or equal to the first duration threshold and less than the second duration threshold, the button event is determined to correspond to the second press behavior. If the press duration is greater than or equal to the second duration threshold, the button event is determined to correspond to a third press action; The action identifier is determined based on the matched action key rule according to the determined press action.
10. The system key processing method according to claim 8, characterized in that, The key matching operation includes: Maintain the key sequence buffer; The key codes corresponding to multiple key events acquired within a preset time window are stored in the key sequence buffer in the order of input. Match the key code sequence in the key sequence buffer with the pre-stored combination key sequence; If the key code sequence matches the key combination sequence, the key combination action identifier is determined according to the configuration rules corresponding to the key combination sequence.
11. The system key processing method according to claim 1, characterized in that, The consumption outcomes include complete consumption, no consumption, and conditional consumption; If the consumption result is complete consumption, the key press event is intercepted; If the consumption result is no consumption, the key event will be handed over to the system's default dispatch process for further processing; If the consumption result is conditional consumption, the current system state is obtained, and based on whether the current system state meets the preset state conditions corresponding to the conditional consumption, it is determined whether to intercept the key event or hand the key event over to the system default distribution process for further processing.
12. The system key processing method according to claim 1, characterized in that, The key information includes at least one of the key code corresponding to the key event, the input device type and the input device name, as well as the action identifier; The target processing module includes at least one of an application, a system service process, a dynamically loaded module, or a remotely bound service.
13. A system key processing device, characterized in that, include: The event acquisition module is used to acquire the key event before the key event enters the system's default distribution process; The device filtering module is used to obtain the input device identifier corresponding to the key event, determine whether the input device that generated the key event belongs to the preset target device based on the input device identifier, and if the input device does not belong to the preset target device, hand the key event over to the system default distribution process for processing. The hierarchical arbitration module is used to, when the input device belongs to the preset target device, sequentially call multiple key processing modules to process the key event according to a preset priority, and stop calling key processing modules with a lower priority than the current key processing module when the current key processing module determines that the key event has been consumed; The rule processing module is used to perform rule matching on the key event according to the configuration rules, and determine the corresponding action identifier when the configuration rule corresponding to the key event is matched; The communication module is used to initiate a callback query to the target processing module, and to send the action identifier and the key information corresponding to the key event to the target processing module and obtain the consumption result returned by the target processing module; and The distribution control module is used to determine whether to intercept the key event based on the consumption result, or to hand over the key event to the system's default distribution process for further processing.
14. The system key processing device according to claim 13, characterized in that, The rule processing module includes a configuration loading unit, a combination key matching unit, a behavior key matching unit, and a hotkey matching unit; The configuration loading unit is used to obtain configuration data and establish a rule matching cache; The key combination matching unit, the action key matching unit, and the hotkey matching unit are respectively used to obtain the corresponding type of configuration rule from the rule matching cache and perform corresponding rule matching on the key event; The hierarchical arbitration module calls at least one of the combination key matching unit, the behavior key matching unit, and the hotkey matching unit according to the preset priority.
15. An electronic device, characterized in that, Including processor and memory, The memory stores computer programs; The processor is used to execute the computer program to cause the electronic device to perform the system key processing method according to any one of claims 1 to 12.
16. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the processor performs the system key processing method according to any one of claims 1 to 12.
