Menu display method and device, equipment and storage medium
By setting up a system-level context menu in the tablet, the problem that the three-party applications do not adapt to the right-click function is solved, and the interaction ability and user experience are improved.
Patent Information
- Application Number
- CN202311421102.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-27
- Publication Date
- 2025-04-29
AI Technical Summary
When using a mouse in a tablet, the three-party application does not adapt to the right-click function and cannot pop up the corresponding context menu, resulting in weak interactive capabilities.
A menu display method is provided, by presetting a non-application-level context menu triggered by external devices, ie, a system-level context menu, in response to a user's menu display operation and displaying a system-level context menu.
It improves the interactive ability of the context menu of the terminal device, improves the user experience, and ensures that users can use the context menu through the mouse in three-party applications.
Smart Images

Figure CN119902831A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of terminal equipment, and in particular to a menu display method, device, equipment and storage medium. Background Art
[0002] According to big data analysis, users use the mouse in many scenarios when using tablet computers. The probability of using a mouse in high-end tablet computers exceeds 10%, and there is a gradual upward trend. As the office capabilities of tablet computers are further enhanced, the probability of users using a mouse is still increasing.
[0003] In the related art, when a user uses a mouse in a tablet computer, the following problems occur: the right-click function of the mouse is not adapted in third-party applications, and the corresponding context menu cannot pop up. Summary of the invention
[0004] The purpose of the present invention is to provide a menu display method, device, equipment and storage medium to solve the technical problems in the prior art.
[0005] In a first aspect, an embodiment of the present application provides a menu display method, which is applied to a terminal device, and the method includes:
[0006] In response to a menu display operation triggered by an external device on a target content by a user, a system-level context menu corresponding to the menu display operation is determined; the system-level context menu is a non-application-level context menu pre-set for an application in the terminal device based on the triggering of the external device; the target content is the content in an application page of the target application corresponding to the menu display operation triggered by the user; and the system-level context menu is displayed.
[0007] In an embodiment of the present application, taking into account that some terminal devices cannot respond to menu display operations when external devices such as a mouse and keyboard are connected, which results in weak interactive capabilities of the context menu of the terminal device, a non-application level context menu triggered by an external device, namely, a system-level context menu, is pre-set for the application in the terminal device in the present application. The present application implements the response to the menu display operation triggered by the external device by setting a system-level context menu. The application in the terminal device displays the corresponding content through the controls in the system. The system can obtain the user's operation intention by monitoring the operation events of external devices such as a mouse, determine the target content in combination with the controls in the system, and then determine and display the system-level context menu, so as to facilitate the user to operate the target application based on the system-level context menu, thereby improving the interactive capabilities of the context menu of the terminal device and enhancing the user experience.
[0008] In some possible embodiments, before determining the system-level context menu corresponding to the menu display operation, the method further includes:
[0009] Determine a target application corresponding to the menu display operation; determine whether the target application is a first application; the first application is an application for which there is no application-level context menu corresponding to the menu display operation triggered by the external device; if it is determined that the target application is the first application, determine a system-level context menu corresponding to the menu display operation.
[0010] In the present application, by determining that the target application does not have an application-level context menu corresponding to the menu display operation triggered by an external device, conflicts during the display of the context menu are avoided, thereby further ensuring the user experience.
[0011] In some possible embodiments, determining whether the target application is the first application includes:
[0012] Determine whether the target application is in a preset whitelist; wherein the preset whitelist is used to record information of applications for which there is no application-level context menu corresponding to a menu display operation triggered by an external device; if the target application is in the preset whitelist, determine that the target application is the first application; if the target application is not in the preset whitelist, determine that the target application is not the first application.
[0013] In the present application, the conflict between the system-level context menu and the application-level context menu is avoided by setting a preset whitelist.
[0014] In some possible embodiments, after determining whether the target application is the first application, the method further includes: if it is determined that the target application is not the first application, displaying the obtained application-level context menu corresponding to the target application.
[0015] In some possible embodiments, after determining whether the target application is the first application, the method further includes:
[0016] If it is determined that the target application is not the first application, the application-level context menu corresponding to the menu display operation triggered by the external device is shielded, and a system-level context menu corresponding to the menu display operation is determined.
[0017] In the present application, the conflict between the application-level context menu and the system-level context menu is avoided by shielding the application-level context menu, thereby ensuring the user experience.
[0018] In some possible embodiments, shielding the application-level context menu corresponding to the menu display operation triggered by the external device includes:
[0019] Determine an application pop-up text interface corresponding to the target application; and intercept the position information and gesture information sent by the external device to the pop-up text interface by displaying a framework control.
[0020] In some possible embodiments, determining the target application corresponding to the menu display operation includes:
[0021] The location information and gesture information of the external device are obtained by displaying the framework control; and the target application is determined based on the display interface triggered by the gesture information and the location information.
[0022] In the present application, the accuracy of the determined target application is ensured by the location information and gesture information of the external device.
[0023] In some possible embodiments, the display frame control includes: WebView.
[0024] In the present application, by reusing the WebView in the terminal device, no new components are required, the cost is reduced, and the utilization rate of the WebView is improved.
[0025] In some possible embodiments, determining the target application corresponding to the menu display operation includes:
[0026] Acquire parameter information corresponding to the menu display operation; and determine a system-level context menu corresponding to the menu display operation based on the parameter information.
[0027] In the present application, the system-level context menu can be determined by using parameter information, so that the obtained system-level context menu is more accurate.
[0028] In some possible embodiments, the acquiring parameter information corresponding to the menu display operation includes:
[0029] Acquiring an application type of a target application corresponding to the menu display operation; determining a system-level context menu corresponding to the menu display operation based on the parameter information comprises: determining a system-level context menu corresponding to the menu display operation according to the application type of the target application.
[0030] In the present application, different system-level context menus are set for different types of applications, making the system-level context menu provided in the present application more reasonable.
[0031] In some possible embodiments, the acquiring parameter information corresponding to the menu display operation includes:
[0032] Determine whether there is selected content in the target content; if so, determine the selected content as the parameter information; determining the system-level context menu corresponding to the menu display operation based on the parameter information includes: determining the system-level context menu corresponding to the menu display operation based on the selected content.
[0033] In the present application, a system-level context menu may be determined based on the selected content, so that the user can operate the selected content based on the system-level context menu.
[0034] In some possible embodiments, determining the system-level context menu corresponding to the menu display operation based on the selected content includes:
[0035] Determine the type of the selected content; and determine a system-level context menu corresponding to the menu display operation based on the type of the selected content.
[0036] In the present application, different system-level context menus are set for different types of selected content, so that users can perform different operations on different types of selected content based on the system-level context menu.
[0037] In some possible embodiments, after determining whether the target content contains selected content, the method further includes:
[0038] If there is no selected content, determining the system-level context menu corresponding to the menu display operation based on the parameter information includes: determining a preset system-level context menu as the system-level context menu corresponding to the menu display operation; the preset system-level context menu is a pre-set default system-level context menu.
[0039] In the present application, when there is no selected content, a preset system context menu is displayed to facilitate the user to trigger corresponding operations based on the system-level context menu.
[0040] In some possible embodiments, after determining whether the target content contains selected content, the method further includes:
[0041] If there is no selected content, the menu display operation is ignored.
[0042] In some possible embodiments, the type of the selected content includes at least one of the following: text information and image information.
[0043] In some possible embodiments, determining the system-level context menu corresponding to the menu display operation based on the type of the selected content includes:
[0044] If the type of the selected content is text information, the system-level context menu corresponding to the menu display operation is a first preset menu; if the type of the selected content is image information, the system-level context menu corresponding to the menu display operation is a second preset menu.
[0045] In this application, different system-level context menus are set for different types of selected content, which meets the needs of users and improves the user experience.
[0046] In some possible embodiments, the system-level context menu includes at least one menu item, and the first preset menu includes at least one or a combination of the following menu items: Copy, Select All, Search, Translate, Share; the second preset menu includes at least one or a combination of the following menu items: View Picture, Save Picture, Copy Picture, Share Picture.
[0047] In some possible embodiments, displaying the system-level context menu includes:
[0048] Determine a display position of the system-level context menu; and display the system-level context menu at the display position.
[0049] In this application, the system-level context menu is displayed at a specified location to improve the user experience.
[0050] In some possible embodiments, determining the display position of the system-level context menu includes:
[0051] Acquire a trigger position of the menu display operation, and determine the trigger position as a display position of the system-level context menu; or, acquire a preset position, and determine the preset position as a display position of the system-level context menu.
[0052] In this application, two methods for determining the designated location are provided, making this application more universal.
[0053] In some possible embodiments, the preset whitelist records the identity of at least one application that does not have an application-level context menu, and determining whether the target application is in the preset whitelist includes:
[0054] Obtaining the identity of the target application; and determining whether the target application is in a preset whitelist based on the identity of the target application.
[0055] In the present application, whether the target application is in a preset whitelist can be determined through identity identification, thereby avoiding conflicts between the system-level context menu and the application-level context menu.
[0056] In some possible embodiments, the method further includes:
[0057] In response to the user's application adding operation, determining an added application corresponding to the application adding operation; acquiring an identity identifier corresponding to the added application; and adding the identity identifier corresponding to the added application to a preset whitelist.
[0058] In the present application, the user can customize the identity of the application in the preset whitelist, making the menu display method provided by the present application more flexible.
[0059] In some possible embodiments, the system-level context menu includes at least one menu item, and after displaying the system-level context menu, the method further includes:
[0060] In response to a selection operation of a menu item in the system-level context menu, a target menu item is determined; and in response to an adjustment operation on the target menu item, the target menu item is adjusted in the system-level context menu.
[0061] In this application, users can customize menu items in the system-level context menu, which is convenient for users to manage menu items in the system-level context menu.
[0062] In some possible embodiments, in response to the adjustment operation on the target menu item, adjusting the target menu item in the system-level context menu includes:
[0063] In response to a delete operation on the target menu item, the target menu item is deleted from the system-level context menu; or, in response to a sequence adjustment operation on the target menu item, the position of the target menu item in the system-level context menu is adjusted.
[0064] In some possible embodiments, after displaying the system-level context menu, the method further includes:
[0065] In response to an operation of adding a menu item to the system-level context menu, displaying a menu item to be added; in response to an operation of selecting the menu item to be added, determining a new menu item; and adding the new menu item to the system-level context menu.
[0066] In some possible embodiments, the external device includes any one of the following: a mouse, a keyboard, a stylus, and a touch pad.
[0067] In some possible embodiments, the menu display operation in response to the user triggering the target application based on the external device includes:
[0068] When the external device includes a mouse, respond to a right-click operation of the mouse; and / or, when the external device includes a keyboard, respond to a click operation of a designated key of the keyboard; and / or, when the external device includes a stylus, respond to a designated operation of the stylus; and / or, when the external device includes a touchpad, respond to a designated touch operation of the touchpad.
[0069] In some possible embodiments, the terminal device includes any one of the following: a tablet, a mobile phone, a smart car, a smart large screen, and a wearable device.
[0070] In a second aspect, an embodiment of the present application further provides a menu display device, applied to a terminal device, the device comprising:
[0071] a response module, configured to determine, in response to a menu display operation triggered by an external device on a target content by a user, a system-level context menu corresponding to the menu display operation; the system-level context menu is a non-application-level context menu pre-set for an application in the terminal device based on the triggering of the external device; the target content is the content in an application page of a target application corresponding to the menu display operation triggered by the user;
[0072] The menu display module is used to display the system-level context menu.
[0073] In some possible embodiments, the response module is also used to: determine the target application corresponding to the menu display operation; determine whether the target application is a first application; the first application is an application for which there is no application-level context menu corresponding to the menu display operation triggered by the external device; if it is determined that the target application is the first application, then determine the system-level context menu corresponding to the menu display operation.
[0074] In some possible embodiments, the response module is specifically used to: determine whether the target application is in a preset whitelist; wherein the preset whitelist is used to record information about applications for which there is no application-level context menu corresponding to a menu display operation triggered by an external device; if the target application is in the preset whitelist, determining that the target application is the first application; if the target application is not in the preset whitelist, determining that the target application is not the first application.
[0075] In some possible embodiments, the response module is further configured to: if it is determined that the target application is not the first application, display the obtained application-level context menu corresponding to the target application.
[0076] In some possible embodiments, the response module is further used to: if it is determined that the target application is not the first application, shield the application-level context menu corresponding to the menu display operation triggered by the external device, and determine the system-level context menu corresponding to the menu display operation.
[0077] In some possible embodiments, the response module is specifically used to: determine an application pop-up text interface corresponding to the target application; and intercept the position information and gesture information sent by the external device to the pop-up text interface by displaying a framework control.
[0078] In some possible embodiments, the response module is specifically used to: obtain location information and gesture information of an external device through a display framework control; and determine the target application based on a display interface triggered by the gesture information and the location information.
[0079] In some possible embodiments, the display frame control includes: WebView.
[0080] In some possible embodiments, the response module is specifically used to: obtain parameter information corresponding to the menu display operation; and determine a system-level context menu corresponding to the menu display operation based on the parameter information.
[0081] In some possible embodiments, the response module is specifically used to: obtain an application type of a target application corresponding to the menu display operation; when the response module executes determination of a system-level context menu corresponding to the menu display operation based on the parameter information, it is specifically used to: determine the system-level context menu corresponding to the menu display operation according to the application type of the target application.
[0082] In some possible embodiments, the response module is specifically used to: determine whether there is selected content in the target content; if so, determine the selected content as the parameter information; when the response module executes determination of the system-level context menu corresponding to the menu display operation based on the parameter information, it is specifically used to: determine the system-level context menu corresponding to the menu display operation based on the selected content.
[0083] In some possible embodiments, the response module is specifically used to: determine the type of the selected content; and determine the system-level context menu corresponding to the menu display operation based on the type of the selected content.
[0084] In some possible embodiments, the response module is specifically used to: if there is no selected content, determine the system-level context menu corresponding to the menu display operation based on the parameter information, including: determining a preset system-level context menu as the system-level context menu corresponding to the menu display operation; the preset system-level context menu is a pre-set default system-level context menu.
[0085] In some possible embodiments, the response module is further configured to: if there is no selected content, ignore the menu display operation.
[0086] In some possible embodiments, the type of the selected content includes at least one of the following: text information, image information, and application icon.
[0087] In some possible embodiments, the response module is specifically used for: if the type of the selected content is text information, the system-level context menu corresponding to the menu display operation is a first preset menu; if the type of the selected content is image information, the system-level context menu corresponding to the menu display operation is a second preset menu.
[0088] In some possible embodiments, the system-level context menu includes at least one menu item, and the first preset menu includes at least one or a combination of the following menu items: Copy, Select All, Search, Translate, Share; the second preset menu includes at least one or a combination of the following menu items: View Picture, Save Picture, Copy Picture, Share Picture.
[0089] In some possible embodiments, the menu display module is specifically used to: determine a display position of the system-level context menu;
[0090] The system-level context menu is displayed at the display location.
[0091] In some possible embodiments, the menu display module is specifically used to: obtain a trigger position of the menu display operation, and determine the trigger position as a display position of the system-level context menu; or, obtain a preset position, and determine the preset position as a display position of the system-level context menu.
[0092] In some possible embodiments, the response module is specifically used to: obtain an identity identifier of the target application; and determine whether the target application is in a preset whitelist based on the identity identifier of the target application.
[0093] In some possible embodiments, the response module is further used to: in response to the user's application adding operation, determine the added application corresponding to the application adding operation; obtain the identity identifier corresponding to the added application; and add the identity identifier corresponding to the added application to a preset whitelist.
[0094] In some possible embodiments, the system-level context menu includes at least one menu item, and the response module is further used to: determine a target menu item in response to a selection operation of a menu item in the system-level context menu; and adjust the target menu item in the system-level context menu in response to an adjustment operation on the target menu item.
[0095] In some possible embodiments, the response module is specifically used to: in response to a delete operation on the target menu item, delete the target menu item from the system-level context menu; or, in response to a sequence adjustment operation on the target menu item, adjust the position of the target menu item in the system-level context menu.
[0096] In some possible embodiments, the response module is further used to: display the menu items to be added in response to the menu item adding operation of the system-level context menu; determine the new menu items in response to the selection operation of the menu items to be added; and add the new menu items to the system-level context menu.
[0097] In some possible embodiments, the external device includes any one of the following: a mouse, a keyboard, a stylus, and a touch pad.
[0098] In some possible embodiments, the response module is specifically used to: respond to a right-click operation of the mouse when the external device includes a mouse; and / or, respond to a click operation of a designated key of the keyboard when the external device includes a keyboard; and / or, respond to a designated operation of the stylus when the external device includes a stylus; and / or, respond to a designated touch operation of the touchpad when the external device includes a touchpad.
[0099] In some possible embodiments, the terminal device includes any one of the following: a tablet, a mobile phone, a smart car, a smart large screen, and a wearable device.
[0100] In the third aspect, another embodiment of the present application also provides an electronic device, comprising at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any method provided in the embodiment of the first aspect of the present application.
[0101] In a fourth aspect, another embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is used to enable a computer to execute any method provided in the embodiment of the first aspect of the present application.
[0102] In a fifth aspect, an embodiment of the present application further provides a computer program product, which includes: a computer program code, and when the computer program code is run on a computer, the computer executes any one of the methods provided in the embodiment of the first aspect of the present application.
[0103] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0104] Figure 1 A schematic diagram of a method for implementing menu display in the related art provided in an embodiment of the present application;
[0105] Figure 2 A schematic diagram of the overall process of a menu display method provided in an embodiment of the present application;
[0106] Figure 3 A schematic diagram of determining a target application of a menu display method provided in an embodiment of the present application;
[0107] Figure 4 A schematic diagram of a process of determining a system-level context menu corresponding to a menu display operation of a target application in a menu display method provided in an embodiment of the present application;
[0108] Figure 5 A schematic diagram of selected content of a menu display method provided in an embodiment of the present application;
[0109] Figure 6 A schematic diagram of a menu display method provided in an embodiment of the present application in which the selected content is text information;
[0110] Figure 7 A schematic diagram of a menu display method provided in an embodiment of the present application in which the selected content is image information;
[0111] Figure 8 A schematic diagram of a menu display method provided in an embodiment of the present application without selecting any content;
[0112] Fig. 9 A flowchart of displaying a system-level context menu in a menu display method provided in an embodiment of the present application;
[0113] Fig.10 A schematic diagram of a menu display method provided in an embodiment of the present application, in which a trigger position is used as the upper left corner vertex of the system-level context menu to display a system-level context menu;
[0114] Fig.11 A schematic diagram of a menu display method provided in an embodiment of the present application, in which a preset position is used as the upper left corner vertex of the system-level context menu to display a system-level context menu;
[0115] Fig.12 A schematic diagram of a menu display method provided in an embodiment of the present application in which a trigger position is located at an edge of a display screen;
[0116] Fig.13 A schematic diagram of displaying a system-level context menu according to the position coordinates of a trigger position of a menu display operation on a screen in a menu display method provided in an embodiment of the present application;
[0117] Fig.14 A schematic diagram of a process of determining whether a target application has an application-level context menu corresponding to a menu display operation triggered by an external device in a menu display method provided in an embodiment of the present application;
[0118] Fig.15 Another flowchart of a menu display method for determining whether a target application has an application-level context menu corresponding to a menu display operation triggered by an external device, provided in an embodiment of the present application;
[0119] Fig.16 A schematic diagram of a process of determining whether a target application is in a preset whitelist in a menu display method provided in an embodiment of the present application;
[0120] Fig.17 A flowchart of a menu display method for shielding an application-level context menu corresponding to a menu display operation triggered by an external device provided in an embodiment of the present application;
[0121] Fig.18 Another flowchart of a menu display method provided in an embodiment of the present application;
[0122] Fig.19 A menu item schematic diagram of a menu display method provided in an embodiment of the present application;
[0123] Fig. 20A A schematic diagram of deleting a menu item in a system-level context menu in a menu display method provided in an embodiment of the present application;
[0124] Fig. 20BAnother schematic diagram of deleting a menu item in a system-level context menu in a menu display method provided in an embodiment of the present application;
[0125] Fig. 20C A schematic diagram of adjusting menu items in a system-level context menu in a menu display method provided in an embodiment of the present application;
[0126] Fig.20D A schematic diagram of adding a menu item to a system-level context menu in a menu display method provided in an embodiment of the present application;
[0127] Fig.21A A schematic diagram of adding a menu item to a system-level context menu in a menu display method provided in an embodiment of the present application;
[0128] Fig. 21B Another schematic diagram of adding a menu item to a system-level context menu in a menu display method provided in an embodiment of the present application;
[0129] Fig.22A A schematic diagram of a menu display method provided by an embodiment of the present application for sequentially adding menu items to a system-level context menu;
[0130] Fig. 22B A schematic diagram of a process of setting the identity of an application in a preset whitelist in a menu display method provided in an embodiment of the present application;
[0131] Fig.23 Another flowchart of a menu display method provided in an embodiment of the present application;
[0132] Fig.24 A schematic diagram of a system framework of a menu display method provided in an embodiment of the present application;
[0133] Fig.25A A schematic diagram of the overall process of a menu display method provided in an embodiment of the present application;
[0134] Fig.25B A schematic diagram of an interactive process of a menu display method provided in an embodiment of the present application;
[0135] Fig.26 A schematic diagram of a menu display method provided in an embodiment of the present application;
[0136] Fig. 27 A schematic diagram of an electronic device for a menu display method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0137] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, but should not be construed as limiting the present invention.
[0138] In order to better understand the technical solution of the present application, the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0139] It should be clear that the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0140] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0141] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0142] The inventor's research found that, from the perspective of big data analysis, users use the mouse in many scenarios during the use of tablet computer products, and the probability of using the mouse in high-end tablet computers exceeds 10%, and there is a gradual upward trend. As the office attributes of tablet computer products are further enhanced, the probability of users using the mouse is still increasing.
[0143] In the related art, there are the following problems when users use a mouse in a tablet computer: third-party applications do not provide some menu pages for content during the development process, the user interaction is relatively poor, and some third-party applications are not adapted to the right-click function of the mouse, and the corresponding context menu cannot pop up.
[0144] like Figure 1 As shown, in the related art, the context menu function is implemented in the application mainly through the following two methods: 1. Listening to the finger long press event, popping up the corresponding context menu. 2. Listening to the mouse right button event, popping up the context menu. However, in the tablet computer, only the long press text pops up the context menu, and the mouse right button function is not adapted; and the implementation of the context menu strongly depends on the application adaptation. If the application is not adapted, there will be no context menu function.
[0145] In view of the above problems, the embodiments of the present application provide a menu display method, apparatus, device and storage medium for solving the above problems. The inventive concept of the present application can be summarized as follows: in response to a menu display operation triggered by a user based on an external device on a target content, a system-level context menu corresponding to the menu display operation is determined; the system-level context menu is a non-application-level context menu pre-set for an application in a terminal device based on an external device trigger; the target content is the content in the application page of the target application corresponding to the user-triggered menu display operation, and the system-level context menu is displayed. Taking into account that some terminal devices cannot respond to menu display operations when connected to external devices such as a mouse and keyboard, which results in weak interactive capabilities of the context menu of the terminal devices, the present application pre-sets a non-application level context menu triggered by an external device, namely, a system-level context menu, for the applications in the terminal devices. The present application implements the response to menu display operations triggered by external devices by setting a system-level context menu. The applications in the terminal devices display corresponding content through controls in the system. The system can obtain the user's operating intentions by monitoring operation events of external devices such as a mouse, determine the target content in combination with the controls in the system, and then determine and display the system-level context menu, which is convenient for users to operate the target application based on the system-level context menu, thereby improving the interactive capabilities of the context menu of the terminal device and enhancing the user experience.
[0146] The menu display method provided in the present application is applicable to various terminal devices, such as but not limited to tablets, mobile phones, smart cars, smart large screens, wearable devices and other devices that can be connected to external devices.
[0147] In the present application, for example, when the mouse clicks on the content in the application page, a context menu will be expanded from the vicinity of the mouse click position, and the context menu can display operation options related to the application, such as quick entries for copy, select all, search, translate, share, and other operations. In addition, the menu that pops up when the mouse clicks on text, images, and other locations in the application page can be designed according to the actual scenario and is not limited. In the present application, the system-level context menu can be, for example, an interactive function integrated into the system by a system developer, and the application-level context menu can be, for example, an interactive function developed and provided by a third-party application developer. The system-level context menu can provide better interactive capabilities for applications that do not provide application-level context menus, thereby improving the user experience.
[0148] like Figure 2 FIG. 1 is a schematic diagram of the overall process of a menu display method provided in an embodiment of the present application, wherein:
[0149] Step 201: In response to a menu display operation triggered by a user based on an external device on a target content, a system-level context menu corresponding to the menu display operation is determined.
[0150] The system-level context menu is a non-application-level context menu pre-set for applications in the terminal device based on external device triggering; the target content is the content in the application page of the target application corresponding to the user-triggered menu display operation.
[0151] In the present application, the user can trigger a menu display operation in the terminal device by finger clicking or other operations in the external device. After the terminal device detects the menu display operation triggered by the user, it determines the target content according to the menu display operation.
[0152] It should be noted that the target application in this application can be a third-party application in the terminal device or a system application. This application does not limit the type of target application. Other applications that use WebView to display application pages are also applicable to this application.
[0153] For example: Figure 3 As shown, the user triggers a menu display operation in the terminal device based on an external device, and the terminal device determines that the target content is the content in the application page of application B based on the menu display operation.
[0154] In some possible embodiments, the external device includes, but is not limited to: a mouse, a keyboard, a stylus, and a touchpad. Any external device that is compatible with the terminal device and configured with a menu display operation is applicable to the present application.
[0155] Among them, when the external device is a mouse, the triggering method of the menu display operation can be right-clicking the mouse; when the external device is a keyboard, the triggering method of the menu display operation can be pressing designated keys at the same time; when the external device is a touchpad, the triggering method of the menu display operation can be clicking a designated position.
[0156] It should be noted that the specific triggering method of the menu display operation is not limited in this application.
[0157] In this application, it is considered that the user's operations on different applications may be different, and the user's operations on different contents of the same application may be different. Therefore, different applications can set different system-level context menus, and / or different contents in the same application can set different system-level context menus. Therefore, when setting parameter information, it can be set based on the application's own properties (including but not limited to: type, included content). Based on this, in some possible embodiments, the system-level context menu corresponding to the menu display operation can be specifically implemented as follows: Figure 4 The steps shown, where:
[0158] Step 401: Obtain parameter information corresponding to the menu display operation.
[0159] In the present application, the parameter information may include any one of the following: application type, selected content.
[0160] Step 402: Determine a system-level context menu corresponding to the menu display operation based on the parameter information.
[0161] Through Figure 4 The method shown can realize displaying different system-level context menus to users for different applications or selected contents, so as to facilitate users to perform different operations on different applications, and facilitate users to perform different operations on different contents of the same application. It should be noted that in the present application, the same default system-level context menu can also be pre-set for all menu display operations, that is, after determining that the user triggers the menu display operation, the default system-level context menu is directly displayed.
[0162] In some possible embodiments, obtaining parameter information corresponding to the menu display operation may be specifically implemented as follows: obtaining the application type of the target application corresponding to the menu display operation, and determining the application type as the parameter information. When the parameter information is the application type, determining the system-level context menu corresponding to the menu display operation based on the parameter information may be specifically implemented as follows: determining the system-level context menu corresponding to the menu display operation according to the application type of the target application.
[0163] For example: determine that the system-level context menu corresponding to application type 1 is menu 1, determine that the system-level context menu corresponding to application type 2 is menu 2, and determine that the system-level context menu corresponding to application type 3 is menu 3. Determine that the target application corresponding to the menu display operation is application A, obtain the application type corresponding to application A, determine that the application type corresponding to application A is application type 1, and then determine that the system-level context menu corresponding to the menu display operation is menu 1.
[0164] In some possible embodiments, obtaining parameter information corresponding to the menu display operation can also be implemented as: determining whether there is selected content in the target content; if there is, determining the selected content as parameter information. When the parameter information is the selected content, determining the system-level context menu corresponding to the menu display operation based on the parameter information can be specifically implemented as: determining the system-level context menu corresponding to the menu display operation based on the selected content. In specific implementation, the terminal device can register the selected content event through the selected content determination interface to obtain the selected content. For example: when the operating system of the terminal device is the Android operating system, the selected content determination interface is the evaluate Java script interface, and the selected content event is a JS (JavaScript) event, then the selected content can be obtained by registering the JS event through the evaluate Java script interface. Of course, the terminal device can also be other operating systems such as IOS, or Windows, etc. When the operating system is different, the specific selected content determination interface used by the terminal device when obtaining the selected content can also be different. The terminal can be specifically determined according to the operating system, and this application does not limit this.
[0165] For example: Figure 5 As shown, after the user uses the mouse to open the target application, he selects a piece of news text "AAAAXXXXXCCCCVVVVVVV" with the left mouse button, and the selected content is "AAAAXXXXXCCCCVVVVVVV".
[0166] In the present application, the terminal device can determine whether there is selected content through the operation triggered by the user. When there is selected content, the selected content is used as parameter information, and the system-level context menu corresponding to the menu display operation can be determined based on the selected content.
[0167] In some possible embodiments, determining the system-level context menu corresponding to the menu display operation based on the selected content can be specifically implemented as follows: determining the type of the selected content; and determining the system-level context menu corresponding to the menu display operation based on the type of the selected content. The type of the selected content includes at least one of the following: text information and image information.
[0168] In the present application, the different operations that users may want to trigger for different types of selected content are taken into consideration. Therefore, in order to ensure that the determined menu display operation is more reasonable and better meets the needs of users, the system-level context menu corresponding to the menu display operation can be determined according to the type of selected content.
[0169] Among them, if the type of the selected content is text information, the system-level context menu corresponding to the menu display operation is the first preset menu; if the type of the selected content is image information, the system-level context menu corresponding to the menu display operation is the second preset menu.
[0170] For example: Figure 6 As shown, it is determined that the selected content is "AAAAXXXXXCCCCVVVVVVV", and the type of the selected content is determined to be text information, then the system-level context menu is determined to be the first preset menu; Figure 7 As shown, it is determined that the selected content is an image in application B, and the type of the selected content is determined to be image information, and then the system-level context menu is determined to be the second preset menu.
[0171] Among them, the first preset menu includes at least one or a combination of the following menu items: copy, select all, search, translate, and share; the second preset menu includes at least one or a combination of the following menu items: view picture, save picture, copy picture, and share picture.
[0172] That is, in the present application, the contents of the menu items in each system-level context menu may be the same or different, and the present application does not impose any limitation on this.
[0173] In the present application, by setting different system-level context menus for different types of selected content, it is convenient for users to perform different operations on different types of selected content based on the system-level context menu, thereby ensuring the user experience.
[0174] In other possible embodiments, after determining whether there is selected content in the target content, if it is determined that there is no selected content in the target application, the preset system-level context menu is determined as the system-level context menu corresponding to the menu display operation of the target application; the preset system-level context menu is a pre-set default system-level context menu.
[0175] In the present application, when there is no selected content, the preset system-level context menu can also be determined as the system-level context menu corresponding to the menu display operation of the target application.
[0176] For example: Figure 8 As shown, the user has not selected any content in the application interface corresponding to application B, but the user has triggered a menu display operation based on an external device. At this time, the parameter information can be determined to be the preset parameter information, and the system-level context menu can be determined to be the preset system-level context menu based on the preset parameter information.
[0177] Step 202: Display the system-level context menu.
[0178] In some possible embodiments, after the system-level context menu is determined, the system-level context menu is displayed, which can be specifically implemented as follows: Fig. 9 The steps shown, where:
[0179] Step 901: Determine a designated location.
[0180] In some possible embodiments, determining the designated position may be specifically implemented as follows: obtaining a trigger position of a menu display operation, and determining the trigger position as the designated position; or obtaining a preset position, and determining the preset position as the designated position.
[0181] In the present application, the user experience is ensured by determining the trigger position of the menu display operation as the specified position; and in the present application, the preset position can also be determined as the specified position, making the present application more universal.
[0182] Step 902: Display a system-level context menu at a specified location.
[0183] In some possible embodiments, when displaying the system-level context menu at a specified position, the specified position may be used as the upper left corner vertex of the system-level context menu to display the system-level context menu, or the specified position may be used as the center point of the system-level context menu to display the system-level upper and lower menus, or the specified position may be used as the lower left vertex of the system-level context menu to display the system-level context menu. The specific implementation method of displaying the system-level context menu at a specified position is not limited in this application.
[0184] For example: Fig.10 As shown, if the trigger position of the menu display operation is determined to be point A, point A is used as the designated position, and point A is used as the upper left corner vertex of the system-level context menu to display the system-level context menu.
[0185] like Fig.11 As shown, the designated position is determined to be the preset position, and the preset position is point B above the page, then point B is used as the designated position, and point B is used as the upper left corner vertex of the system-level context menu to display the system-level context menu.
[0186] In some other possible embodiments, when the trigger position of the menu display operation is used as the specified position, there may be the following: Fig.12In the case shown, that is, the trigger position of the menu display operation is at the edge of the display screen, if the specified position is used as the upper left corner vertex of the system-level context menu to display the system-level context menu, the complete system-level context menu cannot be displayed on the screen. Therefore, when the trigger position of the menu display operation is used as the specified position to display the system-level context menu, how to display the system-level context menu can be determined based on the position coordinates of the trigger position of the menu display operation on the screen and the size of the system-level context menu.
[0187] For example: Fig.13 As shown, if the trigger position of the menu display operation is point A, and it is determined that the distance between point A and the right edge of the display screen is less than the width of the system-level context menu, then point A can be used as the upper-right vertex of the system-level context menu to display the system-level context menu; if the trigger position of the menu display operation is point B, and it is determined that the distance between point B and the bottom edge of the display screen is less than the height of the system-level context menu, then point B can be used as the lower-left vertex of the system-level context menu to display the system-level context menu; if the trigger position of the menu display operation is point C, and it is determined that the distance between point C and the bottom edge of the display screen is less than the height of the system-level context menu, and it is determined that the distance between point C and the left edge of the display screen is less than the width of the system-level context menu, then point C can be used as the lower-right vertex of the system-level context menu to display the system-level context menu.
[0188] What you need to know is, Fig.13 What is provided is only an embodiment, and does not limit the method of displaying the system-level context menu based on the specified position. In specific implementation, any method that can fully display the system-level context menu based on the specified position is applicable to this application.
[0189] In an embodiment of the present application, a menu display method is also provided, wherein the present embodiment is relative to Figure 2 The embodiment shown adds a step of determining whether the application corresponding to the menu display operation is the first application. Fig.14 As shown, the method includes:
[0190] Step 1401: Determine the target application corresponding to the menu display operation.
[0191] In the present application, the first application is an application that does not have an application-level context menu corresponding to a menu display operation triggered by an external device; the application-level context menu corresponding to a menu display operation triggered by an external device is a menu set based on the application to facilitate users to operate the content in the application, and the system-level context menu is a menu set by the present application for applications that do not have an application-level context menu corresponding to a menu display operation triggered by an external device, which can operate the content in the application. In order to avoid conflicts between the system-level context menu set in the present application and the application-level context menu corresponding to the menu display operation triggered by an external device, which applications have application-level context menus corresponding to menu display operations triggered by external devices can be preset, for example, by detecting the parameters of the application. Alternatively, the user can know based on usage experience. Based on this, in the present application, conflicts can be avoided by determining whether the target application is the first application.
[0192] In some possible embodiments, determining the target application corresponding to the menu display operation may be specifically implemented as follows: obtaining location information and gesture information of the external device through a display framework control; and determining the target application based on a display interface triggered by the gesture information and the location information.
[0193] The position information is the position where the menu display operation is triggered in the terminal device, and the gesture information is the specific operation of the user on the external device, such as: double-clicking the left button, single-clicking the left button, double-clicking the right button, right-clicking, sliding the wheel, etc. The display frame control may be a WebView.
[0194] That is, the operation of the external device is monitored through WebView, and whether a menu display operation occurs is determined based on the location information and gesture information sent by the external device.
[0195] Step 1402: Determine whether the target application is the first application.
[0196] In some possible embodiments, the Fig.15 The steps shown are to determine whether the target application is the first application:
[0197] Step 1501: Determine whether the target application is in the preset whitelist, if so, proceed to step 1502, otherwise proceed to step 1503.
[0198] The preset whitelist is used to record information of applications for which there is no application-level context menu corresponding to the menu display operation triggered by the external device.
[0199] That is, the preset whitelist records information of applications that do not have application-level context menus corresponding to menu display operations triggered by external devices. After determining the target application, the preset whitelist can be used to determine whether the target application is in the preset whitelist to determine whether the target application is the first application.
[0200] Step 1502: Determine that the target application is the first application.
[0201] Step 1503: Determine that the target application is not the first application.
[0202] In some possible embodiments, the user can manage the application information of the applications in the preset whitelist, that is, the user can add the application information of the applications in the preset whitelist, and can also delete the application information of the applications in the preset whitelist. In order to facilitate the user to manage the application information of the applications in the preset whitelist, in this application, the system application of the external device can obtain the application information of the applications currently installed in the terminal device through the package manager (PackageManager), and then generate a preset whitelist management page based on the application information of the obtained applications, and display the preset whitelist management page to the user, so that the user can manage the application information of the applications in the preset whitelist based on the preset whitelist management page.
[0203] In some possible embodiments, the preset whitelist records the identity of at least one application that does not have an application-level context menu. At this time, determining whether the target application is in the preset whitelist may be specifically implemented as follows: Fig.16 The steps shown, that is, to determine whether the target application is in the preset whitelist include:
[0204] Step 1601: Obtain the identity of the target application.
[0205] In the present application, the identity of the target application is information that can uniquely identify the target application in the terminal device, so the identity of the target application includes but is not limited to: application name, application identity document (ID), etc.
[0206] In some possible embodiments, when obtaining the identity of the target application, the identity of the target application may be obtained by calling a corresponding component in the terminal device.
[0207] For example: when the terminal device is an Android system, the terminal device can call the AndroidActivity Manager through Web View to obtain the identity of the target application. Among them, Web View is a system component in the Android system, so that the application program in the Android system can display content through Web View. Android ActivityManager is a component in the Android system responsible for managing the application life cycle, process scheduling, and task stack management. Of course, the terminal device can also be other operating systems such as IOS, or Windows, etc. When the operating system is different, the specific components used by the terminal device to obtain the identity of the target application may also be different. The terminal can be specifically determined according to the operating system, and this application does not limit this.
[0208] Step 1602: Determine whether the target application is in a preset whitelist based on the identity of the target application.
[0209] In the present application, after the identity of the target application is determined, it can be determined whether the target application is in the preset whitelist according to the identity of the application in the preset whitelist.
[0210] In some possible embodiments, determining whether the target application is in a preset whitelist is based on the identity of the target application. Specifically, it can be implemented as follows: comparing the identity of the target application with the identity in the preset whitelist; if it is determined that there is an identity in the preset whitelist that is identical to the identity of the target application, then it is determined that the target application is in the preset whitelist; if it is determined that there is no identity in the preset whitelist that is identical to the identity of the target application, then it is determined that the target application is not in the preset whitelist.
[0211] For example, the preset whitelist includes: identity 1, identity 2, and identity 3; if the target application is determined to be application A, and the identity corresponding to application A is determined to be identity 2, then it is determined that the target application is in the preset whitelist.
[0212] Step 1403: If the target application is determined to be the first application, determine the system-level context menu corresponding to the menu display operation.
[0213] The specific implementation of this step is the same as step 201 and will not be described again here.
[0214] In some other possible embodiments, in addition to using a preset whitelist to avoid conflicts between the system-level context menu and the application-level context menu corresponding to the menu display operation triggered by the external device, the following may also be implemented: Fig.17 The steps shown here are to avoid conflicts, where:
[0215] Step 1701 : In response to a menu display operation triggered by a user based on an external device on a target content, determine whether the target application is a first application; if not, proceed to step 1702 , otherwise proceed to step 1703 .
[0216] In the present application, in order to avoid conflicts between the system-level context menu set in the present application and the application-level context menu corresponding to the menu display operation triggered by an external device, which applications have application-level context menus corresponding to the menu display operation triggered by an external device can be preset, for example, by detecting the parameters of the application. Alternatively, the user can know it based on usage experience. Based on this, the present application can avoid conflicts by determining whether the target application has an application-level context menu corresponding to the menu display operation triggered by an external device.
[0217] Step 1702: Shield the application-level context menu corresponding to the menu display operation triggered by the external device.
[0218] In the present application, the conflict between the system-level context menu set in the present application and the application-level context menu corresponding to the menu display operation triggered by the external device can be avoided by shielding the application-level context menu corresponding to the menu display operation triggered by the external device and displaying the system-level context menu.
[0219] In other possible embodiments, in order to avoid conflicts between the system-level context menu set in the present application and the application-level context menu corresponding to the menu display operation triggered by an external device, when the first application of the target application is determined, the application-level context menu corresponding to the target application can be directly displayed.
[0220] In some possible embodiments, shielding the application-level context menu corresponding to the menu display operation triggered by an external device can be specifically implemented as follows: determining an application pop-up text interface corresponding to the target application; and intercepting the location information and gesture information sent by the external device to the pop-up text interface by displaying a framework control.
[0221] Among them, the position information is the location where the menu display operation is triggered in the terminal device, and the gesture information is the specific operation of the user on the external device, such as: double-click the left button, single-click the left button, double-click the right button, right-click, sliding the scroll wheel, etc.
[0222] Step 1703: Determine the system-level context menu corresponding to the menu display operation.
[0223] The specific implementation of this step is the same as step 201 and will not be described again here.
[0224] Step 1704: Display the system-level context menu.
[0225] The specific implementation of this step is the same as step 202 and will not be described again here.
[0226] In an embodiment of the present application, a menu display method is also provided, wherein the present embodiment is relative to Figure 2 The embodiment shown adds the steps for adjusting the upper and lower menus. Fig.18 As shown, the method includes:
[0227] Step 1801: In response to a menu display operation triggered by a user based on an external device, a target application corresponding to the menu display operation is determined.
[0228] The specific implementation of this step is the same as step 201 and will not be described again here.
[0229] Step 1802: Determine whether the target application is in a preset whitelist, wherein objects in the preset whitelist do not have an application-level context menu.
[0230] The specific implementation of this step is the same as step 202 and will not be described again here.
[0231] Step 1803: If the target application is in the preset whitelist, determine the system-level context menu corresponding to the menu display operation, and display the system-level context menu.
[0232] The specific implementation of this step is the same as step 202 and will not be described again here.
[0233] Step 1804: In response to a selection operation of a menu item in the system-level context menu, a target menu item is determined.
[0234] In this application, the system-level context menu includes at least one menu item, such as Fig.19 As shown, each item in the system-level context menu that can be selected by the user is regarded as a menu item. The user can perform a selection operation in the system-level context menu through an external device, and then the terminal device can determine the target menu item selected by the user.
[0235] Step 1805: In response to the adjustment operation on the target menu item, adjust the target menu item in the system-level context menu.
[0236] In some possible embodiments, in response to an adjustment operation on the target menu item, the target menu item is adjusted in the system-level context menu, which may be specifically: in response to a deletion operation on the target menu item, the target menu item is deleted from the system-level context menu; and / or, in response to an order adjustment operation on the target menu item, the position of the target menu item in the system-level context menu is adjusted.
[0237] For example: Fig. 20A As shown in FIG. 1 , if the user wants to delete the menu item “AAA” in the system-level context menu, the user can select “AAA” in the system-level context menu, and the terminal device will determine “AAA” as the target menu item. Fig. 20B As shown, a deletion mark may appear on one side of “AAA”, and the user clicks the deletion mark to delete “AAA” from the system-level context.
[0238] like Fig. 20C As shown, if the user wants to adjust the order of the menu item "AAA" in the system-level context menu, the user can select "AAA" in the system-level context menu, and the terminal device will determine "AAA" as the target menu item. At this time, the user can adjust the position of "AAA" in the system-level context menu by dragging.
[0239] What you need to know is, Fig. 20A , Fig. 20B , Fig. 20C The implementation methods of deleting menu items and adjusting the positions of menu items are only two embodiments, and the present application does not limit the specific implementation methods of deleting menu items and adjusting the positions of menu items.
[0240] In some other possible embodiments, the user can also add menu items to the system-level context menu, which can be specifically implemented as follows: Fig.20D The steps shown, where:
[0241] Step 2001: In response to a menu item adding operation of a system-level context menu, display a menu item to be added.
[0242] Step 2002: In response to a selection operation on a menu item to be added, determining a new menu item.
[0243] Step 2003: Add the new menu item to the system-level context menu.
[0244] In the present application, when the terminal device adds a new menu item to the system-level context menu, the terminal device obtains the configuration information of the new menu item, and adds the new menu item to the system-level context menu based on the configuration information of the new menu item. At this time, the menu items displayed in the system-level context include the menu items added by the user and the menu items displayed by default in the system-level context.
[0245] For example: Fig.21AAs shown, the user triggers the menu item adding operation in the system-level context menu. Based on the menu item adding operation, the menu items to be added include: "GGG", "HHH", "III", and "JJJ". If it is determined that the user has selected "HHH" in the menu to be added, then "HHH" is determined to be a new menu item, and "HHH" is added to the system-level context menu.
[0246] For example: Fig. 21B As shown, the menu items in the current system-level context menu are: Copy, Paste, and Share; if the user wants to add a new menu item to the system-level context menu, the user triggers the menu item adding operation in the system-level context menu, and based on the menu item adding operation, the menu items to be added include: "Select All" and "Cut"; if it is determined that the user has selected "Select All" in the menu to be added, "Select All" is determined as a new menu item, and "Select All" is added to the system-level context menu.
[0247] In some possible embodiments, adding a new menu item to the system-level context menu can be specifically implemented as follows: adding the new menu item to the end of all menu items in the system-level context menu; or, adding the new menu item to the system-level context menu based on the first letter of the first word of the new menu item and the first letter of the first word of the menu items in the system-level context menu.
[0248] For example: Fig.22A As shown, the user triggers a menu item adding operation in the system-level context menu. Based on the menu item adding operation, the menu items to be added include: "GGG", "HHH", "III", and "JJJ". It is determined that the user has selected "HHH" in the menu to be added, then "HHH" is determined to be a new menu item, and the first letter of the first word of "HHH" is determined to be "H". It is determined that the menu items included in the system-level context menu are: "DDD", "FFF", "JJJ", "XXX", "YYY", and "ZZZ", and the first letters are "D", "F", "J", "X", "Y", and "Z", respectively. According to the order of the letters, it can be determined that "HHH" should be added between "FFF" and "JJJ".
[0249] In summary, through the above method in this application, users can customize the menu items in the system-level context menu, making the management of the system-level context menu more flexible and ensuring the user experience.
[0250] In some possible embodiments, in order to make the menu display method provided in the present application more flexible, the user can set the identity of the application in the preset whitelist according to the needs, which can be specifically implemented as follows: Fig. 22B Steps shown:
[0251] Step 2201: In response to the user's application adding operation, determine the added application corresponding to the application adding operation.
[0252] In the present application, when a user adds an identity to a preset whitelist, an application adding operation can be triggered based on the application, and the terminal device determines to add an application according to the application adding operation triggered by the user.
[0253] For example, if a user performs three consecutive taps on application A in the terminal device, it is determined that the user has triggered an application adding operation, and it is determined that the added application corresponding to the application adding operation is application A.
[0254] It should be noted that the specific implementation method of the application adding operation is not limited in this application.
[0255] Step 2202: Obtain the identity corresponding to the added application.
[0256] Step 2203: Add the identity corresponding to the added application to the preset whitelist.
[0257] For example, a user triggers an object adding operation for application A in a terminal device, determines that the added object corresponding to the object adding operation is application A, determines that the identity identifier corresponding to application A is identity identifier 4, and then adds identity identifier 4 to the preset whitelist.
[0258] In some other possible embodiments, the user may also delete the application identifier in the preset whitelist, which may be specifically implemented as follows: in response to the user's deletion operation on the application identifier in the preset whitelist, determining to delete the application identifier, and deleting the deleted application identifier from the preset whitelist.
[0259] In the present application, the above method can be used to customize the preset whitelist, making the menu display method provided in the present application more flexible and meeting user needs.
[0260] In the embodiment of the present application, a menu display method is also provided, such as Fig.23 As shown, where:
[0261] Step 2301: In response to a menu display operation triggered by a user based on an external device, a target application corresponding to the menu display operation is determined.
[0262] The specific implementation of this step is the same as step 201 and will not be described again here.
[0263] Step 2302: Determine whether the target application is in the preset whitelist; if it is determined that the target application is in the preset whitelist, proceed to step 2303, otherwise proceed to step 2304.
[0264] The specific implementation of this step is the same as step 202 and will not be described again here.
[0265] Step 2303: Determine whether the selected content exists in the target content; if so, proceed to step 2305; otherwise, proceed to step 2304.
[0266] In the specific implementation, the terminal device registers the JS Java Script event through the evaluate Java script interface to obtain the selected content. Figure 6 The examples shown are the same and will not be repeated here.
[0267] Step 2304: Do not display the system-level context menu, and ignore the menu display operation triggered this time.
[0268] Step 2305: Determine a system-level context menu corresponding to the menu display operation based on the selected content.
[0269] This step is the same as the method described above for determining the system-level context menu corresponding to the menu display operation based on the parameter information when the parameter information is the selected content, and will not be described in detail here.
[0270] Step 2306: Display the system level context menu.
[0271] This step is the same as the step 202 of displaying the content of the system-level context menu, and will not be described in detail here.
[0272] To facilitate further understanding, the system framework of a menu display method provided in an embodiment of the present application is described below. Fig.24 As shown:
[0273] The terminal device includes: third-party applications and external device system applications; among them, the third-party application supports web browsing and supports external device selection of content; the user browses the web in the third-party application, and the Web View in the terminal device monitors the menu display operation. If the menu display operation triggered by the user based on the external device is monitored, it is triggered through Figure 2 The steps in the embodiment determine the system-level context menu corresponding to the menu display operation, and display the system-level context menu corresponding to the menu display operation based on the external device system application.
[0274] The following is an overall process of a menu display operation provided by an embodiment of the present application. Fig.25A As shown, where:
[0275] Step 2501: The Web View monitors the operation of the external device.
[0276] Step 2502: In response to a menu display operation triggered by a user based on an external device, determine a target application corresponding to the menu display operation.
[0277] The specific implementation of this step is the same as step 201 and will not be described again here.
[0278] Step 2503: Determine whether the target application is in a preset whitelist, wherein objects in the preset whitelist do not have an application-level context menu.
[0279] The specific implementation of this step is the same as step 202 and will not be described again here.
[0280] Step 2504: If the target application is in the preset whitelist, obtain parameter information corresponding to the menu display operation.
[0281] The specific implementation of this step is the same as step 601 and will not be described again here.
[0282] Step 2505: Determine the system-level context menu corresponding to the menu display operation based on the parameter information.
[0283] The specific implementation of this step is the same as step 602 and will not be described again here.
[0284] Step 2506: Display the system level context menu.
[0285] The specific implementation of this step is the same as step 202 and will not be described again here.
[0286] like Fig.25B As shown, it is an interactive flow chart of a menu display operation provided by an embodiment of the present application, wherein:
[0287] Step 25001: The user triggers a menu display operation based on an external device.
[0288] Step 25002: Web View monitors the operation of the external device.
[0289] Step 25003: In response to a menu display operation triggered by the user based on an external device, determine a target application corresponding to the menu display operation.
[0290] The specific implementation of this step is the same as step 201 and will not be described again here.
[0291] Step 25004: Determine whether the target application is in the preset whitelist, and obtain parameter information corresponding to the menu display operation.
[0292] The specific implementation of this step is the same as step 601 and will not be described again here.
[0293] Step 25005: Determine the system-level context menu corresponding to the menu display operation based on the parameter information.
[0294] The specific implementation of this step is the same as step 602 and will not be described again here.
[0295] Step 25006: Display the system-level context menu.
[0296] The specific implementation of this step is the same as step 202 and will not be described again here.
[0297] In an embodiment of the present application, a response to a menu display operation triggered by an external device is achieved by setting a system-level context menu. By displaying the system-level context menu, it is convenient for users to operate the target application based on the system-level context menu.
[0298] Based on the same inventive concept, after introducing a menu display method provided by an embodiment of the present application, as shown in FIG. Fig.26 As shown, a menu display device 2600 provided in an embodiment of the present application is described below. The device includes: a response module 26001 and a menu display module 26002, wherein the response module 26001 is used to execute Figure 2 Step 201, Figure 3-Figure 8 Contents in Figure 14-16 Contents in Fig.17 Steps 1701 to 1703 in Figure 18-22B , Fig.23 Steps 2301 to 2305 in Fig.24 Some steps of Fig.25A Steps 2501-2505 and Fig.25B Steps 25001-25005 in
[0299] The menu display module 26002 is used to execute Figure 2 Step 202, Figure 9-13 Contents in Fig.17 Step 1704, Fig.23 Step 2306, Fig.24 Some steps of Fig.25A Step 2506 in Fig.25B Step 25006 in .
[0300] Corresponding to the above embodiments, the present application also provides an electronic device. Fig. 27A schematic diagram of the structure of an electronic device provided in an embodiment of the present invention, the electronic device 2700 may include: a processor 2701, a memory 2702 and a communication unit 2703. These components communicate through one or more buses, and those skilled in the art can understand that the structure of the electronic device shown in the figure does not constitute a limitation on the embodiment of the present invention, it can be a bus structure or a star structure, and can also include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0301] The communication unit 2703 is used to establish a communication channel so that the electronic device can communicate with other devices, receive user data sent by other devices or send user data to other devices.
[0302] The processor 2701 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It runs or executes software programs and / or modules stored in the memory 2702, and calls data stored in the memory to perform various functions of the electronic device and / or process data. The processor can be composed of an integrated circuit (IC), for example, it can be composed of a single packaged IC, or it can be composed of multiple packaged ICs with the same or different functions. For example, the processor 2701 can only include a central processing unit (CPU). In an embodiment of the present invention, the CPU can be a single computing core or multiple computing cores.
[0303] The memory 2702 is used to store the execution instructions of the processor 2701. The memory 2702 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0304] When the execution instructions in the memory 2702 are executed by the processor 2701, the electronic device 2700 can execute Figure 2 Some or all of the steps in the illustrated embodiments.
[0305] In a specific implementation, the present invention further provides a computer storage medium, wherein the computer storage medium may store a program, and when the program is executed, the program may include some or all of the steps in each embodiment of the menu display method provided by the present invention. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0306] Those skilled in the art can clearly understand that the technology in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution in the embodiments of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention or some parts of the embodiments.
[0307] In this specification, the same or similar parts between the various embodiments can be referred to each other. In particular, for the device embodiment and the terminal embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiment.
Claims
1. A menu display method, characterized in that: Applied to a terminal device, the method comprises: In response to a menu display operation triggered by an external device on a target content by a user, determining a system-level context menu corresponding to the menu display operation; the system-level context menu is a non-application-level context menu pre-set for an application in the terminal device based on the triggering of the external device; the target content is content in an application page of a target application corresponding to the menu display operation triggered by the user; Shows the system-wide context menu.
2. The method according to claim 1, characterized in that Before determining the system-level context menu corresponding to the menu display operation, the method further includes: Determining a target application corresponding to the menu display operation; Determining whether the target application is a first application; the first application is an application that does not have an application-level context menu corresponding to the menu display operation triggered by the external device; If it is determined that the target application is the first application, a system-level context menu corresponding to the menu display operation is determined.
3. The method according to claim 2, characterized in that The determining whether the target application is the first application includes: Determine whether the target application is in a preset whitelist; wherein the preset whitelist is used to record information of applications for which there is no application-level context menu corresponding to the menu display operation triggered by the external device; If the target application is in the preset whitelist, determining that the target application is the first application; If the target application is not in the preset whitelist, it is determined that the target application is not the first application.
4. The method according to claim 2, characterized in that: After determining whether the target application is the first application, the method further includes: If it is determined that the target application is not the first application, the obtained application-level context menu corresponding to the target application is displayed.
5. The method according to claim 2, characterized in that: After determining whether the target application is the first application, the method further includes: If it is determined that the target application is not the first application, the application-level context menu corresponding to the menu display operation triggered by the external device is shielded, and a system-level context menu corresponding to the menu display operation is determined.
6. The method according to claim 5, characterized in that The step of shielding the application-level context menu corresponding to the menu display operation triggered by the external device includes: Determine an application pop-up text interface corresponding to the target application; The position information and gesture information sent by the external device to the pop-up text interface are intercepted by displaying a framework control.
7. The method according to claim 2, characterized in that The determining a target application corresponding to the menu display operation includes: Obtain the location information and gesture information of the external device by displaying the framework control; The target application is determined based on a display interface triggered by the gesture information and the location information.
8. The method according to any one of claims 6-7, characterized in that: The display framework control includes: WebView.
9. The method according to claim 1, characterized in that: The determining a system-level context menu corresponding to the menu display operation includes: Obtain parameter information corresponding to the menu display operation; A system-level context menu corresponding to the menu display operation is determined based on the parameter information.
10. The method according to claim 9, characterized in that The obtaining parameter information corresponding to the menu display operation includes: Obtaining the application type of the target application corresponding to the menu display operation; The determining, based on the parameter information, a system-level context menu corresponding to the menu display operation includes: A system-level context menu corresponding to the menu display operation is determined according to the application type of the target application.
11. The method according to claim 9, characterized in that The obtaining parameter information corresponding to the menu display operation includes: Determine whether the selected content exists in the target content; If it exists, determining the selected content as the parameter information; The determining, based on the parameter information, a system-level context menu corresponding to the menu display operation includes: A system-level context menu corresponding to the menu display operation is determined based on the selected content.
12. The method according to claim 11, characterized in that The determining, based on the selected content, a system-level context menu corresponding to the menu display operation includes: Determining the type of the selected content; A system-level context menu corresponding to the menu display operation is determined based on the type of the selected content.
13. The method according to claim 11, characterized in that After determining whether the target content contains selected content, the method further includes: If there is no selected content, determining the system-level context menu corresponding to the menu display operation based on the parameter information includes: The preset system-level context menu is determined as the system-level context menu corresponding to the menu display operation; the preset system-level context menu is a preset default system-level context menu.
14. The method according to claim 13, characterized in that After determining whether the target content contains selected content, the method further includes: If there is no selected content, the menu display operation is ignored.
15. The method according to claim 11, characterized in that The type of the selected content includes at least one of the following: text information and image information.
16. The method according to claim 15, characterized in that The determining, based on the type of the selected content, a system-level context menu corresponding to the menu display operation includes: If the type of the selected content is text information, the system-level context menu corresponding to the menu display operation is the first preset menu; If the type of the selected content is image information, the system-level context menu corresponding to the menu display operation is the second preset menu.
17. The method according to claim 16, characterized in that The system-level context menu includes at least one menu item, and the first preset menu includes at least one or a combination of the following menu items: copy, select all, search, translate, and share; The second preset menu includes at least one or a combination of the following menu items: view picture, save picture, copy picture, share picture.
18. The method according to claim 1, characterized in that The displaying of the system-level context menu includes: Determining a display position of the system-level context menu; The system-level context menu is displayed at the display location.
19. The method according to claim 18, characterized in that Determining the display position of the system-level context menu includes: Acquire the trigger position of the menu display operation, and determine the trigger position as the display position of the system-level context menu; or, A preset position is obtained, and the preset position is determined as the display position of the system-level context menu.
20. The method according to claim 3, characterized in that The preset whitelist records the identity of at least one application that does not have an application-level context menu, and the determining whether the target application is in the preset whitelist includes: Obtaining the identity of the target application; Determine whether the target application is in a preset whitelist based on the identity of the target application.
21. The method according to claim 1, characterized in that The method further comprises: In response to a user's application adding operation, determining an added application corresponding to the application adding operation; Obtaining an identity corresponding to the added application; The identity corresponding to the added application is added to the preset whitelist.
22. The method according to claim 1, characterized in that The system-level context menu includes at least one menu item. After displaying the system-level context menu, the method further includes: In response to a selection operation of a menu item in the system-level context menu, determining a target menu item; In response to an adjustment operation on the target menu item, the target menu item is adjusted in the system level context menu.
23. The method according to claim 22, characterized in that In response to the adjustment operation on the target menu item, adjusting the target menu item in the system-level context menu includes: In response to a delete operation on the target menu item, deleting the target menu item from the system-level context menu; or, In response to the sequence adjustment operation on the target menu item, the position of the target menu item in the system level context menu is adjusted.
24. The method according to claim 1, characterized in that After displaying the system-level context menu, the method further includes: In response to a menu item adding operation of the system-level context menu, displaying a menu item to be added; In response to a selection operation on the menu item to be added, determining a new menu item; The newly added menu item is added to the system-level context menu.
25. The method according to any one of claims 1 to 24, characterized in that: The external device includes any one of the following: a mouse, a keyboard, a stylus, and a touchpad.
26. The method according to any one of claims 1 to 24, characterized in that: The menu display operation in response to the user triggering the target application based on the external device includes: When the external device includes a mouse, responding to a right-click operation of the mouse; and / or, When the external device includes a keyboard, responding to a click operation of a designated key of the keyboard; and / or, When the external device includes a stylus, responding to a designated operation of the stylus; and / or, When the external device includes a touch panel, respond to a designated touch operation of the touch panel.
27. The method according to any one of claims 1 to 24, characterized in that: The terminal device includes any one of the following: a tablet, a mobile phone, a smart car, a smart large screen, and a wearable device.
28. A menu display device, characterized in that: Applied to a terminal device, the device comprises: a response module, configured to determine, in response to a menu display operation triggered by an external device on a target content by a user, a system-level context menu corresponding to the menu display operation; the system-level context menu is a non-application-level context menu pre-set for an application in the terminal device based on the triggering of the external device; the target content is the content in an application page of a target application corresponding to the menu display operation triggered by the user; The menu display module is used to display the system-level context menu.
29. An electronic device, characterized in that: It comprises a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the method according to any one of claims 1 to 27.
30. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 27.
31. A computer program product, characterized in that The computer program product comprises: a computer program code, and when the computer program code is run on a computer, the computer is enabled to execute the method according to any one of claims 1 to 27.