Key value response method and apparatus, and electronic device and readable storage medium
By responding to key operations in the UI page, obtaining key values and registering the key manager, the problem that the same key values can only achieve one function on different UI pages is solved, and the versatility of key values between different pages is achieved.
Patent Information
- Application Number
- PCT/CN2024/132781
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-11-24
- Filing Date
- 2024-11-18
- Publication Date
- 2025-05-30
AI Technical Summary
The same key value can only achieve one function on different UI pages, and it cannot perform different business functions between different pages.
By responsive to the key operation, the key value is obtained and the object information of each source object is obtained. For each source object, if its object information meets the preset conditions, it is determined that at least one key manager registered on the target UI page is the target key manager. Pass the key value into the target service callback through the target key manager, causing the target UI page to execute the corresponding service.
It realizes that the same key value plays different roles on different UI pages. Even if the same key value is the same, different UI pages can perform different services.
Smart Images

Figure CN2024132781_30052025_PF_FP_ABST
Abstract
Description
Key-value response method, device, electronic device, and readable storage medium
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on November 24, 2023, with application number 202311594200.X, and invention name “Key-value response method, device, electronic device and readable storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application belongs to the field of LVGL technology, and in particular relates to a key-value response method, device, electronic device and readable storage medium. Background Art
[0003] Currently, users input key values through input devices to control UI pages to perform business. However, because key values are just numerical values, the same key value can only perform one function on different UI pages. Summary of the Invention
[0004] The embodiments of the present application provide a key-value response method, device, electronic device, and readable storage medium, which can solve the problem that the same key value can only achieve one function on different UI pages.
[0005] In a first aspect, an embodiment of the present application provides a key-value response method, comprising:
[0006] In response to a key operation, obtaining a key value;
[0007] Get object information of each source object;
[0008] For each source object, if the object information of the source object meets a preset condition, determining at least one button manager registered on a target UI page as a target button manager, wherein the target UI page is determined based on the source object, and the button managers of different UI pages are different;
[0009] The key value is passed into the target service callback through the target key manager so that the target UI page executes the corresponding service. The key manager is provided with the source object and service callback.
[0010] In one embodiment, obtaining object information of each source object includes:
[0011] Using the first interface to capture the area of each source object, and obtain the coordinates of each source object;
[0012] Obtaining the UI page corresponding to each source object using the second interface;
[0013] Use the third interface to obtain the currently active page;
[0014] For each source object, determining a state of the UI page of the source object according to the UI page corresponding to the source object and the currently active page;
[0015] Obtaining the visible attribute of each source object using the fourth interface;
[0016] Obtaining valid attributes of each source object using the fifth interface;
[0017] For each source object, determining a state of the source object or a UI page corresponding to the source object according to the visible attribute and the valid attribute of the source object;
[0018] The object information includes the coordinates and status of the source object and the status of the UI page where the source object is located.
[0019] In one embodiment, when the source object is a page element, the object information of the source object meets the preset conditions, including:
[0020] When the coordinates of the source object are the same as the preset coordinates, the state of the source object is visible, and the state of the UI page where the source object is located is active, it is determined that the object information of the source object meets the preset conditions, and the target UI page is the UI page where the source object is located;
[0021] When the source object is a full-screen page, the object information of the source object meets the preset conditions, including:
[0022] When the coordinates of the source object are the same as the preset coordinates and the status of the UI page corresponding to the source object is active and visible, it is determined that the object information of the source object meets the preset conditions, and the target UI page is the UI page corresponding to the source object.
[0023] In one embodiment, when the button manager is further provided with a button category;
[0024] The method further comprises:
[0025] If the object information of the source object meets the preset condition, at least one of the key managers registered on the target UI page and meeting the key category to which the key operation belongs is determined as a target key manager.
[0026] In one embodiment, before obtaining the key value in response to the key operation, the method further includes:
[0027] In response to the first registration operation, the button manager is registered on the UI page of the service to be executed.
[0028] In one embodiment, before obtaining the object information of each source object, the method further includes:
[0029] Traverse the button manager and refresh the source object in the button manager.
[0030] In one embodiment, before obtaining the key value in response to the key operation, the method further includes:
[0031] In response to the second registration operation, a key event is registered, and the key event is used to monitor key triggering and respond to the key operation.
[0032] In a second aspect, an embodiment of the present application provides a key-value response device, comprising:
[0033] A control module, configured to obtain a key value in response to a key operation;
[0034] It is also used to obtain object information of each source object;
[0035] a management module configured to, for each source object, determine at least one button manager registered on a target UI page as a target button manager if the object information of the source object meets a preset condition, wherein the target UI page is determined based on the source object;
[0036] It is also used to pass the key value into the target business callback through the target button manager so that the target UI page executes the corresponding business. The source object and business callback are set in the button manager.
[0037] In a third aspect, an embodiment of the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method described in any one of the first aspects above is implemented.
[0038] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method as described in any one of the above-mentioned first aspects is implemented.
[0039] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on an electronic device, enables the electronic device to execute any one of the methods described in the first aspect above.
[0040] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0041] The embodiment of the present application obtains a key value in response to a key operation; obtains object information of each source object; for each source object, if the object information of the source object meets the preset conditions, determines at least one key manager registered in the target UI page as the target key manager, the target UI page is determined based on the source object, and different UI pages have different key managers; passes the key value to the target business callback through the target key manager to enable the target UI page to execute the corresponding business. The key manager is provided with a source object and a business callback, so that based on the key manager, the same key value plays different roles in different UI pages, so that even with the same key value, different UI pages can execute different businesses.
[0042] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0044] FIG1 is a schematic diagram of a first flow chart of a key-value response method provided in an embodiment of the present application.
[0045] FIG2 is a second flow chart of the key-value response method provided in an embodiment of the present application.
[0046] FIG3 is a third flow chart of the key-value response method provided in an embodiment of the present application.
[0047] FIG4 is a fourth flow chart of the key-value response method provided in an embodiment of the present application.
[0048] FIG5 is a schematic diagram of the structure of a key-value response device provided in an embodiment of the present application.
[0049] FIG6 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.
[0051] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.
[0052] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0053] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0054] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0055] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0056] FIG1 is a schematic diagram of a first flow chart of a key-value response method provided in an embodiment of the present application. As shown in FIG1 , the method is applied to an electronic device and includes:
[0057] S11: In response to a key operation by the user, a key value is obtained.
[0058] In an application, a user can perform key operations through an input module equipped with keys. The input module can be an external device or a module installed on an electronic device. The electronic device uses the LVGL (Light and Versatile Graphics Library, an open source embedded graphics library) framework to detect key operations and, in response to the key operations, obtain the key value corresponding to the key operations.
[0059] The electronic device is equipped with an LVGL framework and a screen to correctly display the UI page. The electronic device can be a POS (Point of Sales), an electronic watch, a bare metal device, a single-chip microcomputer, etc.
[0060] In one possible implementation, when the electronic device is equipped with an LVGL key driver system, the key value is obtained through the LVGL key driver system. If the electronic device is not equipped with an LVGL key driver system, the key value is obtained by calling an interface. If the electronic device is a bare metal device or a single-chip microcomputer, the key value is obtained through a third-party library or by detecting the underlying level signal.
[0061] In a possible implementation, a key management program is set in the electronic device. After the key value is obtained, an interface is called to call the key management program to perform the following steps.
[0062] S12: Obtain object information of each source object.
[0063] In an application, the object information of a source object can be obtained through the interface provided by the LVGL framework. The object information is used to describe the source object itself and states related to the source object.
[0064] S13: For each source object, if the object information of the source object meets a preset condition, determine at least one button manager registered in the target UI page as a target button manager.
[0065] The target UI page is determined by the source object. Different UI pages have different button managers, which are configured with source objects and service callbacks. The button manager is a structure used to manage the connection between UI pages and button values.
[0066] In the application, when the object information of the source object meets the preset conditions, it indicates that the UI page associated with the source object, that is, the target UI page, is the UI page that currently needs to perform the business, and at least one button manager registered with the target UI page is determined to be the target button manager. At the same time, the target button manager is an appropriate button manager.
[0067] S14: The key value is passed to the target service callback through the target key manager, so that the target UI page executes the corresponding service.
[0068] In the application, the target button manager passes the key value as a parameter to the business callback. The business callback executes the corresponding business according to the key value, so that the target UI page executes the corresponding business.
[0069] It should be noted that, since at least one button manager is selected according to the target UI page, the user can complete multiple different services on the UI page based on multiple button managers in a single button operation.
[0070] This embodiment obtains key values in response to user key operations; obtains object information of the source object; if the object information of the source object meets the preset conditions, determines at least one key manager registered in the target UI page as the target key manager, and the target UI page is determined based on the source object, and different UI pages have different key managers; passes the key value to the target business callback through the target key manager to enable the target UI page to execute the corresponding business. The source object and business callback are set in the key manager, so that based on the key manager, the same key value plays different roles in different UI pages, so that even with the same key value, different UI pages can execute different businesses.
[0071] In one embodiment, step S12 includes:
[0072] S121: Use the first interface of LVGL to capture the area of each source object and obtain the coordinates of each source object.
[0073] The source object coordinates are the center coordinates of the region of the source object.
[0074] In a possible implementation, the key management program uses the first interface of LVGL to capture the area of each source object to obtain the center coordinates of each source object.
[0075] S122: Obtain the UI page corresponding to each source object using the second interface of LVGL.
[0076] For example, the key management program uses lv_obj_get_screen of LVGL to obtain the virtual screen corresponding to each source object, that is, the UI page.
[0077] S123: Obtain the currently active page using the third interface of LVGL.
[0078] For example, the key manager uses LVGL's lv_scr_act to determine the currently active page.
[0079] S124: For each source object, determine the state of the UI page of the source object according to the UI page corresponding to the source object and the currently active page.
[0080] In the application, for each source object, if the UI page corresponding to the source object is the same as the currently active page, the state of the source object's UI page is determined to be active. If the UI page corresponding to the source object is different from the currently active page, the state of the source object's UI page is determined to be inactive.
[0081] S125: Obtain the visible attribute of each source object using the fourth interface of LVGL.
[0082] For example, the key manager uses LVGL's lv_obj_has_flag to determine the visible attribute of each source object, whether it is hidden or visible.
[0083] S126: Utilize the fifth interface of LVGL to obtain the valid attributes of each source object.
[0084] For example, the key management program uses lv_obj_is_valid of LVGL to determine the validity attribute of each source object, whether it is valid or invalid.
[0085] S127: For each source object, determine the state of the source object or the UI page corresponding to the source object according to the visible attribute and the valid attribute of the source object.
[0086] In the application, for each source object, when the Visible attribute is Visible and the Valid attribute is Valid, the state of the source object or the UI page corresponding to the source object is determined to be Visible. When the Visible attribute is Hidden and the Valid attribute is Valid, the state of the source object or the UI page corresponding to the source object is determined to be Hidden.
[0087] The object information includes the coordinates and status of the source object and the status of the UI page where the source object is located.
[0088] This embodiment obtains the object information of the source object through the LVGL interface to obtain accurate object information.
[0089] In one embodiment, when the source object is a page element, for example, the page element is a control on the page.
[0090] The object information of the source object meets the preset conditions, including:
[0091] When the coordinates of the source object are the same as the preset coordinates, the state of the source object is visible, and the state of the UI page where the source object is located is active, it is determined that the object information of the source object meets the preset conditions, and the target UI page is the UI page where the source object is located.
[0092] For example, the preset condition corresponds to control A being set to preset coordinates (19, 19), the source object being visible, and the UI page where the source object resides being active. Control A has a size of 20*20 and a center coordinate of (19, 19).
[0093] Obtain the object information of each control. If the coordinates of a control are (19, 19), the control is visible, and the UI page where the control resides is active, the object information of the control is determined to meet the preset conditions. The UI page where the control resides is also determined to be the target UI page.
[0094] When the coordinates of the control are not (19, 19) or the size of the control is not 20*20 or the state of the control is hidden or the state of the UI page where the control is located is inactive, it is determined that the object information of the control does not meet the preset conditions.
[0095] When the source object is a full-screen page, the object information of the source object meets the preset conditions, including:
[0096] When the coordinates of the source object are the same as the preset coordinates and the state of the UI page corresponding to the source object is active and visible, it is determined that the object information of the source object meets the preset conditions, and the target UI page is the UI page corresponding to the source object.
[0097] For example, the preset condition corresponds to the full-screen page being set to the preset coordinates of (0, 0), and the state of the UI page of the corresponding source object is visible and active.
[0098] Obtain the object information of the full-screen page. If the coordinates of the full-screen page are (0, 0) and the status of the UI page of the full-screen page is visible and active, determine that the object information of the full-screen page meets the preset conditions. At the same time, determine that the UI page corresponding to the full-screen page is the target UI page.
[0099] When the coordinates of the full screen page are not (0, 0) or the state of the full screen page is hidden or the state of the full screen page is inactive, it is determined that the object information of the full screen page does not meet the preset condition.
[0100] Among them, the preset conditions can be set in advance according to the source object.
[0101] This embodiment accurately determines the target UI page by presetting conditions, and accurately selects a suitable button manager.
[0102] FIG2 is a second flow chart of a key value response method provided by an embodiment of the present application. As shown in FIG2 , when the key manager is further provided with a key category, the method further includes:
[0103] S15: If the object information of the source object meets the preset condition, at least one button manager registered in the target UI page and meeting the button category to which the button operation belongs is determined as the target button manager.
[0104] The button category is set when registering the button manager, and is used to instruct the UI page to perform different services under different buttons.
[0105] In the application, after determining at least one button manager registered on the target UI page, a button manager that matches the button category to which the button operation belongs is selected as the target button manager.
[0106] In this embodiment, the button manager is further provided with button categories so that a more appropriate button manager can be selected and the types of executable services can be increased.
[0107] FIG3 is a schematic diagram of a third flow chart of the key-value response method provided in an embodiment of the present application. As shown in FIG3 , before step S11, the method further includes:
[0108] S21: In response to the user's first registration operation, register a button manager on the UI page of the service to be executed.
[0109] The UI page for pending business operations is the page created by the application. Based on the LVGL framework, multiple pages can be created as needed, and newly created pages overwrite older pages. Typically, the UI page for pending business operations is the most recently created page requiring business execution, i.e., the top-level page in LVGL.
[0110] In an application, a user performs a first registration operation on a UI page for a service to be executed. Specifically, the user sets parameters for the button manager through an interface provided by the button manager. The parameters include a source object, a service callback, and a button category. In response to the first registration operation, the electronic device registers the button manager on the UI page for the service to be executed, so that the UI page for the service to be executed is configured with the corresponding button manager.
[0111] In one possible implementation, the button manager is hosted by a button management program.
[0112] Before step S12, the method further includes:
[0113] S22: traverse the button manager and refresh the source object in the button manager.
[0114] In your application, refresh the source object in the key manager only after detecting a key event and obtaining the key value. This ensures accurate object information for the source object and ensures accurate determination of whether the source object information meets the preset conditions. If the source object in the key manager is refreshed at any other time than before obtaining the source object information, incorrect object information may be obtained when the source object changes, leading to the incorrect target key manager being determined.
[0115] In a possible implementation, the key manager is traversed by the key management program and the source object of the key manager is refreshed.
[0116] This embodiment registers a button manager on the UI page of the business to be executed in response to the user's first registration operation, traverses the button manager before obtaining the object information of the source object, and refreshes the source object in the button manager, thereby reducing the occurrence of incorrect determination of the target button manager.
[0117] FIG4 is a fourth flow chart of the key-value response method provided in an embodiment of the present application. As shown in FIG4 , before step S11, the method further includes:
[0118] S31: In response to the second registration operation of the user, register a key event.
[0119] Among them, the key event is used to monitor key triggering and respond to key operations.
[0120] In an application, the user adds a key event to an LVGL object and performs the second registration operation. Typically, a key event is added to the top-level object in LVGL (e.g., the screen object). Specifically, the user calls the lv_obj_add_event_cb interface to add a key event to the object.
[0121] After registering the key event, the electronic device monitors the key trigger in real time. Once the key trigger is detected, it responds to the user's key operation in a timely manner and obtains the key value.
[0122] This embodiment registers a key event in response to the user's second registration operation, so that the electronic device can respond to the user's key operation in a timely manner.
[0123] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0124] Corresponding to the method described in the above embodiment, for the sake of convenience of explanation, only the part related to the embodiment of the present application is shown.
[0125] FIG5 is a schematic diagram of the structure of a key-value response device provided by an embodiment of the present application. As shown in FIG5 , the device includes:
[0126] The control module 10 is used to obtain a key value in response to a key operation by a user;
[0127] It is also used to obtain object information of the source object;
[0128] A management module 11 is configured to determine at least one button manager registered on a target UI page as a target button manager if the object information of the source object meets a preset condition, wherein the target UI page is determined based on the source object;
[0129] It is also used to pass key values to the target business callback through the target button manager so that the target UI page executes the corresponding business. The button manager is set with the source object and business callback.
[0130] In one embodiment, the control module is specifically used to use the first interface of LVGL to capture the area of each source object and obtain the coordinates of the source object; use the second interface of LVGL to obtain the UI page corresponding to each source object; use the third interface of LVGL to obtain the currently active page; for each source object, determine the status of the UI page of each source object based on the UI page of the corresponding source object and the currently active page; use the fourth interface of LVGL to obtain the visible attributes of each source object; use the fifth interface of LVGL to obtain the valid attributes of each source object; for each source object, determine the status of the source object or the UI page corresponding to the source object based on the visible attributes and valid attributes of the source object; wherein the object information includes the coordinates and status of the source object and the status of the UI page where the source object is located.
[0131] In one embodiment, the management module is specifically used to determine that the object information of the source object meets the preset conditions and the target UI page is the UI page where the source object is located when the coordinates of the source object are the same as the preset coordinates, the state of the source object is visible, and the state of the UI page where the source object is located is active; when the source object is a full-screen page, the object information of the source object meets the preset conditions, including: when the coordinates of the source object are the same as the preset coordinates, the state of the UI page corresponding to the source object is active and visible, determining that the object information of the source object meets the preset conditions, and the target UI page is the UI page corresponding to the source object.
[0132] In one embodiment, the management module is also used to determine at least one key manager registered on the target UI page and meeting the key category to which the key operation belongs as the target key manager if the object information of the source object meets the preset conditions, wherein the key manager is also provided with a key category.
[0133] In one embodiment, the management module is further configured to traverse the button manager and refresh the source objects in the button manager.
[0134] In one embodiment, the apparatus further comprises a registration module.
[0135] The registration module is configured to register the button manager on the UI page of the service to be executed in response to a first registration operation of the user.
[0136] In one embodiment, the registration module is further configured to register a key event in response to a second registration operation of the user, and the key event is used to monitor key triggering and respond to key operations.
[0137] Figure 6 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. As shown in Figure 6, the electronic device 2 of this embodiment includes: at least one processor 20 (only one is shown in Figure 6), a memory 21, and a computer program 22 stored in the memory 21 and executable on the at least one processor 20. When the processor 20 executes the computer program 22, the steps of any of the above-mentioned method embodiments are implemented.
[0138] The electronic device 2 may include, but is not limited to, a processor 20 and a memory 21. Those skilled in the art will appreciate that FIG6 is merely an example of the electronic device 2 and does not limit the electronic device 2. The electronic device 2 may include more or fewer components than shown, or may combine certain components or different components. For example, the electronic device 2 may also include input and output devices, network access devices, etc.
[0139] The processor 20 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or any conventional processor.
[0140] In some embodiments, the memory 21 may be an internal storage unit of the electronic device 2, such as a hard disk or memory of the electronic device 2. In other embodiments, the memory 21 may also be an external storage device of the electronic device 2, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 2. Furthermore, the memory 21 may also include both an internal storage unit and an external storage device of the electronic device 2. The memory 21 is used to store an operating system, an application program, a boot loader, data, and other programs, such as the program code of the computer program. The memory 21 may also be used to temporarily store data that has been output or is to be output.
[0141] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of this application. Their specific functions and technical effects can be found in the method embodiment section and will not be repeated here.
[0142] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0143] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned various method embodiments can be implemented.
[0144] An embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device can implement the steps of the above-mentioned method embodiments when executing the computer program product.
[0145] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the process of the above-mentioned method embodiment by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, it can implement the steps of each of the above-mentioned method embodiments. The computer program includes computer program code, which can be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium can at least include: any entity or device capable of carrying computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium. For example, a USB flash drive, mobile hard drive, magnetic disk, or optical disk. In some jurisdictions, based on legislation and patent practice, computer-readable media cannot be electric carrier signals or telecommunication signals.
[0146] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0147] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0148] In the embodiments provided in this application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely illustrative. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0149] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0150] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.
Claims
1. A key-value response method, characterized in that: include: In response to a key operation, obtaining a key value; Get object information of each source object; For each of the source objects, if the object information of the source object meets a preset condition, determining at least one button manager registered in a target UI page as a target button manager, wherein the target UI page is determined according to the source object, and the button managers of different UI pages are different; The key value is passed into the target service callback through the target key manager so that the target UI page executes the corresponding service. The source object and service callback are set in the key manager.
2. The method according to claim 1, characterized in that The obtaining of object information of each source object includes: Using the first interface to capture the area of each source object, and obtain the coordinates of each source object; Using the second interface to obtain the UI page corresponding to each of the source objects; Use the third interface to obtain the currently active page; For each of the source objects, determining a state of the UI page of the source object according to the UI page corresponding to the source object and the currently active page; Obtaining the visible attribute of each of the source objects using a fourth interface; Using the fifth interface to obtain the valid attributes of each source object; For each of the source objects, determining a state of the source object or a UI page corresponding to the source object according to the visible attribute and the valid attribute of the source object; The object information includes the coordinates and state of the source object and the state of the UI page where the source object is located.
3. The method according to claim 1, characterized in that: When the source object is a page element, the object information of the source object meets the preset conditions, including: When the coordinates of the source object are the same as the preset coordinates, the state of the source object is visible, and the state of the UI page where the source object is located is active, it is determined that the object information of the source object meets the preset conditions, and the target UI page is the UI page where the source object is located; When the source object is a full-screen page, the object information of the source object meets the preset conditions, including: When the coordinates of the source object are the same as the preset coordinates and the state of the UI page corresponding to the source object is active and visible, it is determined that the object information of the source object meets the preset conditions, and the target UI page is the UI page corresponding to the source object.
4. The method according to claim 1, characterized in that: When the button manager is further provided with a button category; The method further comprises: If the object information of the source object meets the preset condition, at least one of the key managers registered on the target UI page and meeting the key category to which the key operation belongs is determined as a target key manager.
5. The method according to claim 1, characterized in that Before obtaining the key value in response to the key operation, the method further includes: In response to the first registration operation, the button manager is registered on the UI page of the service to be executed.
6. The method according to claim 1, characterized in that Before obtaining the object information of each source object, the method further includes: The button manager is traversed, and the source object in the button manager is refreshed.
7. The method according to any one of claims 1 to 6, characterized in that: Before obtaining the key value in response to the key operation, the method further includes: In response to the second registration operation, a key event is registered, and the key event is used to monitor key triggering and respond to the key operation.
8. A key-value response device, characterized in that: include: A control module, used for obtaining a key value in response to a key operation; The control module is further used to obtain object information of each source object; a management module, configured to determine, for each of the source objects, if the object information of the source object meets a preset condition, at least one button manager registered in a target UI page as a target button manager, wherein the target UI page is determined according to the source object; The management module is further used to pass the key value to the target service callback through the target key manager so that the target UI page executes the corresponding service. The key manager is provided with the source object and the service callback.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Music crowd-funding crowd-creating platform based on virtual musical instruments
CN107331377A
Method for browsing webpage by remote controller and display equipment
CN111625169A
Interaction method and device based on remote control, electronic equipment and storage medium
CN113141530A
Multi-control display and control method of single-color screen based on LVGL
CN116820459A
Key value response method and device
CN117555463A