Input event processing method and device, electronic equipment and storage medium
By preconfiguring the relationship between event information and processing methods in the electronic device, the problem of only processing specific object input events in the prior art is solved, and the effective processing of unspecified object input events is realized, which enriches the functions of the electronic device.
Patent Information
- Application Number
- CN202510397934.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-28
- Publication Date
- 2025-08-01
AI Technical Summary
In the prior art, when an electronic device processes an input event, it must find the focus object acting as the input device in order to process the input event, but the input event that is not only used on a specific object cannot be processed, resulting in limited functional implementation.
The electronic device preconfigures the association relationship between event information and processing methods, and uses its associated components to process input events, determines the target processing method based on the preconfigured association relationship, so as to achieve processing of input events that are not only used on specific objects.
It realizes effective processing of input events that are not only used on specific objects, ensures that the normal processing of other input events is not affected, and enriches the functions of electronic devices.
Smart Images

Figure CN120407224A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technologies, and particularly to an input event processing method, apparatus, electronic device, and storage medium. Background Art
[0002] Input devices for the Basic Input Output System (BIOS) Setup interface based on the Light and Versatile Graphics Library (LVGL) include a mouse and a keyboard. A user can operate using the input devices in the BIOS Setup interface, and the electronic device generates input events based on the user's operations. The electronic device obtains input events of the input devices once in each task cycle, traverses the regional positions of all objects displayed on the current BIOS Setup interface, finds the focus object affected by the input device, and sends corresponding input events to the component associated with the focus object. Then, the component associated with the focus object executes an event callback function to implement the function corresponding to the input event in the BIOS Setup interface.
[0003] Based on the above description, it can be known that when the electronic device processes input events of the input device, it must find the focus object affected by the input device and then process the input events through the focus object. However, for input events that do not act only on specific objects, they cannot be processed, and the corresponding functions cannot be implemented. Therefore, an input event processing method is needed to process input events that do not act only on specific objects and implement the corresponding functions. Summary of the Invention
[0004] The purpose of the embodiments of this application is to provide an input event processing method, apparatus, electronic device, and storage medium to process input events that do not act only on specific objects and implement the corresponding functions. The specific technical solutions are as follows:
[0005] In a first aspect, the embodiments of this application provide an input event processing method applied to an electronic device on which a BIOS setup interface is displayed. The method includes:
[0006] Obtain input events of an input device;
[0007] Among the objects displayed on the BIOS setup interface, find a first focus object affected by the input event to process the input event using the component associated with the first focus object;
[0008] Determine a target processing method associated with the event information of the input event according to the pre-configured association relationship between event information and processing methods;
[0009] Process the input event according to the described target processing method.
[0010] In some embodiments, the input device is a keyboard, and the event information includes an input state and an input key value.
[0011] The step of determining the target processing method associated with the event information of the input event according to the pre-configured association relationship between event information and processing methods includes:
[0012] If the input state of the input event is the pressed state, determine the target processing method associated with the input key value of the input event according to the pre-configured association relationship between the input key value and the processing method.
[0013] If the input state of the input event is the released state, determine that the target processing method is to skip processing.
[0014] In some embodiments, the input key value of the input event is a preset key value. The step of processing the input event according to the target processing method includes:
[0015] Among the objects displayed on the BIOS setup interface, find the second focus object affected by the input event.
[0016] Use the component associated with the second focus object to process the input event according to the target processing method.
[0017] In some embodiments, the input key value includes an exit key value, and the processing method associated with the input key value being the exit key value is to close the object. The method further includes:
[0018] Detect a first list object and a second list object associated with the BIOS setup interface. The first list object indicates the opened drop-down list on the BIOS setup interface before finding the first focus object affected by the input event among the objects displayed on the BIOS setup interface, and the second list object indicates the opened drop-down list on the BIOS setup interface after finding the first focus object affected by the input event among the objects displayed on the BIOS setup interface.
[0019] If the input key value of the input event is the exit key value, the first list object is not empty, and the second list object is empty, determine that the target processing method is to skip processing.
[0020] If the input key value of the input event is the exit key value and both the first list object and the second list object are not empty, then execute the step of determining the target processing method associated with the input key value of the input event according to the pre-configured association relationship between the input key value and the processing method.
[0021] In some embodiments, the method further includes:
[0022] Determine a third focus object from all the objects displayed on the BIOS setup interface;
[0023] If the type of the third focus object is a drop-down list type and the drop-down list indicated by the third focus object is open, then obtain the opened drop-down list to obtain a list object indicating the opened drop-down list, where the list object includes a first list object and a second list object.
[0024] In some embodiments, the input device is a mouse, and the event information includes an input state and an input position;
[0025] The step of determining the target processing method associated with the event information of the input event according to the pre-configured association relationship between the event information and the processing method includes:
[0026] If the input state of the input event is a pressed state, then determine the target position relationship between the input position of the input event and the regional position of a preset object on the BIOS setup interface; according to the pre-configured association relationship between the position relationship and the processing method, determine the target processing method associated with the target position relationship;
[0027] If the input state of the input event is a released state, then determine that the target processing method is skip processing.
[0028] In some embodiments, the method further includes:
[0029] Judge whether a preset object is displayed on the BIOS setup interface;
[0030] If yes, then execute the step of determining the target position relationship between the input position of the input event and the regional position of the preset object on the BIOS setup interface;
[0031] If no, then determine that the target processing method is skip processing.
[0032] In some embodiments, the positional relationship includes a first positional relationship and a second positional relationship. The first positional relationship is that the input position is within the regional position of a preset object, and the second positional relationship is that the input position is outside the regional position of the preset object. The processing method associated with the first positional relationship is skip processing, and the processing method associated with the second positional relationship is to close the object.
[0033] Second, an input event processing device provided by an embodiment of the present application is applied to an electronic device on which a BIOS setting interface is displayed. The device includes:
[0034] An acquisition module, configured to acquire an input event of an input device;
[0035] A search module, configured to search for a first focus object affected by the input event among the objects displayed on the BIOS setting interface, so as to process the input event by using a component associated with the first focus object;
[0036] A determination module, configured to determine a target processing method associated with the event information of the input event according to a pre-configured association relationship between event information and a processing method;
[0037] A processing module, configured to process the input event according to the target processing method.
[0038] In some embodiments, the input device is a keyboard, and the event information includes an input state and an input key value. The determination module is specifically configured to:
[0039] If the input state of the input event is a pressed state, determine a target processing method associated with the input key value of the input event according to a pre-configured association relationship between the input key value and the processing method;
[0040] If the input state of the input event is a released state, determine that the target processing method is skip processing.
[0041] In some embodiments, the input key value of the input event is a preset key value. The processing module is specifically configured to:
[0042] Search for a second focus object affected by the input event among the objects displayed on the BIOS setting interface;
[0043] Use a component associated with the second focus object to process the input event according to the target processing method.
[0044] In some embodiments, the input key value includes an exit key value, and the processing method associated with the input key value being the exit key value is to close the object. The determination module is further configured to:
[0045] Detect a first list object and a second list object associated with the BIOS setup interface. The first list object indicates a dropdown list that was open on the BIOS setup interface before finding a first focus object affected by the input event among the objects displayed on the BIOS setup interface. The second list object indicates a dropdown list that is open on the BIOS setup interface after finding the first focus object affected by the input event among the objects displayed on the BIOS setup interface.
[0046] If the input key value of the input event is an exit key value, the first list object is not empty, and the second list object is empty, then determine that the target processing method is skip processing.
[0047] If the input key value of the input event is an exit key value, and both the first list object and the second list object are not empty, then perform the step of determining the target processing method associated with the input key value of the input event according to the pre-configured association relationship between the input key value and the processing method.
[0048] In some embodiments, the device further includes: a recording module, configured to:
[0049] Determine a third focus object from all the objects displayed on the BIOS setup interface;
[0050] If the type of the third focus object is a dropdown list type, and the dropdown list indicated by the third focus object is open, then obtain the open dropdown list to get a list object indicating the open dropdown list. The list object includes the first list object and the second list object.
[0051] In some embodiments, the input device is a mouse, and the event information includes an input state and an input position; the determining module is specifically configured to:
[0052] If the input state of the input event is a pressed state, then determine a target position relationship between the input position of the input event and the area position of a preset object on the BIOS setup interface; according to the pre-configured association relationship between the position relationship and the processing method, determine the target processing method associated with the target position relationship;
[0053] If the input state of the input event is a released state, then determine that the target processing method is skip processing.
[0054] In some embodiments, the determining module is further configured to:
[0055] Determine whether a preset object is displayed on the BIOS setup interface;
[0056] If so, perform the step of determining the target position relationship between the input position of the input event and the regional position of the preset object on the BIOS setup interface;
[0057] If not, determine that the target processing method is skip processing.
[0058] In some embodiments, the position relationship includes a first position relationship and a second position relationship. The first position relationship is that the input position is within the regional position of the preset object, and the second position relationship is that the input position is outside the regional position of the preset object; the processing method associated with the first position relationship is skip processing; the processing method associated with the second position relationship is to close the object.
[0059] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a machine-readable storage medium. The machine-readable storage medium stores machine-executable instructions that can be executed by the processor. The processor is prompted by the machine-executable instructions to implement any method provided in the first aspect.
[0060] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium. A computer program is stored in the computer-readable storage medium. When the computer program is executed by a processor, it implements any method provided in the first aspect.
[0061] In a fifth aspect, an embodiment of the present application further provides a computer program product containing instructions. When it runs on a computer, it causes the computer to execute any method provided in the first aspect.
[0062] Advantages of the embodiments of the present application:
[0063] In the technical solution provided by the embodiments of the present application, an association relationship between event information and a processing method is pre-configured in the electronic device. After the electronic device obtains an input event of an input device, it first processes the input event by using a component associated with the focus object affected by the input event, and then determines the target processing method associated with the event information of the obtained input event according to the pre-configured association relationship, and processes the input event according to the target processing method. In this process, it is not necessary to find the focus object affected by the input event to process the input event. Applying the technical solution provided by the embodiments of the present application, for an input event that does not only act on a specific object, the electronic device can also process it according to the pre-configured processing method, and it does not affect the normal processing of other input events, realizing the processing of an input event that does not only act on a specific object, and thus realizing the corresponding function.
[0064] Of course, it is not necessary for any product or method implementing the present application to simultaneously achieve all the above-mentioned advantages. Description of the Drawings
[0065] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0066] Figure 1 A schematic diagram of a first flow chart of the input event processing method provided in an embodiment of the present application;
[0067] Figure 2 A second flow chart of the input event processing method provided in an embodiment of the present application;
[0068] Figure 3 A third flow chart of the input event processing method provided in an embodiment of the present application;
[0069] Figure 4 A fourth flow chart of the input event processing method provided in an embodiment of the present application;
[0070] Figure 5 A schematic diagram of the structure of an input event processing device provided in an embodiment of the present application;
[0071] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0072] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field based on this application are within the scope of protection of this application.
[0073] The BIOS is a set of programs stored on a read-only memory (ROM) chip on the computer's motherboard. These include the computer's most important basic input and output routines, the post-boot self-test program, and the system startup routine. The BIOS can read and write detailed system configuration information from the complementary metal oxide semiconductor (CMOS) chip. The BIOS's primary function is to provide the lowest-level, most direct hardware configuration and control for the computer.
[0074] The BIOS Setup interface is a user interface provided by the firmware program embedded on the computer motherboard for managing and configuring the hardware settings of the computer. Pressing a specific key combination (such as the Delete key, Esc key, etc.) during computer startup can enter the BIOS Setup interface. The appearance of the BIOS Setup interface can be a text-based menu structure or a modern graphical interface, presenting various setting options in graphical or text form.
[0075] LVGL is a brand-new graphic user interface (GUI) system framework. LVGL has the advantages of small code volume and easy development of user interfaces. As an open-source embedded graphics library, LVGL is known for its lightweight, rich in functions, flexible, portable, etc., which can help developers quickly and conveniently create beautiful and feature-rich graphic user interfaces.
[0076] The input devices for the BIOS Setup interface based on LVGL include a mouse and a keyboard. Users can operate in the BIOS Setup interface using the input devices. The electronic device generates input events based on the user's operations, such as key events of the keyboard and click events of the mouse. In the LVGL framework, the electronic device executes a task (such as lv_indev_read_task) once per task cycle to obtain the input events of the input device, traverses the area positions of all objects displayed on the current BIOS Setup interface, finds the focus object affected by the input device, and sends the corresponding input event to the component associated with the focus object by calling a function (such as lv_event_send(obj,LV_EVENT)), and sets an event callback function for the object through an interface (such as lv_obj_set_event_cb(obj,cb_fun)). Then, the component associated with the focus object executes the event callback function to implement the functions corresponding to the input events in the BIOS Setup interface.
[0077] Based on the above description, it can be seen that when the electronic device processes the input events of the input device, it must find the focus object affected by the input device and then process the input events through the focus object. However, for input events that do not act only on a specific object, they cannot be processed, and the corresponding functions cannot be implemented. Therefore, an input event processing method is needed to process input events that do not act only on a specific object and implement the corresponding functions.
[0078] To solve the above problems, an embodiment of the present application provides an input event processing method, as Figure 1 shown, applied to an electronic device on which a BIOS settings interface is displayed. The method includes:
[0079] Step S11: Obtain the input event of the input device.
[0080] Step S12: Among the objects displayed on the BIOS setup interface, find the first focus object affected by the input event, so as to process the input event by using the component associated with the first focus object.
[0081] Step S13: Determine the target processing method associated with the event information of the input event according to the pre-configured association relationship between event information and processing methods.
[0082] Step S14: Process the input event according to the target processing method.
[0083] In the technical solution provided by the embodiment of the present application, an association relationship between event information and processing methods is pre-configured in the electronic device. After the electronic device obtains the input event of the input device, it first processes the input event by using the component associated with the focus object affected by the input event, and then determines the target processing method associated with the event information of the obtained input event according to the pre-configured association relationship, and processes the input event according to the target processing method. In this process, it is not necessary to find the focus object affected by the input event to process the input event. By applying the technical solution provided by the embodiment of the present application, for input events that do not only act on specific objects, the electronic device can also be processed according to the pre-configured processing method, and it does not affect the normal processing of other input events, realizing the processing of input events that do not only act on specific objects, and thus realizing the corresponding functions.
[0084] In the embodiment of the present application, the electronic device may be a personal computer (PC), a server, or other devices that support the BIOS setup interface. The BIOS setup interface may be a BIOS setup interface based on LVGL, or may be other types of BIOS setup interfaces, which are not limited herein. A page is displayed on the BIOS setup interface. Subsequently, the so-called display on the BIOS setup interface means the display on the page displayed on the BIOS setup interface.
[0085] In the above step S11, the input device is used to receive the operation instruction input by the user. The input device may be a mouse, a keyboard, etc., which are not limited herein. The input event is an event generated by the electronic device based on the operation instruction of the user. The input event may be a key event of the keyboard, a release event of the keyboard, a click event of the mouse, a release event of the mouse, etc., which are not limited herein.
[0086] The electronic device can read the status parameters of the input device in real time, receive the operation instructions input by the user, and generate input events of the input device based on the operation instructions. When the BIOS setup interface is a BIOS setup interface based on LVGL, the electronic device can execute tasks (such as lv_indev_read_task) in real time, read the status parameters of the input device, and obtain the input events of the input device.
[0087] In the embodiments of the present application, the electronic device can periodically obtain the input events of the input device. The electronic device can obtain the input events of the input device once every preset task period. In this case, the electronic device can obtain multiple input events. Generally, the electronic device only obtains one input event within each task period, and the number of input events obtained by the electronic device is not limited here. The duration of the preset task period can be 30 milliseconds (ms), 50 ms, etc., which is not limited here.
[0088] In the above step S12, the object is the unit for constructing the BIOS setup interface. The object can indicate the entities (i.e., visible elements) displayed on the BIOS setup interface, such as buttons, labels, images, settings items, dialog boxes, etc. The object can also indicate invisible logical elements, and the form of the object is not limited here. When the BIOS setup interface is a BIOS setup interface based on LVGL, the object can be an LVGL object. The BIOS setup interface also includes a focus, which can be the position where the mouse is located (hereinafter simply referred to as the input position), or the position where the cursor is located. The object corresponding to the focus on the BIOS setup interface is the focus object. The focus object can be empty, that is, the focus object does not exist.
[0089] In the embodiments of the present application, after the electronic device obtains the input event, it can obtain all the objects displayed on the BIOS setup interface and determine the focus object from all the objects. This focus object is the object on which the obtained input event acts, and this focus object is called the first focus object.
[0090] When the BIOS setup interface is a BIOS setup interface based on LVGL, the electronic device can call an interface (such as lv_group_get_default) to obtain all the objects displayed on the BIOS setup interface (referred to as the default group). After that, the electronic device can call an interface (such as lv_group_get_focused) to obtain the LVGL object corresponding to the focus in the default group and obtain the focus object. The electronic device can obtain the first focus object by using the above method for obtaining the focus object, and the method for the electronic device to obtain the first focus object is not limited here.
[0091] In an embodiment of the present application, the electronic device sends the obtained input event to a component associated with a first focus object, and uses the component associated with the first focus object to execute an event callback function corresponding to the input event to process the input event.
[0092] When the BIOS setup interface is a BIOS setup interface based on LVGL, the electronic device can send the obtained input event to a component associated with a first focus object by calling a function (such as lv_event_send(obj,LV_EVENT)), and preset an event callback function corresponding to the input event through an interface (such as lv_obj_set_event_cb(obj,cb_fun)).
[0093] In an embodiment of the present application, if the object corresponding to the focus on the BIOS setup interface does not exist, that is, the focus object does not exist, and the electronic device cannot find the first focus object, then the obtained input event is not processed, and step S13 is continued to be executed.
[0094] In an embodiment of the present application, when the electronic device obtains multiple input events, the electronic device can process each input event in sequence, that is, find the first focus object affected by the first input event, use the component associated with the first focus object to process the first input event, then find the first focus object affected by the second input event, and use the component associated with the first focus object to process the second input event, and so on.
[0095] In the above step S13, the event information is used to describe the state parameters of the input event, and the event information may include at least one of the input type (such as IndevType), input state (such as IndevState), input key value (such as CurrentKey), and input position (Point) of the input event. The input type indicates the type of input device, and the input type can be a keyboard type (such as LV_INDEV_TYPE_KEYPAD) or a mouse type (such as LV_INDEV_TYPE_POINTER); the input state indicates the key state of the input device, and the input state can be a pressed state (LV_INDEV_STATE_REL) or a released state (such as LV_INDEV_STATE_PR); the input key value indicates the key value input by the keyboard when the input device is a keyboard; the input position indicates the coordinates where the mouse is located when the input device is a mouse.
[0096] In the embodiments of the present application, after the electronic device executes step S11 and obtains an input event, it can generate event information of the input event according to the input device type of the input event, the input device key state, the key value input by the keyboard, and / or the coordinates where the mouse is located. The electronic device can generate a linked list (such as gIndevEventLL) to record the event information, and each node in the linked list records the event information of an input event. If multiple input events are obtained, the electronic device can record the event information of the first input event in the first node, the event information of the second input event in the second node, and so on. After the electronic device executes step S11, it can generate the event information of the input event. Here, the order of the electronic device generating the event information and using the components associated with the first focus object to process the input event is not limited.
[0097] The electronic device pre-configures the association relationship between event information and processing methods. For example, for event information 1 with an input type of keyboard type, an input state of key state, and an input key value of F1, the associated processing method is to display help information; for event information 2 with an input type of keyboard type, an input state of key state, and an input key value of the escape key value (Esc), the associated processing method is to close the object. The object closed by using the escape key value can be a page, a setting item, a dialog box, etc. displayed on the BIOS setup interface. The setting item can include a calendar object, a time setting object, a drop-down list object, etc., and the dialog box can include a dialog box object for displaying help information, a dialog box object for displaying prompt information, etc. Specifically, it can be set according to actual needs, and this is not limited.
[0098] In the embodiments of the present application, after the electronic device executes step S12 and generates the event information of the input event, it determines the event information of the obtained input event and the processing method associated with the event information from the pre-configured association relationship between event information and processing methods. The determined processing method is the target processing method.
[0099] In the embodiments of the present application, if there is no association relationship of the event information of the input event in the pre-configured association relationship between event information and processing methods, the electronic device determines that the obtained input event cannot be processed, and determines that the target processing method is to skip processing, that is, not to process.
[0100] In the above step S14, after the electronic device determines the target processing method, it can process the obtained input event according to the target processing method. Still taking the event information 1 and event information 2 in the above step S13 as an example, the electronic device can determine that the target processing method of event information 1 is to display help information, and then pop up a dialog box for displaying help information on the BIOS setup interface; the electronic device can determine that the target processing method of event information 2 is to close the object, and then close the object (such as a page, a setting item, a dialog box, etc.) displayed on the BIOS setup interface.
[0101] In the embodiments of the present application, if multiple input events are obtained, after generating the event information of these multiple input events, for each input event, steps S13 and S14 may be executed multiple times to sequentially determine the target processing method for each input event, and process each input event according to the determined target processing method.
[0102] In some embodiments, the input device may be a keyboard. When the input device is a keyboard (i.e., the input type included in the event information is of the keyboard type), the event information may include an input state and an input key value. In the embodiments of the present application, the event information may further include an input type and / or an input position. The input type is of the keyboard type, and the input position may be NULL. As Figure 2 shown, the embodiments of the present application further provide an input event processing method applied to an electronic device on which a BIOS setup interface is displayed. The method may include:
[0103] Step S21, obtaining an input event of an input device.
[0104] Step S22, in the objects displayed on the BIOS setup interface, searching for a first focus object on which the input event acts, so as to process the input event by using a component associated with the first focus object.
[0105] Step S23, if the input state of the input event is a pressed state, determining a target processing method associated with the input key value of the input event according to a pre-configured association relationship between the input key value and the processing method.
[0106] Step S24, if the input state of the input event is a released state, determining that the target processing method is to skip processing.
[0107] Step S25, processing the input event according to the target processing method.
[0108] The above steps S21 to S22 are the same as the above steps S11 to S12, and the above step S25 is the same as the above step S14.
[0109] In the technical solution provided by the embodiments of the present application, when the input device is a keyboard, the electronic device determines the processing method of the input event according to the input state and the input key value. When the input state is a released state, the electronic device does not process the input event to improve the input event processing speed; when the input state is a pressed state, the electronic device processes the input event according to the pre-configured association relationship between the input key value and the processing method, and provides multiple ways to process the input event.
[0110] In an embodiment of the present application, when the input device is a keyboard, after the electronic device executes step S22 and generates event information of an input event, it can call a preset keyboard event processing function (such as KEYPAD_CALLBACK_FUNC), and execute step S23 or step S24 according to whether the input state included in the event information is a pressed state or a released state.
[0111] In an embodiment of the present application, the preset keyboard event processing function can be defined in a keyboard event processing module and pre-registered in a preset variable (such as gKeypadCallback). The electronic device can call this variable to implement the call of the keyboard event processing function.
[0112] In the above step S23, when the input state included in the event information is a pressed state, it indicates that the input event is an input event that needs to be processed. An association relationship between input key values and processing methods is pre-configured in the electronic device. For example, when the input key value is F1, the associated processing method is to display help information; when the input key value is an exit key value, the associated processing method is to close an object. For the specific association relationship between input key values and processing methods, please refer to Table 1 below.
[0113] Table 1 Shortcut keys (key values) supported by the BIOS setup interface and processing methods
[0114] Shortcut Key Name Processing Method Esc Key Close the page; close the opened settings; close the dialog box Up Arrow Key Move the focus up Down Arrow Key Move the focus down Page Up Key Page up Page Down Key Page down Plus Sign ("+") Key Increment the numeric option by step Minus Sign ("-") Key Decrement the numeric option by step F1 Key Pop up a dialog box and display help information F2 Key Pop up a dialog box to prompt whether to load the optimal value F3 Key Pop up a dialog box to prompt whether to load the default value F4 Key Pop up a dialog box to prompt whether to save the configuration and exit F5 Key Enter the search option page
[0115] In Table 1, the shortcut key name represents the key value, and the processing method represents the processing method associated with the key value. For example, the Esc key represents the exit key value, and the processing method associated with the Esc key is to close an object, specifically including closing a page, closing an opened setting item, or closing a dialog box, etc.; the F2 key represents the F2 key value, and the processing method associated with the F2 key is to display a prompt message, specifically to pop up a dialog box prompting whether to load the optimal value; the F5 key represents the F5 key value, and the processing method associated with the F5 key is to open a search option, specifically to enter the page where the search option is located; the up arrow key of the arrow keys represents the up key value, and the processing method associated with the up arrow key of the arrow keys is to move the focus upward, specifically to select the previous object of the current focus object as the new focus object; the Page Up key represents the up page key value, and the processing method associated with the Page Up key is to turn the page upward, specifically to select the previous page object of the current focus object as the new focus object.
[0116] The association relationship between the key values and processing methods in Table 1 is only an example, and can be specifically set according to actual needs. Here, the input key values with associated processing methods and the processing methods associated with each input key value are not limited.
[0117] The electronic device determines the input key value included in the event information of the obtained input event and the processing method associated with the input key value from the pre-configured association relationship between the input key value and the processing method. The determined processing method is the target processing method. After that, the electronic device can execute step S25 and process the obtained input event according to the target processing method.
[0118] For example, if the input key value is the up key value and the associated processing method is to move the focus upward, the electronic device can determine the focus object from all the objects displayed on the BIOS setting interface and move the focus to select the previous object of the determined focus object as the new focus object.
[0119] In the embodiments of the present application, if there is no association relationship of the input key value included in the event information in the pre-configured association relationship between the input key value and the processing method, the electronic device determines that the obtained input event cannot be processed, and determines that the target processing method is to skip processing, that is, not to process.
[0120] In the above step S24, the input state included in the event information is the release state, indicating that the input event is an input event that does not need to be processed. The electronic device can directly determine that the target processing method of the obtained input event is to skip processing, that is, not to process. After that, the electronic device can execute step S25 and not process the obtained input event.
[0121] In some embodiments, the input key value of the input event can be a preset key value. When the input key value is a preset key value, the associated processing method is related to the focus object, and the corresponding input event is an input event that needs to act on a specific object. The preset key value can include the plus key and the minus key, etc. For example, if the input key value is the plus key and the associated processing method is to increase the value, that is, when the focus object is a digital option, the digital option is increased by a preset step. The preset key value and the associated processing method can be specifically configured according to actual needs, and are not limited thereto.
[0122] In this case, the above step S25 can also be implemented through the following steps: find the second focus object on which the input event acts among the objects displayed on the BIOS setting interface; use the component associated with the second focus object to process the input event according to the target processing method.
[0123] After determining the target processing method and before processing the input event, the electronic device can obtain all the objects displayed on the BIOS setup interface and determine the focus object from all the objects. This focus object is the object on which the obtained input event acts, and this focus object is called the second focus object. The method for the electronic device to obtain the second focus object can refer to the relevant description of obtaining the first focus object in the above step S12. In the embodiments of the present application, after the electronic device executes step S22 (or step S12) to process the input event, the BIOS setup interface may change. In this way, the second focus object found by the electronic device may be different from the first focus object.
[0124] The electronic device sends the obtained input event to the component associated with the second focus object, and uses the component associated with the second focus object to process the input event according to the target processing method, such as executing the corresponding event callback function. For example, if the input key value is the plus key and the associated processing method is to increase the value, and if the second focus object is a digital option, then the electronic device can use the component associated with the digital option to increase the value of the digital option (such as 5) by a preset step size (such as 10) to obtain the increased digital option (such as 5 + 10 = 15).
[0125] In the embodiments of the present application, the electronic device can determine whether the second focus object matches the target processing method before using the component associated with the second focus object to process the input event according to the target processing method. For example, if the target processing method is to increase the value and the second focus object is a digital option, then the electronic device can determine that the second focus object matches the target processing method.
[0126] If the second focus object matches the target processing method, the electronic device can continue to process the obtained input event. If the second focus object does not match the target processing method, the electronic device can not process the obtained input event. For example, the electronic device may not send the obtained input event to the component associated with the second focus object; or for another example, the electronic device may send the obtained input event to the component associated with the second focus object, but the component associated with the second focus object cannot process the input event according to the target processing method. The electronic device can display a prompt message such as processing failure on the BIOS setup interface, or keep the currently displayed BIOS setup interface unchanged.
[0127] In the embodiments of the present application, for the input event related to the focus object, the component associated with the focus object is used to process it according to the target processing method, so as to process the input event with a key value of a preset key value that cannot be processed in step S22, enriching the types of input events that the electronic device can process, and thus enriching the implemented functions.
[0128] In some embodiments, the input key value may include an exit key value, and the processing method associated with the input key value being the exit key value may be to close the object. In this case, the above input event processing method may further include: detecting a first list object and a second list object associated with the BIOS setup interface. The first list object indicates a dropdown list that has been opened on the BIOS setup interface before finding the first focus object affected by the input event among the objects displayed on the BIOS setup interface. The second list object indicates a dropdown list that has been opened on the BIOS setup interface after finding the first focus object affected by the input event among the objects displayed on the BIOS setup interface.
[0129] In the embodiments of the present application, the list object indicates a dropdown list that has been opened on the BIOS setup interface. The electronic device may obtain the list object associated with the BIOS setup interface before executing the above step S22 (or step S12), that is, obtain the dropdown list that has been opened on the BIOS setup interface.
[0130] In some embodiments, a dropdown list acquisition library function (such as lv_dropdown_get_current_opened_list) may be pre-stored in the electronic device. The electronic device may call this library function to obtain the list object through the following steps: determine a third focus object from all the objects displayed on the BIOS setup interface; if the type of the third focus object is a dropdown list type and the dropdown list indicated by the third focus object has been opened, then obtain the opened dropdown list to obtain a list object indicating the opened dropdown list, and the list object includes the first list object and the second list object.
[0131] In the embodiments of the present application, the electronic device may obtain all the objects displayed on the BIOS setup interface and determine the focus object from all the objects, and this focus object is the third focus object. The manner in which the electronic device obtains the third focus object may refer to the relevant description of obtaining the first focus object in the above step S12.
[0132] The electronic device may determine the type of the third focus object, such as by calling an interface (lv_obj_check_type). If the type of the third focus object is not a dropdown list type, then the electronic device cannot obtain the opened dropdown list and the obtained list object is empty. If the type of the third focus object is a dropdown list type (such as lv_dropdown_class), then the electronic device may determine that the third focus object indicates a dropdown list.
[0133] The electronic device can further determine whether the dropdown list indicated by the third focus object is open, such as calling an interface (such as lv_dropdown_get_list) to obtain the open dropdown list. If the dropdown list indicated by the third focus object is open, that is, the dropdown list includes a click button and an open list, the electronic device can obtain the open dropdown list and get a list object indicating the open dropdown list; if the dropdown list indicated by the third focus object is not open, that is, the dropdown list only includes a click button, there is no open dropdown list on the BIOS setup interface, the electronic device obtains that the dropdown list is empty, and the obtained list object is empty.
[0134] The embodiment of the present application provides a way to obtain an open dropdown list. The electronic device can obtain the open dropdown list in the above manner. When the dropdown list is not open, the obtained list object is empty.
[0135] Before executing the above step S22 (or step S12), the electronic device can obtain the list object associated with the BIOS setup interface in the above manner, and the obtained list object is the first list object.
[0136] After executing the above step S22 (or step S12) and before executing the above step S23 or step S24, the electronic device can obtain the list object associated with the BIOS setup interface in the above manner, and the obtained list object is the second list object.
[0137] In the embodiment of the present application, the electronic device can save the obtained first list object and second list object in variables. For example, save the first list object in a first variable (such as gCurOpenedDowndropList), and save the obtained second list object in a second variable (such as OpenedDowndropList) to detect the first list object and the second list object.
[0138] When the input state included in the event information is the press state, the electronic device can detect the obtained first list object and second list object, and determine the target processing method of the input event according to the input key value of the input event and whether the first list object and the second list object are empty. The above input event processing method can also include: if the input key value of the input event is the exit key value, the first list object is not empty, and the second list object is empty, then determine that the target processing method is skip processing; if the input key value of the input event is the exit key value, and both the first list object and the second list object are not empty, then execute the step of determining the target processing method associated with the input key value of the input event according to the pre-configured association relationship between the input key value and the processing method.
[0139] In the embodiments of the present application, the electronic device can determine whether the input key value included in the event information of the input event is an exit key value. If it is not the exit key value, the electronic device can execute the above step S23. If it is the exit key value, the electronic device further determines whether the first list object and the second list object are empty. If the first list object is not empty and the second list object is empty, it means that the pull-down list in the BIOS setup interface was opened before step S22 was executed and the pull-down list in the BIOS setup interface was closed after step S22 was executed. The electronic device closed the opened pull-down list by executing step S22. To avoid repeated closing, the electronic device can determine that the target processing method is skip processing. If both the first list object and the second list object are not empty, it means that the pull-down list in the BIOS setup interface was opened before and after the electronic device executed step S22. The electronic device did not successfully close the opened pull-down list by executing step S22. Then, the electronic device can determine the target processing method associated with the input key value (i.e., the exit key value) of the input event according to the pre-configured association relationship.
[0140] In some embodiments, the input device can be a mouse. When the input device is a mouse (i.e., the input type included in the event information is the mouse type), the event information can include the input state and the input position. In the embodiments of the present application, the event information can also include the input type and / or the input key value. The input type is the mouse type, and the input key value can be empty. As Figure 3 shown, there is also provided an input event processing method applied to an electronic device on which a BIOS setup interface is displayed. The method can include:
[0141] Step S31, obtaining an input event of the input device.
[0142] Step S32, in the objects displayed on the BIOS setup interface, searching for the first focus object affected by the input event to process the input event by using the component associated with the first focus object.
[0143] Step S33, if the input state of the input event is the press state, determining the target position relationship between the input position of the input event and the regional position of the preset object on the BIOS setup interface; and determining the target processing method associated with the target position relationship according to the pre-configured association relationship between the position relationship and the processing method.
[0144] Step S34, if the input state of the input event is the release state, determining that the target processing method is skip processing.
[0145] Step S35, processing the input event according to the target processing method.
[0146] The above steps S31 to S32 are the same as the above steps S11 to S12, and the above step S35 is the same as the above step S14.
[0147] In the technical solution provided by the embodiment of the present application, when the input device is a mouse, the electronic device determines the processing method of the input event according to the input state and the input position. When the input state is the release state, the electronic device does not process the input event to improve the processing speed of the input event; when the input state is the press state, the electronic device processes the input event according to the pre-configured association relationship between the position relationship and the processing method, and provides a method for processing the input event based on the position relationship.
[0148] In the embodiment of the present application, when the input device is a mouse, after the electronic device executes step S32 and generates the event information of the input event, it can call a preset mouse event processing function (such as MOUSE_CALLBACK_FUNC), and execute step S33 or step S34 according to whether the input state included in the event information is the press state or the release state.
[0149] In the embodiment of the present application, the preset mouse event processing function can be defined in the mouse event processing module and pre-registered in a preset variable (such as gMouseCallback). The electronic device calls this variable to implement the call of the mouse event processing function.
[0150] In the above step S33, the input state included in the event information is the press state, indicating that the input event is an input event that needs to be processed. The preset object is an object associated with the input event processed according to the position relationship. The preset object may include at least one of a calendar object and a time setting object, and can be specifically set according to actual needs, and the preset object is not limited here.
[0151] The area position is the position displayed on the object BIOS setting interface. The electronic device can determine the position where the preset object is displayed on the BIOS setting interface to obtain the area position, and determine the position relationship between the area position and the input position according to the input position included in the event information of the input event. The determined position relationship is the target position relationship.
[0152] In some embodiments, before determining the target position relationship, the electronic device may further perform the following steps: determine whether the preset object is displayed on the BIOS setting interface; if so, perform the step of determining the target position relationship between the input position of the input event and the area position of the preset object on the BIOS setting interface; if not, determine that the target processing method is to skip the processing.
[0153] The electronic device can first determine whether a preset object is displayed on the BIOS setup interface to determine whether the object associated with the obtained input event is displayed and whether the input event needs to be processed, so as to improve the processing speed of the input event.
[0154] When the preset object is displayed on the BIOS setup interface, the electronic device can determine that the object associated with the obtained input event is displayed and the input event needs to be processed, then determine the regional position of the preset object, and determine the target position relationship according to the regional position.
[0155] When the preset object is not displayed on the BIOS setup interface, the electronic device can determine that the object associated with the obtained input event is not displayed and the input event does not need to be processed, and directly determine that the target processing method is to skip processing, that is, not to process.
[0156] For example, if the preset object is a calendar object, the electronic device can determine whether the calendar object is displayed on the BIOS setup interface. If the calendar object is displayed, the regional position of the calendar object is determined, and the target position relationship between the regional position of the calendar object and the input position of the mouse is determined.
[0157] In the embodiments of the present application, the position relationship may include a first position relationship and a second position relationship. The first position relationship is that the input position is within the regional position of the preset object, and the second position relationship is that the input position is outside the regional position of the preset object. The electronic device can determine the target position relationship as the first position relationship or the second position relationship according to the regional position of the preset object and the input position.
[0158] The association relationship between the position relationship and the processing method is pre-configured in the electronic device. The processing method associated with the first position relationship is to skip processing; the processing method associated with the second position relationship is to close the object. The position relationship and the associated processing method can be set according to actual needs, and no limitation is imposed thereon.
[0159] The electronic device can determine the processing method associated with the target position relationship, and this processing method is the target processing method. After that, the electronic device can execute step S35 and process the obtained input event according to the target processing method.
[0160] For example, if the preset object is a calendar object and the target position relationship is the second position relationship, indicating that the input position is outside the regional position of the calendar object and the user clicks on a position outside the calendar object, the electronic device can determine that the target processing method is to close the object, execute step S35, and close the calendar object; if the target position relationship is the first position relationship, indicating that the input position is within the regional position of the calendar object and the user clicks on a position within the calendar object, the electronic device can determine that the target processing method is to skip processing, execute step S35, and do not process the input event, that is, do not close the calendar object.
[0161] Combined with the above Figure 2 and Figure 3 , an embodiment of the present application further provides an input event processing method. As Figure 4 shown, it is applied to an electronic device on which a BIOS setting interface is displayed. The method may include:
[0162] Step S41, obtain an input event of an input device.
[0163] Step S42, among the objects displayed on the BIOS setting interface, find the first focus object affected by the input event, so as to process the input event by using the component associated with the first focus object. When the input device is a keyboard, the electronic device executes Step S43 or Step S44; when the input device is a mouse, Step S45 or Step S46 is executed.
[0164] Step S43, if the input state of the input event is the pressed state, determine the target processing method associated with the input key value of the input event according to the pre-configured association relationship between the input key value and the processing method.
[0165] Step S44, if the input state of the input event is the released state, determine that the target processing method is to skip processing.
[0166] Step S45, if the input state of the input event is the pressed state, determine the target position relationship between the input position of the input event and the area position of a preset object on the BIOS setting interface; determine the target processing method associated with the target position relationship according to the pre-configured association relationship between the position relationship and the processing method.
[0167] Step S46, if the input state of the input event is the released state, determine that the target processing method is to skip processing.
[0168] Step S47, process the input event according to the target processing method.
[0169] The above Step S41 to Step S42 are the same as the above Step S11 to Step S12, the above Step S43 to Step S44 are the same as the above Step S23 to Step S24, the above Step S45 to Step S46 are the same as the above Step S33 to Step S34, and the above Step S47 is the same as the above Step S14. For specific details, please refer to the relevant description in the above Figures 1 to 3 part and will not be elaborated here.
[0170] When the input device is a keyboard and the technical solution provided in the embodiment of the present application is applied, the electronic device determines the processing method of the input event according to the input state and the input key value. When the input state is the release state, the electronic device does not process the input event to improve the input event processing speed; when the input state is the press state, the electronic device processes the input event according to the pre-configured association relationship between the input key value and the processing method, and provides various ways to process the input event. When the input device is a mouse, the electronic device determines the processing method of the input event according to the input state and the input position. When the input state is the release state, the electronic device does not process the input event to improve the input event processing speed; when the input state is the press state, the electronic device processes the input event according to the pre-configured association relationship between the position relationship and the processing method, and provides a way to process the input event based on the position relationship.
[0171] The following details the input event processing method provided in the embodiment of the present application for the BIOS setting interface based on LVGL.
[0172] In the embodiment of the present application, a drop-down list acquisition library function (such as lv_dropdown_get_current_opened_list) is added to the LVGL library to obtain the drop-down list opened on the current page (i.e., the BIOS setting interface). This function does not require input parameters, and the return value is a pointer to a structure (such as the object lv_obj_t indicating the opened drop-down list), defined as: lv_obj_t* lv_dropdown_get_current_opened_list(void).
[0173] The process for the electronic device to implement this function is as follows: 1) Call the interface lv_group_get_default to obtain the default group including all objects on the current page. 2) Call the interface lv_group_get_focused to obtain the LVGL object corresponding to the focus in the default group; if the LVGL object corresponding to the focus does not exist, the return value is NULL; if the LVGL object corresponding to the focus exists, continue to execute the following steps. 3) Call the interface lv_obj_check_type to determine whether the type of the LVGL object corresponding to the focus is a dropdown list type (such as lv_dropdown_class); if not, the return value is NULL; if so, indicating that the LVGL object corresponding to the focus is a dropdown list object, continue to execute the following steps. 4) Call the interface lv_dropdown_get_list to obtain the opened dropdown list on the current page; if the dropdown list is not opened, the return value is NULL; if the dropdown list is opened, the return value is the opened dropdown list (that is, the pointer to the object indicating the opened dropdown list).
[0174] In the embodiments of this application, a keyboard event handling function (such as KEYPAD_CALLBACK_FUNC) and a mouse event handling function (such as MOUSE_CALLBACK_FUNC), as well as the module defining these two functions, are added. The following will elaborate on these two functions respectively.
[0175] 1) The keyboard event handling function is a callback function for handling input events corresponding to the keyboard (such as input events of the input type LV_INDEV_TYPE_KEYPAD), and is defined in the keyboard event handling module. The input parameters of this function are the input state (such as IndevState, with the data type UINT32) and the input key value (such as CurrentKey, with the data type UINT32), and there is no return value. The function prototype is defined as: typedef VOID(*KEYPAD_CALLBACK_FUNC)(IN UINT32IndevState,IN UINT32 CurrentKey).
[0176] In the keyboard event handling module, functions for registering a keyboard event handling function (such as RegisterKeypadCallback) and unregistering a keyboard event handling function (such as UnregisterKeypadCallback) are also defined. The register keyboard event handling function is used to bind a keyboard event handling function to a variable (such as gKeypadCallback). The input parameter of this function is the keyboard event handling function and it has no return value. It is defined as: VOID RegisterKeypadCallback(IN KEYPAD_CALLBACK_FUNC Callback). The unregister keyboard event handling function is used to unbind the keyboard event handling function from the variable. This function has no input parameter and no return value. It is defined as: VOID UnregisterKeypadCallback(VOID).
[0177] The keyboard handling function can be saved to the variable gKeypadCallback by registering the keyboard event handling function: KEYPAD_CALLBACK_FUNC gKeypadCallback.
[0178] 2) The mouse event handling function is a callback function for handling input events corresponding to the mouse (such as input events of the input type LV_INDEV_TYPE_POINTER), which is defined in the mouse event handling module. The input parameters of this function are the input state (such as IndevState, with the data type UINT32) and the input key value (such as Point, with the data type lv_point_t), and it has no return value. The function prototype is defined as: typedef VOID(*MOUSE_CALLBACK_FUNC)(IN UINT32 IndevState,IN lv_point_t Point).
[0179] In the mouse event handling module, functions for registering a mouse event handling function (such as RegisterMouseCallback) and unregistering a mouse event handling function (such as UnregisterMouseCallback) are also defined. The register mouse event handling function is used to bind a mouse event handling function to a variable (such as gMouseCallback). The input parameter of this function is the mouse event handling function and it has no return value. It is defined as: VOID RegisterMouseCallback(IN MOUSE_CALLBACK_FUNC Callback). The unregister mouse event handling function is used to unbind the mouse event handling function from the variable. This function requires no input parameter and has no return value. It is defined as: VOID UnregisterMouseCallback(VOID).
[0180] The mouse handling function can be saved to the variable gMouseCallback by registering the mouse event handling function: MOUSE_CALLBACK_FUNC gMouseCallback.
[0181] (1) Add the linked list gIndevEventLL to record input device events (i.e., input events).
[0182] Every preset task cycle, the electronic device executes an input device event reading task (such as lv_indev_read_task) in the main loop, obtains the status parameters of the input device, reads the input device events, and processes the input device events using the components associated with the objects affected by the input device events to avoid affecting the input device event handling process inside the LVGL framework. The electronic device can synchronously generate input device event information and record it in the linked list gIndevEventLL. Each node in the linked list represents an input device event, and the input device event information of each input device event is recorded in this node according to a defined structure (such as SETUP_INDEV_EVENT_INFO). It is defined as:
[0183] typedef struct_SETUP_INDEV_EVENT_INFO{
[0184] UINT32 IndevType;
[0185] UINT32 IndevState;
[0186] UINT32 CurrentKey;
[0187] lv_point_t Point;
[0188] }SETUP_INDEV_EVENT_INFO。
[0189] The structure includes four types of data, namely: 1) The input device type IndevType with the data type of UINT32, and the value can be LV_INDEV_TYPE_KEYPAD (indicating the keyboard) or LV_INDEV_TYPE_POINTER (indicating the mouse). 2) The input device state IndevState with the data type of UINT32, and the value can be LV_INDEV_STATE_REL (indicating the key press state on the keyboard or the left button press state of the mouse) or LV_INDEV_STATE_PR (indicating the key release state on the keyboard or the left button release state of the mouse). 3) The input key value CurrentKey with the data type of UINT32, and the value is the key value currently input by the keyboard. If the input device type is LV_INDEV_TYPE_POINTER, CurrentKey in the event information is empty. 4) The input position Point with the data type of lv_point_t, and the value is the current position of the mouse, that is, the coordinates of the mouse. If the input device type is LV_INDEV_TYPE_KEYPAD, Point in the event information is empty.
[0190] (2) Traverse the linked list gIndevEventLL and process input device events
[0191] Before the start of the next task cycle after the electronic device processes the input device events using the components associated with the object affected by the input device events in the main loop, traverse the linked list gIndevEventLL, and call the corresponding callback functions for processing according to the input device types in the input device event information recorded by the linked list nodes.
[0192] For example, when IndevType is LV_INDEV_TYPE_KEYPAD, gKeypadCallback is called; when IndevType is LV_INDEV_TYPE_POINTER, gMouseCallback is called.
[0193] Finally, after the electronic device processes all input device events, it can clear the linked list gIndevEventLL to save space.
[0194] (3) Keyboard event processing module
[0195] The electronic device only processes input device events with the input device state IndevState being LV_INDEV_STATE_PR. The electronic device enters the corresponding processing flow according to the input key value CurrentKey and the processing method shown in Table 1, that is, processes the input device events according to the target processing method.
[0196] To solve the problem of exiting the page caused by the Esc key closing the dropdown list, before the electronic device processes the input device event using the component associated with the object affected by the input device event in the main loop, the electronic device can call an interface (such as lv_dropdown_get_current_opened_list) to obtain the currently opened dropdown list (that is, the pointer to the object indicating the opened dropdown list) and save it to a variable (such as gCurOpenedDowndropList).
[0197] After the electronic device processes the input device event using the component associated with the object affected by the input device event in the main loop and before traversing the linked list gIndevEventLL to process the input device event, the electronic device calls the interface again to obtain the currently opened dropdown list and saves it to a variable (such as OpenedDowndropList).
[0198] The electronic device determines whether the input key value is the Esc key (that is, the exit key value), and whether gCurOpenedDowndropList and OpenedDowndropList are empty. When the input key value is the Esc key, gCurOpenedDowndropList is not empty, and OpenedDowndropList is empty, it means that the dropdown list has been closed in the input device event processing flow (that is, the main loop) within the LVGL framework, so the electronic device does not need to process the input device event corresponding to the Esc key again.
[0199] (4) Mouse event processing module
[0200] The electronic device only processes input device events with the input device state IndevState being LV_INDEV_STATE_PR. The preset objects are a calendar object and a time / hour / minute / second setting object (that is, a time setting object).
[0201] The electronic device can first determine whether the calendar object is opened. If the calendar object is opened, it determines whether the position of the mouse click (that is, Point) is within the area of the calendar object. If it is within the area of the calendar object, it means the user is setting the date, and the input device event is skipped; if it is not within the area of the calendar object (that is, outside the area), the calendar object is closed.
[0202] Similarly, the electronic device can first determine whether the hour / minute / second setting object is open. If the hour / minute / second setting object is open, it determines whether the position clicked by the mouse (i.e., Point) is within the area position of the hour / minute / second setting object. If it is within the area position of the hour / minute / second setting object, it indicates that the user is setting the time, and the input device event is skipped; if it is not within the area position of the hour / minute / second setting object, the hour / minute / second setting object is closed.
[0203] The electronic device can also first determine whether the calendar object is open. If the calendar object is not open, it then determines whether the hour / minute / second setting object is open, and processes the input device event according to the position clicked by the mouse. The order in which the electronic device determines whether the calendar object is open and whether the hour / minute / second setting object is open is not limited here.
[0204] Applying the technical solution provided by the embodiment of the present application, using a linked list to record input device events and extending the input device event processing flow of LVGL enables the BIOS Setup interface based on LVGL to support keyboard input shortcut operations and special requirements for mouse clicks. In addition, a library function lv_dropdown_get_current_opened_list is added to the LVGL library, which can obtain the currently opened dropdown list, enriching the library functions of the dropdown list in LVGL.
[0205] Corresponding to the above input event processing method, the embodiment of the present application also provides an input event processing device, as Figure 5 shown, applied to an electronic device with a BIOS setup interface displayed thereon. The device includes:
[0206] An acquisition module 51, configured to acquire an input event of an input device;
[0207] A search module 52, configured to search for a first focus object affected by the input event among the objects displayed on the BIOS setup interface, so as to process the input event by using the component associated with the first focus object;
[0208] A determination module 53, configured to determine a target processing method associated with the event information of the input event according to the pre-configured association relationship between event information and processing methods;
[0209] A processing module 54, configured to process the input event according to the target processing method.
[0210] In the technical solution provided by the embodiment of the present application, an association relationship between event information and a processing method is pre-configured in the electronic device. After the electronic device obtains an input event of the input device, it first uses the component associated with the focus object affected by the input event to process the input event, and then determines the target processing method associated with the event information of the obtained input event according to the pre-configured association relationship, and processes the input event according to the target processing method. In this process, it is not necessary to find the focus object affected by the input event to process the input event. Applying the technical solution provided by the embodiment of the present application, for an input event that does not only act on a specific object, the electronic device can also process it according to the pre-configured processing method, and does not affect the normal processing of other input events, realizing the processing of an input event that does not only act on a specific object, and thus realizing the corresponding function.
[0211] In some embodiments, the input device may be a keyboard, and the event information may include an input state and an input key value; the determining module 53 may specifically be used for:
[0212] If the input state of the input event is a pressed state, determine the target processing method associated with the input key value of the input event according to the pre-configured association relationship between the input key value and the processing method;
[0213] If the input state of the input event is a released state, determine that the target processing method is skip processing.
[0214] In some embodiments, the input key value of the input event may be a preset key value, and the processing module 54 may specifically be used for:
[0215] In the objects displayed on the BIOS setup interface, find the second focus object affected by the input event;
[0216] Use the component associated with the second focus object to process the input event according to the target processing method.
[0217] In some embodiments, the input key value may include an exit key value, and the processing method associated with the input key value being the exit key value may be to close the object; the determining module 53 may further be used for:
[0218] Detect the first list object and the second list object associated with the BIOS setup interface. The first list object indicates the opened drop-down list displayed on the BIOS setup interface before finding the object affected by the input event among the objects displayed on the BIOS setup interface, and the second list object indicates the opened drop-down list displayed on the BIOS setup interface after finding the object affected by the input event among the objects displayed on the BIOS setup interface;
[0219] If the input key value of the input event is the exit key value, the first list object is not empty, and the second list object is empty, then it is determined that the target processing method is skip processing;
[0220] If the input key value of the input event is the exit key value, and both the first list object and the second list object are not empty, then perform the step of determining the target processing method associated with the input key value of the input event according to the pre-configured association relationship between the input key value and the processing method.
[0221] In some embodiments, the device may further include: a recording module, configured to:
[0222] Determine a third focus object from all the objects displayed on the BIOS setup interface;
[0223] If the type of the third focus object is a drop-down list type, and the drop-down list indicated by the third focus object is open, then obtain the opened drop-down list to obtain a list object indicating the opened drop-down list, where the list object includes a first list object and a second list object.
[0224] In some embodiments, the input device may be a mouse, and the event information may include an input state and an input position; the determining module 53 may specifically be configured to:
[0225] If the input state of the input event is the pressed state, then determine the target position relationship between the input position of the input event and the regional position of the preset object on the BIOS setup interface; according to the pre-configured association relationship between the position relationship and the processing method, determine the target processing method associated with the target position relationship;
[0226] If the input state of the input event is the released state, then determine that the target processing method is skip processing.
[0227] In some embodiments, the determining module 53 may further be configured to:
[0228] Determine whether a preset object is displayed on the BIOS setup interface;
[0229] If so, then perform the step of determining the target position relationship between the input position of the input event and the regional position of the preset object on the BIOS setup interface;
[0230] If not, then determine that the target processing method is skip processing.
[0231] In some embodiments, the position relationship may include a first position relationship and a second position relationship. The first position relationship may be that the input position is within the regional position of the preset object, and the second position relationship may be that the input position is outside the regional position of the preset object; the processing method associated with the first position relationship may be skip processing; the processing method associated with the second position relationship may be to close the object.
[0232] The embodiment of the present application further provides an electronic device, such as Figure 6 shown, including a processor 61 and a machine-readable storage medium 62. The machine-readable storage medium 62 stores machine-executable instructions that can be executed by the processor 61. The processor 61 is prompted by the machine-executable instructions to implement any of the above input event processing methods.
[0233] The machine-readable storage medium may include a Random Access Memory (RAM), or may also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the machine-readable storage medium may also be at least one storage device located away from the aforementioned processor.
[0234] The processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be 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.
[0235] In another embodiment provided by the present application, there is also provided a computer-readable storage medium. The computer program stored in the computer-readable storage medium, when executed by a processor, implements any of the above input event processing methods.
[0236] In another embodiment provided by the present application, there is also provided a computer program product containing instructions. When it runs on a computer, it causes the computer to execute any of the input event processing methods in the above embodiments.
[0237] 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 the embodiments of the present 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 computer-readable storage medium. 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 (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer, 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.
[0238] It should be noted that in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "comprising a..." does not exclude the existence of additional identical elements in the process, method, article, or device comprising the element.
[0239] Each embodiment in this specification is described in a related manner. The same or similar parts among the embodiments can be referred to each other, and the differences between each embodiment and other embodiments are emphasized. In particular, for the embodiments of the device, electronic device, storage medium, and program product, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0240] The above are only the preferred embodiments of the present application and are not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application are all included in the protection scope of the present application.
Claims
1. An input event processing method, characterized in that, Applied to an electronic device, where a BIOS setup interface is displayed on the electronic device, the method includes: Obtain an input event of an input device; Among the objects displayed on the BIOS setup interface, find a first focus object to which the input event applies, so as to process the input event by using a component associated with the first focus object; Determine a target processing method associated with the event information of the input event according to a pre-configured association relationship between event information and processing methods; Process the input event according to the target processing method.
2. The method according to claim 1, characterized in that, The input device is a keyboard, and the event information includes an input state and an input key value; The step of determining a target processing method associated with the event information of the input event according to a pre-configured association relationship between event information and processing methods includes: If the input state of the input event is a pressed state, determine a target processing method associated with the input key value of the input event according to a pre-configured association relationship between input key values and processing methods; If the input state of the input event is a released state, determine that the target processing method is to skip processing.
3. The method according to claim 2, characterized in that, The input key value of the input event is a preset key value, and the step of processing the input event according to the target processing method includes: Among the objects displayed on the BIOS setup interface, find a second focus object to which the input event applies; Use a component associated with the second focus object to process the input event according to the target processing method.
4. The method according to claim 2, wherein The input key value includes an exit key value, and the processing method associated with the input key value being the exit key value is to close the object; the method further includes: Detect a first list object and a second list object associated with the BIOS setup interface. The first list object indicates a drop-down list that has been opened on the BIOS setup interface before finding the first focus object to which the input event applies among the objects displayed on the BIOS setup interface, and the second list object indicates a drop-down list that has been opened on the BIOS setup interface after finding the first focus object to which the input event applies among the objects displayed on the BIOS setup interface; If the input key value of the input event is the exit key value, the first list object is not empty, and the second list object is empty, then determine that the target processing method is to skip processing; If the input key value of the input event is the exit key value, and both the first list object and the second list object are not empty, then execute the step of determining a target processing method associated with the input key value of the input event according to a pre-configured association relationship between input key values and processing methods.
5. The method according to claim 4, wherein The method further includes: Determine a third focus object from all the objects displayed on the BIOS setup interface; If the type of the third focus object is a drop-down list type, and the drop-down list indicated by the third focus object has been opened, then obtain the opened drop-down list to obtain a list object indicating the opened drop-down list, and the list object includes the first list object and the second list object.
6. The method according to claim 1, wherein The input device is a mouse, and the event information includes an input state and an input position; The step of determining the target processing method associated with the event information of the input event according to the pre-configured association relationship between event information and processing method includes: If the input state of the input event is the pressed state, determine the target position relationship between the input position of the input event and the regional position of a preset object on the BIOS setup interface; according to the pre-configured association relationship between position relationship and processing method, determine the target processing method associated with the target position relationship; If the input state of the input event is the released state, determine that the target processing method is skip processing.
7. The method according to claim 6, characterized in that, The method further includes: Judge whether a preset object is displayed on the BIOS setup interface; If so, execute the step of determining the target position relationship between the input position of the input event and the regional position of the preset object on the BIOS setup interface; If not, determine that the target processing method is skip processing.
8. The method according to claim 6 or 7, characterized in that The position relationship includes a first position relationship and a second position relationship. The first position relationship is that the input position is within the regional position of the preset object, and the second position relationship is that the input position is outside the regional position of the preset object; the processing method associated with the first position relationship is skip processing; The processing method associated with the second position relationship is to close the object.
9. An input event processing device, characterized in that, Applied to an electronic device, on which a BIOS setup interface is displayed, the device includes: An acquisition module, configured to acquire an input event of an input device; A search module, configured to search for a first focus object acted on by the input event among the objects displayed on the BIOS setup interface, so as to process the input event by using a component associated with the first focus object; A determination module, configured to determine the target processing method associated with the event information of the input event according to the pre-configured association relationship between event information and processing method; A processing module, configured to process the input event according to the target processing method.
10. The device according to claim 9, characterized in that, The input device is a keyboard, and the event information includes an input state and an input key value; the determination module is specifically configured to: If the input state of the input event is the pressed state, determine the target processing method associated with the input key value of the input event according to the pre-configured association relationship between the input key value and the processing method; If the input state of the input event is the released state, determine that the target processing method is skip processing.
11. The device according to claim 10, wherein The input key value of the input event is a preset key value, and the processing module is specifically configured to: Search for a second focus object acted on by the input event among the objects displayed on the BIOS setup interface; Use the component associated with the second focus object to process the input event according to the target processing method.
12. The device according to claim 9, characterized in that, The input device is a mouse, and the event information includes an input state and an input position; the determination module is specifically configured to: If the input state of the input event is the pressed state, determine the target position relationship between the input position of the input event and the regional position of a preset object on the BIOS setup interface; according to the pre-configured association relationship between position relationship and processing method, determine the target processing method associated with the target position relationship; If the input state of the input event is a release state, determine that the target processing method is skip processing.
13. The device according to claim 12, wherein The positional relationship includes a first positional relationship and a second positional relationship. The first positional relationship is that the input position is within the regional position of a preset object, and the second positional relationship is that the input position is outside the regional position of the preset object; the processing method associated with the first positional relationship is skip processing; The processing method associated with the second positional relationship is to close the object.
14. An electronic device, characterized in that, It includes a processor and a machine-readable storage medium. The machine-readable storage medium stores machine-executable instructions that can be executed by the processor. The processor is prompted by the machine-executable instructions to implement the method according to any one of claims 1-8.
15. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium. When the computer program is executed by a processor, the method according to any one of claims 1-8 is implemented.