Shortcut key operation control method and device, electronic equipment and medium
By receiving and processing shortcut key operations of external input devices, and enforcing shortcut key instructions that third-party applications do not respond to, it solves the problem of shortcut key failure caused by third-party application custom controls, and improves user experience and work efficiency.
Patent Information
- Application Number
- CN202311801432.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-26
- Publication Date
- 2025-06-27
AI Technical Summary
When users use mobile terminals, the custom controls of third-party applications cause the shortcut keys input by external input devices to fail, reducing the user's work efficiency and user experience.
Provides a shortcut key operation control method, by receiving shortcut key operations of external input devices, the third-party application is in the foreground running state, and its execution results are obtained. If a third-party application does not execute the instruction corresponding to the shortcut key operation, the control application will enforce the instruction based on the target control of its display interface.
Ensure that shortcut key operations can be successfully executed, improve user experience and work efficiency, and adapt to a variety of third-party applications based on secondary development of native controls.
Smart Images

Figure CN120215801A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of electronic devices, and in particular, to a method, apparatus, electronic device, and medium for controlling shortcut key operations. Background Art
[0002] When using a mobile terminal, users are more accustomed to using some shortcut key operations to improve usage efficiency. For example, copy operations, cut operations, etc. However, for some third-party application programs downloaded on the mobile terminal, due to the custom operations of the internal controls of the third-party application programs, the functions of the shortcut keys input by the user using an external input device become invalid, thereby reducing the user's work efficiency and bringing a bad user experience. Summary of the Invention
[0003] To overcome the problems existing in the related art, the present disclosure provides a method, apparatus, electronic device, and medium for controlling shortcut key operations.
[0004] According to a first aspect of an embodiment of the present disclosure, there is provided a method for controlling shortcut key operations, which is applied to a mobile terminal connected to an external input device. The method for controlling shortcut key operations includes:
[0005] Receiving a shortcut key operation input by the external input device when a third-party application program is in the foreground running state;
[0006] Obtaining an execution result of the third-party application program for the shortcut key operation;
[0007] If the execution result indicates that the third-party application program does not execute the instruction corresponding to the shortcut key operation, based on a target control in the display interface of the third-party application program, controlling the third-party application program to forcibly execute the instruction corresponding to the shortcut key operation, where the target control is used to represent the instruction corresponding to the shortcut key operation.
[0008] In some embodiments, the controlling the third-party application program to forcibly execute the instruction corresponding to the shortcut key operation based on the target control in the display interface of the third-party application program includes:
[0009] Determining an associated control having a preset association relationship with the target control based on the target control;
[0010] Performing a virtual click operation on the associated control to control the third-party application program to forcibly execute the instruction corresponding to the shortcut key operation.
[0011] In some embodiments, the determining an associated control having a preset association relationship with the target control based on the target control includes:
[0012] Locate the target control in the display interface of the third-party application, where the target control includes at least one of a text control and an image control;
[0013] Locate an associated control that has a preset association with the target control, where the associated control is a control with a click property in a clickable state.
[0014] In some embodiments, the locating of the associated control that has a preset association with the target control includes:
[0015] Based on the control group in the display interface of the third-party application, locate the upper-layer control of the target control;
[0016] Use the control in the upper-layer controls with a click property in a clickable state as the associated control.
[0017] In some embodiments, the shortcut key operation control method further includes:
[0018] Obtain the quantity of preset controls in the display interface of the third-party application;
[0019] If the quantity of the preset controls meets a preset condition, locate the target control in the display interface of the third-party application.
[0020] In some embodiments, the shortcut key operation control method further includes:
[0021] If the execution result indicates that the third-party application has executed the instruction corresponding to the shortcut key operation, determine whether the third-party application has executed a first preset operation associated with the shortcut key operation within a preset duration;
[0022] If the third-party application has not executed the first preset operation, control the third-party application to forcibly execute the instruction corresponding to the shortcut key operation.
[0023] In some embodiments, when the shortcut key operation includes any one of a copy operation and a cut operation, the first preset operation includes writing target content to the clipboard.
[0024] In some embodiments, the obtaining of the execution result of the third-party application for the shortcut key operation includes:
[0025] Monitor the process of the third-party application executing the instruction corresponding to the shortcut key operation;
[0026] Determine the execution result according to the monitoring result.
[0027] According to a second aspect of the embodiments of the present disclosure, there is provided a shortcut key operation control device, which is applied to a mobile terminal connected to an external input device. The shortcut key operation control device includes:
[0028] A receiving module, configured to receive a shortcut key operation input by the external input device when a third-party application is in the foreground running state;
[0029] An obtaining module, configured to obtain an execution result of the third-party application for the shortcut key operation;
[0030] A control module, configured to, if the execution result indicates that the third-party application does not execute the instruction corresponding to the shortcut key operation, based on a target control in the display interface of the third-party application, control the third-party application to forcibly execute the instruction corresponding to the shortcut key operation, where the target control is used to represent the instruction corresponding to the shortcut key operation.
[0031] According to a third aspect of the embodiments of the present disclosure, there is provided an electronic device, including:
[0032] A processor;
[0033] A memory for storing instructions executable by the processor;
[0034] Wherein, the processor is configured to execute the shortcut key operation control method as described in the first aspect of the present disclosure.
[0035] According to a fourth aspect of the embodiments of the present disclosure, there is provided a non-transitory computer-readable storage medium, which, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute the shortcut key operation control method as described in the first aspect of the present disclosure.
[0036] Adopting the above method of the present disclosure has the following beneficial effects: The shortcut key operation control method in the present disclosure can obtain the execution result of a third-party application for a shortcut key operation. When it is obtained that the execution result of the third-party application for the shortcut key operation is not successfully executed, that is, the third-party application does not respond to the shortcut key operation input in the external input device, it can control the third-party application to forcibly execute the instruction corresponding to the shortcut key operation, ensuring that the shortcut key operation can be successfully executed, thereby improving the user experience and work efficiency. Moreover, through the above method, the external input device can also be adapted to a variety of third-party applications developed by secondary development based on native controls.
[0037] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings here are incorporated into the specification and form a part of this specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure.
[0039] Figure 1 It is a flowchart of a shortcut key operation control method shown according to an exemplary embodiment.
[0040] Figure 2 It is a schematic diagram of the distribution and processing process of a shortcut key operation in a third-party application shown according to an exemplary embodiment.
[0041] Figure 3 It is a schematic diagram of the structure of a View tree shown according to an exemplary embodiment.
[0042] Figure 4 It is a flowchart of a shortcut key operation control method shown according to an exemplary embodiment.
[0043] Figure 5 It is a flowchart of a shortcut key operation control method shown according to an exemplary embodiment.
[0044] Figure 6 It is a schematic diagram of the distribution and processing process of a shortcut key operation in a third-party application shown according to an exemplary embodiment.
[0045] Figure 7 It is a flowchart of a shortcut key operation control method shown according to an exemplary embodiment.
[0046] Figure 8 It is a block diagram of a shortcut key operation control device shown according to an exemplary embodiment.
[0047] Figure 9 It is a block diagram of an electronic device shown according to an exemplary embodiment. Detailed Description of the Embodiments
[0048] Here, the exemplary embodiments will be described in detail, and the examples are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0049] When a user uses a mobile terminal, such as an electronic device like a mobile phone or a tablet, they usually connect an external input device, such as an external keyboard, to facilitate input. Connecting an external input device to a mobile terminal can not only help users improve the inconvenient experience of inputting only through the mobile terminal, but also enhance the input efficiency and comfort of users. Users can perform various operations based on the external input device, such as quickly switching applications, increasing the volume, changing the screen brightness, or shortcut key operations, etc., enabling users to control the mobile terminal faster and helping users improve their work efficiency.
[0050] Specifically, in the process of using an external input device, users often use the shortcut key function in the external input device. Among them, shortcut keys, also known as quick keys or hot keys, refer to completing an operation through certain specific keys, key sequences, or key combinations. Many shortcut keys often work in conjunction with keys such as the Ctrl key, Shift key, Alt key, Fn key, Windows key, etc. For example, the shortcut key operation Ctrl+S corresponds to the save function, and the shortcut key Ctrl+C corresponds to the copy function. Using shortcut keys can replace the mouse to do some work, and keyboard shortcut keys can be used to open, close, and navigate the "Start" menu, desktop, menu, dialog box, and web page. When a user uses the shortcut key function for a mobile terminal, if the application uses the native controls of the operating system (i.e., the controls have not been customized in any way) at this time, the application can support the use of shortcut keys.
[0051] However, currently, in order to make the interface of the application more diverse or make the style of the application more unique and personalized, developers of many third-party applications usually perform custom operations on the controls so that some controls can achieve specific functions and effects. For example, developers will perform secondary development on the basis of native controls to achieve custom operations on the native controls. Therefore, when a user uses the shortcut key function for a mobile terminal, since the controls have been secondarily developed, some shortcut key functions will fail, resulting in the lack of response to the shortcut keys input by the user in the external input device, which affects the user experience and work efficiency.
[0052] To solve the above problems, the present disclosure provides a shortcut key operation control method, which is applied to a mobile terminal connected to an external input device. When the shortcut key operation input by the user through the external input device cannot be executed by the third-party application running in the foreground, the mobile terminal will use the corresponding interface to find the target control corresponding to the shortcut key operation input by the user and force the third-party application to execute the instruction corresponding to the shortcut key operation, ensuring that the shortcut key operation input by the user is successfully executed, thereby improving the user experience and work efficiency.
[0053] Exemplary embodiments of the present disclosure provide a method for controlling shortcut key operations, which is applied to a mobile terminal connected to an external input device. The mobile terminal can specifically be a smart device such as a mobile phone, a tablet computer, a notebook, a smart wearable device, etc. that can be connected to an external input device. In addition, various hardware resources are provided on the electronic device, as well as an energy storage device for supplying power to the operation of various hardware resources, and a hardware interface connected to the external input device, etc.
[0054] As Figure 1 shown, the shortcut key operation control method shown in the present disclosure includes:
[0055] S101. When a third-party application is in the foreground running state, receive a shortcut key operation input by an external input device.
[0056] S102. Obtain the execution result of the third-party application for the shortcut key operation.
[0057] S103. If the execution result indicates that the third-party application does not execute the instruction corresponding to the shortcut key operation, based on the target control in the display interface of the third-party application, control the third-party application to forcibly execute the instruction corresponding to the shortcut key operation.
[0058] In step S101, combined with the above application scenario description, it can be known that the application object of the shortcut key operation control method shown in the present disclosure is a third-party application. In the application, the type of shortcut key operation serving the third-party application is usually an application-level shortcut key. Since the application-level shortcut key can only take effect in the currently active (i.e., foreground running state) application (that is, when the application is in the background running state, the application-level shortcut key cannot act on the background running application), therefore, the method in the present disclosure should be applied to a third-party application in the active state, that is, in the foreground running state. When the third-party application is in the foreground running state, the received shortcut key operation will be executed. If the third-party application is in the background running state or the unstarted state, the shortcut key operation is invalid. Among them, the third-party application can be, for example, a text input application, a graphics drawing application, etc.
[0059] Therefore, the running state of the third-party application is limited in step S101, and only when the third-party application is in the foreground running state can the subsequent steps be performed. In this embodiment, the running state of the third-party application is limited, thereby solving the problem that the shortcut key operation is invalid due to the running state of the third-party application. In this way, this embodiment can accurately locate the ultimate reason why the third-party application does not execute the instruction corresponding to the shortcut key operation.
[0060] In one example, the external input device can be an external keyboard. Among them, the external keyboard can be a Bluetooth keyboard or a keyboard connected to the mobile terminal through a connecting device. Moreover, the external keyboard can be composed of five aspects: the main keyboard area, the function key area, the editing control area, the numeric keypad area, and the keyboard prompt area. For the convenience of carrying, the external keyboard can also be composed of the remaining four aspects after removing the numeric keypad area based on the above five aspects.
[0061] The shortcut key operation is to use the combination of one or several keys on the keyboard to complete a function instruction, so as to achieve the purpose of improving the operation speed. There are various shortcut keys available on the keyboard. To reduce the space, only several common shortcut key operations are given in this embodiment, such as Ctrl+A (select all operation), Ctrl+C (copy operation), Ctrl+V (paste operation), Ctrl+X (cut operation), and so on.
[0062] In step S102, after the mobile terminal receives the shortcut key operation input by the external input device, the mobile terminal will dispatch the shortcut key operation to the third-party application program that is currently running in the foreground. It should be noted that the shortcut key operation is input manually on the external input device. However, when the shortcut key operation is input into the mobile terminal, the mobile terminal cannot directly determine that it is a real shortcut key operation. Therefore, it can first be determined as a key operation, and then the key operation is dispatched to the third-party application program that is currently running in the foreground. Finally, it is up to the third-party application program to determine whether the key operation is a real shortcut key operation.
[0063] An application program can have 1 process or multiple processes. Among them, a process refers to the activities that occur when a program and its data are being executed. The processes of the application program can be run manually, automatically run under a certain trigger condition, or run according to the scheduling defined by the user's personalization. The application program can start a single-process service or a multi-process service. Correspondingly, in this embodiment, the process of the third-party application program executing the shortcut key operation should occur in the process of the third-party application program.
[0064] It should be noted that when the key operation is a real shortcut key operation, steps S102 - S103 will be executed, and then the shortcut key operation will be dispatched to the process corresponding to the shortcut key operation in the process of the third-party application, and the execution result of the third-party application for the shortcut key operation will be fed back. On the contrary, when it is determined that the shortcut key operation is not a real shortcut key operation, the third-party application will dispatch it to the process corresponding to the non-shortcut key operation. Among them, the process corresponding to the non-shortcut key operation can be a process within the third-party application or a process outside the third-party application. For example, the mobile terminal receives a non-shortcut key operation X, and the non-shortcut key operation X corresponds to an instruction A, where the instruction A indicates that the user has input a certain piece of information in the external input device, and this piece of information is to be input into the third-party application. Correspondingly, the non-shortcut key operation X will be dispatched to the process corresponding to the non-shortcut key operation in the process of the third-party application. In addition, if the non-shortcut key operation X represents an operation on another application, the non-shortcut key operation X can be dispatched to a process outside the third-party application (and this process is the process of the application corresponding to the non-shortcut key operation X).
[0065] In summary, regardless of whether the key operation input by the external input device is a shortcut key operation or a non-shortcut key operation, the mobile terminal will ultimately dispatch the key operation to the corresponding processing process so that the instruction corresponding to the key operation can be executed. However, the dispatch paths corresponding to the shortcut key operation and the non-shortcut key operation may be different.
[0066] An application program is composed of three parts: a program, data, and related documents. A program is a collection of instructions and data, which can be read and understood by a computer / terminal. And the execution of the instruction corresponding to the shortcut key operation by the application program is essentially a process in which an application program executes its corresponding function after receiving the shortcut key operation. Therefore, when writing the executable program of the application program, the return value of the function can be set in the function corresponding to the shortcut key in the executable program of the application program. For the convenience of understanding, the program and the executable program here and in the following text can be generally understood as the source files written by the programmer in the language supported by the development tool, that is, the code.
[0067] In one example, the execution result of the shortcut key operation by a third-party application can be obtained by obtaining the return value of a function. Generally, when the return value of the function is 0, it indicates that the corresponding operation has been executed; when the return value of the function is non-zero, it indicates that the corresponding operation has not been executed. Additionally, it should be noted that the non-zero return value of the function includes two cases: when the return value of the function is greater than 0 and when the return value of the function is less than 0. Among them, when the return value of the function is greater than 0, it indicates that an error occurred during the execution of the corresponding operation. For the convenience of technicians to troubleshoot, the specific error code is usually returned together. When the return value of the function is less than 0, it indicates that the execution process of the corresponding operation has been terminated or an abnormal situation has occurred.
[0068] Therefore, the return value of the function corresponding to the shortcut key operation can be used as the execution result. When the execution result is 0, it indicates that the third-party application has executed the shortcut key operation. Conversely, when the execution result is non-zero, it indicates that the third-party application has not executed the shortcut key operation.
[0069] In another example, a listener can be set to monitor the process of the third-party application executing the instruction corresponding to the shortcut key operation, and the execution result can be determined based on the monitoring result. In a program, a listener is a mechanism used to monitor or respond to specific events. That is to say, a listener can perceive or respond to events and execute corresponding logical processing. Therefore, a listener can be used to monitor the process of the third-party application executing the instruction corresponding to the shortcut key operation and obtain the execution result. For example, the execution result of the complete event during the process of the third-party application executing the instruction corresponding to the shortcut key operation can be monitored by a listener. If the monitoring result is that the complete event has been completed, the execution result is that the third-party application has executed the instruction corresponding to the shortcut key operation; if the monitoring result is that the complete event has not been completed, the execution result is that the third-party application has not executed the instruction corresponding to the shortcut key operation.
[0070] In step S103, if the execution result indicates that the third-party application has not executed the instruction corresponding to the shortcut key operation, it means that the shortcut key operation has not been successfully responded to, that is, in the current situation, the shortcut key operation is invalid. Therefore, based on the target control, the third-party application needs to be controlled to forcibly execute the instruction corresponding to the shortcut key operation.
[0071] In one example, the target control can be a control with a clickable state property, such as a text control or an image control, or a control with a non - clickable state property, such as a button. Subsequently, a third - party application can use a control with a non - clickable state property such as a text control or an image control to implement the display of instructions corresponding to shortcut key operations, that is, to display the instructions corresponding to the shortcut key operations through the text content displayed by the text control or the icon in the image control / the meaning of the image control. Additionally, the target control can also be a button with a clickable state property, and the instructions corresponding to the shortcut key operations are represented by the name of the button. Therefore, the target control can be used to represent the instructions corresponding to the shortcut key operations.
[0072] Therefore, based on the target control, controlling the third - party application to enforce the instructions corresponding to the shortcut key operations is equivalent to enforcing the instructions corresponding to the target control.
[0073] For the sake of easy understanding, the process of the third - party application performing shortcut key operations is described below:
[0074] As Figure 2 shown in the schematic diagram of the distribution and processing process of the shortcut key operation in the third - party application, it can be seen that there are View, ViewRootImpl, InputStage (stage), and ViewPostImeInputStage set in the third - party application. For the sake of easy understanding, some of the terms in the above content are explained below:
[0075] View refers to the base class of all controls in the mobile terminal. Whether it is a button (button) or a TextView (text) control, or a more complex RelativeLayout (relative layout), ListView (list) control, their base class is the View class.
[0076] ViewRootImpl is responsible for handling the distribution of input events, the drawing of the View, or the update of the UI (User Interface) of the View. ViewRootImpl can implement the distribution of all input events. When an input event occurs, ViewRootImpl will pass the event to the root View of the application, and then the root View will pass the event to the child Views in a certain order until a View that can handle the event is found.
[0077] If the key operation is a shortcut key operation, the dispatchKeyShortcutEvent function will be called to distribute the key event corresponding to the key operation to the View hierarchy to interpret the key event.
[0078] The following takes the shortcut operation as an example of the copy operation, and combines with Figure 2 to illustrate the processing process of the copy operation by the mobile terminal and the third-party application:
[0079] S1. The mobile terminal receives the copy operation input by the external input device and dispatches the copy operation to the third-party application.
[0080] S2. The ViewRootImpl of the third-party application receives the copy operation and distributes it to the InputStage to enable the InputStage to process the copy operation. From the perspective of the code, the input copy operation will be processed in multiple stages (InputStage), and each stage corresponds to a Stage, that is, an input copy operation corresponds to multiple Stages. Refer to Figure 6 , InputStageA and InputStageB in the figure can be understood as subclasses under the InputStage abstract class, that is, multiple Stages. In addition. The onProcess of each stage (which can be understood as the processing function of each Stage) can have different contents, that is, each stage can perform different processing on the copy operation. That is, InputStageA and InputStageB can perform corresponding processing on the input copy operation through their respective onProcess functions. It should be noted that in actual applications, the number of InputStages may not only be InputStageA and InputStageB, Figure 6 InputStageA and InputStageB in
[0081] S3. After being processed by several InputStages, the copy operation is distributed to the ViewPostImeInputStage. Subsequently, the ViewPostImeInputStage determines whether the copy operation is a shortcut operation. If it is a shortcut operation, it calls the dispatchKeyShortcutEvent function to dispatch the copy operation to the View corresponding to the copy operation.
[0082] S4. The View executes the instruction corresponding to the copy operation and returns the execution result to the ViewPostImeInputStage at the same time.
[0083] After going through steps such as S1 - S4, the execution result of the third-party application for the copy operation can be obtained.
[0084] The shortcut key operation control method in the present disclosure can obtain the execution result of the shortcut key operation by a third-party application. When the execution result of the shortcut key operation obtained by the third-party application is unsuccessful (that is, the shortcut key operation input by the user in the external input device has no response), the third-party application can be controlled to forcibly execute the instruction corresponding to the shortcut key operation, ensuring the successful execution of the shortcut key operation, thereby improving the user experience and work efficiency. Moreover, through the above method, the external input device can also be adapted to multiple third-party applications that perform secondary development on native controls.
[0085] According to an exemplary embodiment, as Figure 4 shown, the shortcut key operation control method in this embodiment includes:
[0086] S401. When the third-party application is in the foreground running state, receive the shortcut key operation input by the external input device.
[0087] S402. Obtain the execution result of the third-party application for the shortcut key operation.
[0088] S403. If the execution result indicates that the third-party application does not execute the instruction corresponding to the shortcut key operation, based on the target control, determine the associated control that has a preset association relationship with the target control.
[0089] S404. Perform a virtual click operation on the associated control to control the third-party application to forcibly execute the instruction corresponding to the shortcut key operation.
[0090] Among them, steps S401 - S402 are the same as steps S101 - S102 in the above embodiment, and will not be elaborated here.
[0091] In step S403, various types of target controls are given in step S103. Therefore, the target control in the display interface of the third-party application can be found first based on the type of the target control.
[0092] In the related art, as Figure 3 shown in the structural schematic diagram of the View, the overall structure of the View is actually a View tree. Among them, the bottom layer of the View tree can be a TextView (text control), an ImageView (image control), or a Button (button), and the control on the upper layer connected to the above controls is the parent control of the above controls (text control, image control, and button), that is Figure 3 the RelativeLayout (relative layout) control and the LinderLayout (linear layout) control shown inFigure 3 The LinderLayout (linear layout) control shown in
[0093] In one example, the process of finding the target control can be: traverse the View tree (i.e., Figure 3 the view tree structure shown), determine one or more text controls from the View tree, and among the one or more text controls, determine the text control whose displayed text content is the same as the instruction corresponding to the shortcut key operation, to obtain the target control. For example, if the instruction corresponding to the shortcut key operation is "Copy", then in the display interface of the third-party application, determine the text control whose displayed text content is "Copy", and determine this text control as the target control. Another example, if the instruction corresponding to the shortcut key operation is "Cut", then in the display interface of the third-party application, determine the text control whose displayed text content is "Cut", and determine this text control as the target control.
[0094] In another example, the process of finding the target control can be: traverse the View tree, determine one or more image controls from the View tree, and among the one or more image controls, determine the image control whose icon or meaning of the image control is the same as the instruction corresponding to the shortcut key operation, to obtain the target control. For example, if the instruction corresponding to the shortcut key operation is "Copy", and the icon in a certain image control corresponds to the "Copy" instruction, then in the display interface of the third-party application, determine the image control including this icon, and determine this image control as the target control. Another example, if the instruction corresponding to the shortcut key operation is "Copy", and the meaning of a certain image control is "Copy", then in the display interface of the third-party application, determine the image control whose meaning is "Copy", and determine this image control as the target control.
[0095] In another example, the process of finding the target control can be: traverse the View tree, determine one or more buttons from the View tree, and among the one or more buttons, determine the image control whose button name is the same as the instruction corresponding to the shortcut key operation, to obtain the target control. For example, if the instruction corresponding to the shortcut key operation is "Copy", then in the display interface of the third-party application, determine the button whose button name is "Copy", and determine this button as the target control.
[0096] If the target control includes at least one of a text control and an image control, correspondingly, the click attribute of the target control is in a non-clickable state. When the click attribute of the target control is in a non-clickable state, the third-party application cannot execute the instruction corresponding to the shortcut operation by clicking the target control. Therefore, at this time, it is also necessary to find a control with a clickable state based on the target control, and based on this control with a clickable state, implement controlling the third-party application to enforce the instruction corresponding to the shortcut operation.
[0097] In an example, an associated control having a preset association relationship with the target control can be determined based on the target control. Among them, the preset association relationship can be understood as that the target control and the associated control belong to the same control group, and the associated control is a control with a clickable state for the click attribute. Specifically, based on the control group in the display interface of the third-party application, the upper-layer control of the target control can be searched, and the control with a clickable state in the upper-layer control is used as the associated control.
[0098] Combined with the above content Figure 3 In the structural schematic diagram of the view tree shown, it can be obtained that belonging to the same control group in the above text is equivalent to the target control and the associated control belonging to the same view or view branch. For the convenience of subsequent discussion, in the following text, the concept that the target control and the associated control belong to the same view is uniformly used to describe that the target control and the associated control belong to the same control group.
[0099] When the target control is a text control or an image control, by viewing Figure 3 In the structural schematic diagram of the view tree shown, it can be seen that the target control is located at the bottom layer of the View tree, and in the View tree, in the upper layer or other upper layers of the target control, there are controls that belong to the same View as the target control and have a clickable state for the click attribute. For example, LinerLayout (linear layout) control, RelativeLayout (relative layout) control. Therefore, the final associated control can be determined based on the View tree.
[0100] In one example, the process of determining an associated control may be as follows: First, find the target control in the display interface of the third-party application, and then, based on the known preset association relationship and the click attribute of the associated control, find, in the View tree, the associated control that has a preset association relationship with the target control. Specifically, in the actual search process, it may not be possible to directly find the associated control that has a preset association relationship with the target control and whose click attribute is in a clickable state. Therefore, after finding the target control, the parent control of the target control (the control one level above the target control) can be found first, and it is determined whether the parent control can be clicked. If the parent control can be clicked, the parent control is determined as the associated control. If the parent control can be clicked, continue to find the parent control of the parent control, and then determine whether the parent control of the parent control can be clicked,... and so on, until a clickable control is found, and this control is determined as the associated control. It is worth mentioning that no matter whether the found associated control is the parent control several levels above the target control, the associated control and the target control belong to the same View, that is, there is always a preset association relationship between the associated control and the target control. For example, taking Figure 3 the structural schematic diagram of the view tree shown in Figure Figure 3 as an example, assuming that the target control is a text control (Textview), it can be obtained that the click attribute of the target control is in a non-clickable state. Thus, the control one level above the text control can be found, and a LinerLayout control can be found. Since the click attribute of the LinerLayout control is in a clickable state, the LinerLayout control can be directly determined as the associated control. However, if the control one level above the text control is still a control with a non-clickable click attribute (such as still a text control or an image control), and here it is assumed to be an image control, the mobile terminal will continue to find the control one level above the image control and determine the click attribute of the control one level above the image control. By performing like this, an associated control that meets the conditions will generally be found.
[0101] However, it is also possible that no associated control that meets the conditions can be found. If no associated control that has a preset association relationship with the target control and whose click attribute is in a clickable state can be found during the process of determining the associated control according to the above method, it can be determined that there are problems such as program errors and program chaos in the content of the third-party application. At this time, the user can be prompted that there is an error in the internal program of the third-party application. For example, the user can be prompted in the form of a prompt box "Internal program error, unable to execute the instruction corresponding to the shortcut key operation", and after prompting the user, the technical personnel can be notified by email or text message so that the technical personnel can troubleshoot the internal program of the third-party application and remove the internal errors of the program, so as to successfully find the associated control.
[0102] In addition, it should be noted that when the third-party application executes the instruction corresponding to the shortcut key operation, the object to be executed should exist in the interface of the third-party application. For example, the object to be executed can be the selected text content. Therefore, before searching for the target control in the display interface of the third-party application, it should be determined that there is an object to be executed in the third-party application. In one example, the start control, end control, and menu control are generally used to define the object to be executed. For example, two selection handles and a context menu are used to define the selected text content.
[0103] In the related art, the start control, end control, menu control, etc. can all be implemented through the PopupWindow control. Therefore, in one example, the number of preset controls (i.e., PopupWindow controls) in the display interface of the third-party application can be obtained, and when the number of preset controls meets the preset conditions, the target control in the display interface of the third-party application is searched. For example, the number of selection handles and context menus in the display interface of the third-party application can be obtained. When there are at least two selection handles and at least one context menu (i.e., at least three PopupWindow controls), it is determined that there is selected text content in the display interface of the third-party application. At this time, the target control in the display interface of the third-party application can be searched.
[0104] In step S404, since the associated control may not be a control in the interface of the third-party application, an operation of simulated click (virtual click) needs to be used to implement the click on the associated control. Among them, virtual click can refer to simulating the click of the user's hand to automatically trigger the mouse click event on the user interface. And clicking on the associated control is equivalent to indirectly executing the instruction corresponding to the shortcut key operation represented by the target control, that is, controlling the third-party application to enforce the instruction corresponding to the shortcut key operation.
[0105] In this embodiment, when the click attribute of the target control is in an unclickable state, by searching for an associated control with a clickable state that belongs to the same View as the target control and performing a virtual click operation on the associated control, the third-party application is made to enforce the instruction corresponding to the shortcut key operation, so that the shortcut key operation input by the external input device can be executed, greatly improving the user experience and work efficiency.
[0106] According to an exemplary embodiment, as Figure 5 shown, the shortcut key operation control method in this embodiment includes:
[0107] S501. When the third-party application is in the foreground running state, receive the shortcut key operation input by the external input device.
[0108] S502. Obtain the execution result of the shortcut key operation by the third-party application.
[0109] S503. If the execution result indicates that the third-party application has not executed the instruction corresponding to the shortcut key operation, based on the target control in the display interface of the third-party application, control the third-party application to enforce the execution of the instruction corresponding to the shortcut key operation.
[0110] S504. If the execution result indicates that the third-party application has executed the instruction corresponding to the shortcut key operation, determine that the third-party application has not executed the first preset operation associated with the shortcut key operation within the preset duration.
[0111] S505. Control the third-party application to enforce the execution of the instruction corresponding to the shortcut key operation.
[0112] Among them, steps S501 - S503 are the same as steps S101 - S103 in the above embodiment, and will not be elaborated here.
[0113] In step S504, the reason for performing step S504 is as follows: Refer to Figure 2 the schematic diagram of the interaction process in the third application shown. It can be seen that after the third-party application executes the shortcut key operation, it will return an execution result. However, in the actual application process, the third-party application is very likely to return an incorrect execution result to deceive the user, making the user think that the shortcut key operation has been executed, but in fact, the shortcut key operation has not been executed. Therefore, in order to ensure that the third-party application truly executes the shortcut key operation, a verification method needs to be set to determine whether the third-party application has truly executed the shortcut key operation.
[0114] In one example, it can be determined whether the third-party application has truly executed the shortcut key operation by judging whether the third-party application has executed the first preset operation associated with the shortcut key operation within the preset duration. Among them, when the shortcut key operation can be any one of the copy operation and the cut operation, the third-party application will add the selected content to be copied or cut to the clipboard. Therefore, when the shortcut key operation is any one of the above operations, the first preset operation includes writing the target content to the clipboard. For example, detect whether the third-party application writes the target content to the clipboard. When the third-party application writes the target content to the clipboard, it indicates that the third-party application has truly executed the copy / cut operation; when the third-party application does not write the target content to the clipboard, it indicates that the third-party application has not executed the copy / cut operation. At this time, it is necessary to control the third-party application to enforce the execution of the instruction corresponding to the copy / cut operation.
[0115] In addition, there is a special case where, although a third-party application has performed a first preset operation, the time taken for the first preset operation is too long. That is to say, the response of the third-party application to the shortcut key operation is slow, which will also affect the user experience and the user's work efficiency. Therefore, in order to provide a better user experience, it is also necessary to limit the time for the third-party application to perform the first preset operation, that is, to perform the first preset operation within a preset duration.
[0116] In addition, it should be noted that in this embodiment, only the verification method corresponding to any one of the copy operation and the cut operation as the shortcut key operation is given. However, the verification method can also be set according to actual requirements and specific shortcut key operations. For example, if the shortcut key operation is the Ctrl+B (bold) operation, it can be verified whether the selected text content in the display interface of the third-party application is bolded. If the selected text content is bolded, it means that the third-party application has truly performed the bold operation. If the selected text content is not bolded, it means that the third-party application has not truly performed the bold operation, and the execution result returned by the third-party application is incorrect. At this time, the third-party application can be controlled to enforce the instruction corresponding to the shortcut key operation.
[0117] In step S505, when the third-party application does not perform the first preset operation, it indicates that the execution result of the shortcut key operation performed by the third-party application may be incorrect, that is, the third-party application does not perform the shortcut key operation. In this state, the shortcut key operations input by the external input device are all invalid and not responded to. Therefore, it is necessary to control the third-party application to enforce the instruction corresponding to the shortcut key operation so that the shortcut key operation can be executed.
[0118] As Figure 6 shown in the schematic diagram of the distribution and processing process of the shortcut key operation in the third-party application, Figure 6 On Figure 2 this basis, a SuperCopyManager (Super Copy Manager) is additionally set, and a ClipboardManager (system clipboard) is set between the View and the SuperCopyManager. Among them, ClipboardManager is a system service used to manage clipboard content. It allows users to copy and paste text, links, or images, etc. between applications. The View can set the specified ClipData (which can refer to the text to be copied) as the main clipboard content by calling the setPrimaryClip function. By calling the setPrimaryClip function, content such as text, links, or images can be pasted into the clipboard.
[0119] A listener can be set in the ClipboardManager to monitor whether the target content is written into the ClipboardManager. In one example, when it is monitored that the target content is written into the ClipboardManager, the execution result is sent to the SuperCopyManager. That is to say, when the SuperCopyManager receives the execution result, it indicates that the shortcut key operation is actually executed. Therefore, optionally, it can also be determined whether the third-party application has actually executed the shortcut key operation by monitoring whether the SuperCopyManager has received the execution result. In another example, in any case, the execution result can be sent to the SuperCopyManager, and the monitoring result of the ClipboardManager (named the second monitoring result here for distinction from the above) is also sent to the ClipboardManager, so that the ClipboardManager can determine whether the third-party application has actually executed the shortcut key operation based on both the execution result and the monitoring result.
[0120] The following takes the shortcut key operation as the copy operation as an example and combines Figure 6 to illustrate the processing process of the copy operation by the mobile terminal and the third-party application:
[0121] S10. The mobile terminal receives the copy operation input by the external input device and distributes the copy operation to the third-party application.
[0122] S20. The ViewRootImpl of the third-party application receives the copy operation and distributes it to the InputStage to enable the InputStage to process the copy operation. From the perspective of the code, the input copy operation will be processed in multiple stages (InputStage), and each stage corresponds to a Stage, that is, an input copy operation corresponds to multiple Stages. Moreover, the onProcess of each stage (which can be understood as the processing function of each Stage) can have different contents, that is, each stage can perform different processing on the copy operation. Generally speaking, InputStage is an abstract class, and its subclasses, namely each Stage, need to inherit this abstract class and then implement the corresponding processing of the input copy operation through the onProcess function.
[0123] S30. After being processed by several InputStages, the copy operation is distributed to the ViewPostImeInputStage. Subsequently, the ViewPostImeInputStage determines whether the copy operation is a shortcut key operation. If it is a shortcut key operation, it calls the dispatchKeyShortcutEvent function to dispatch the copy operation to the corresponding View of the copy operation.
[0124] S40. The View executes the instruction corresponding to the copy operation. At this time, by calling the setPrimaryClip function, the copied content can be written into the ClipboardManager, and at the same time, the View also returns the execution result to the ViewPostImeInputStage.
[0125] S50. The ViewPostImeInputStage sends the execution result to the SuperCopyManager.
[0126] S60. The listener in the ClipboardManager listens for whether there is any content pasted into the ClipboardManager within a preset time period, and generates a second listening result (paste success, paste failure) accordingly.
[0127] S70. The SuperCopyManager determines whether to enforce the instruction corresponding to the copy operation based on the received execution result and the second listening result. For example, when the execution result indicates that the copy operation is invalid (its corresponding instruction has not been successfully executed), the SuperCopyManager will enforce the instruction corresponding to the copy operation; another example is that when the execution result indicates that the instruction corresponding to the copy operation has been executed, if the paste is successful, it means that the instruction corresponding to the copy operation has been successfully executed, and there is no need to enforce the instruction corresponding to the copy operation. If the paste fails, it means that the instruction corresponding to the copy operation has not been successfully executed (execution result error), and the SuperCopyManager will enforce the instruction corresponding to the copy operation.
[0128] After going through steps such as S10 - S70, it can be determined whether to enforce the instruction corresponding to the copy operation based on the listening result and the execution result.
[0129] In this embodiment, when the shortcut key operation includes any one of the copy operation and the cut operation, and the execution result indicates that the third-party application has executed the shortcut key operation, by adding a verification method of whether the third-party application has executed a first preset operation associated with the shortcut key operation within a preset duration, it is determined whether the third-party application has truly executed the shortcut key operation, so as to verify whether the execution result is correct. In the case of an incorrect execution result, the third-party application is controlled to forcibly execute the instruction corresponding to the shortcut key operation, so that the shortcut key operation is responded to. The shortcut key operation control method shown in this embodiment can forcibly execute the shortcut key operation in the case of an incorrect execution result, so as to ensure that the shortcut key operation can be responded to under any circumstances, and to maximize the user experience.
[0130] For ease of understanding, as Figure 7 shown below, a specific embodiment is used to illustrate the shortcut key operation control method shown in the present disclosure:
[0131] S701. Obtain the execution result of the third-party application for the shortcut key operation.
[0132] S702. Based on the execution result, determine whether the third-party application has executed the instruction corresponding to the shortcut key operation. If so, execute step S703; if not, execute step S705.
[0133] S703. Determine whether the third-party application has executed a first preset operation associated with the shortcut key operation within a preset duration. If so, execute step S704; if not, execute step S705.
[0134] S704. Do not forcibly execute the instruction corresponding to the shortcut key operation. Here, not forcibly executing the instruction corresponding to the shortcut key operation can be understood as not controlling the third-party application to perform a forced execution behavior.
[0135] S705. Determine whether the number of preset controls in the display interface of the third-party application meets a preset condition. If so, execute step S706; if not, execute step S704.
[0136] S706. Determine whether a target control exists in the display interface of the third-party application. If so, execute step S707; if not, execute step S704.
[0137] S707. Determine whether there is an associated control that has a preset association relationship with the target control. If so, execute step S708; if not, execute step S704.
[0138] If there is no associated control that has a preset association with the target space, it indicates that the third-party application does not support the function corresponding to the shortcut key. Therefore, the instruction corresponding to the shortcut key operation cannot be executed, and the shortcut key operation is ignored. Error information can be fed back to the server of the third-party application, etc.
[0139] S708. Perform a virtual click operation on the associated control. In this way, the third-party application can be controlled to enforce the instruction corresponding to the shortcut key operation.
[0140] In step S706, in one example, if there is no target control in the display interface of the third-party application, it indicates that there may be some problems with the internal program (code) of the third-party application. For example, the internal program is chaotic. Therefore, while performing step S704, a prompt box for prompting the technician to troubleshoot the problem is still displayed in the display interface.
[0141] In one example, by searching for the target control in the display interface of the third-party application, it can be determined whether there is a target control in the display interface of the third-party application. The specific search process can refer to the content shown in step S403.
[0142] In step S707, similar to the above step S706, if there is no associated control that has a preset association with the target control, it also indicates that there may be some problems with the internal program (code) of the third-party application. Therefore, while performing step S704, a prompt box for prompting the technician to troubleshoot the problem is still displayed in the display interface.
[0143] An exemplary embodiment of the present disclosure provides a shortcut key operation control device, as Figure 8 shown, a block diagram of a shortcut key operation control device shown in the present disclosure.
[0144] The block diagram includes a receiving module 81, an obtaining module 82, and a control module 83. The receiving module 81 is configured to receive a shortcut key operation input by an external input device when the third-party application is in the foreground running state; the obtaining module 82 is configured to obtain the execution result of the third-party application for the shortcut key operation; the control module 83 is configured to, if the execution result indicates that the third-party application does not execute the instruction corresponding to the shortcut key operation, based on the target control in the display interface of the third-party application, control the third-party application to enforce the instruction corresponding to the shortcut key operation, where the target control is used to represent the instruction corresponding to the shortcut key operation.
[0145] In some embodiments, the control module 83 is specifically configured to:
[0146] Based on the target control, determine an associated control that has a preset association with the target control;
[0147] Perform a virtual click operation on the associated control to control the third-party application to enforce the instruction corresponding to the shortcut key operation.
[0148] In some embodiments, the control module 83 is specifically configured to:
[0149] Locate the target control in the display interface of the third-party application, where the target control includes at least one of a text control and an image control;
[0150] Locate the associated control that has a preset association relationship with the target control, where the associated control is a control with a click attribute in a clickable state.
[0151] In some embodiments, the control module 83 is specifically configured to:
[0152] Based on the control group in the display interface of the third-party application, locate the upper-layer control of the target control;
[0153] Use the control with a click attribute in a clickable state in the upper-layer control as the associated control.
[0154] In some embodiments, the shortcut key operation control device further includes a first processing module;
[0155] The first processing module is specifically configured to:
[0156] Obtain the number of preset controls in the display interface of the third-party application;
[0157] If the number of preset controls meets the preset condition, locate the target control in the display interface of the third-party application.
[0158] In some embodiments, the shortcut key operation control device further includes a second processing module;
[0159] The second processing module is specifically configured to:
[0160] If the execution result indicates that the third-party application has executed the instruction corresponding to the shortcut key operation, determine whether the third-party application has executed a first preset operation associated with the shortcut key operation within a preset duration;
[0161] If the third-party application has not executed the first preset operation, control the third-party application to enforce the instruction corresponding to the shortcut key operation.
[0162] In some embodiments, when the shortcut key operation includes any one of a copy operation and a cut operation, the first preset operation includes writing the target content to the clipboard.
[0163] In some embodiments, the obtaining module 82 is specifically configured to:
[0164] Monitor the process of executing the instructions corresponding to the shortcut key operations on third-party applications;
[0165] Determine the execution result according to the monitoring result.
[0166] Regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated herein.
[0167] Figure 9 It is a block diagram of an electronic device 900 shown according to an exemplary embodiment.
[0168] Refer to Figure 9 , the electronic device 900 may include one or more of the following components: a processing component 902, a memory 904, a power supply component 906, a multimedia component 908, an audio component 910, an input / output (I / O) interface 912, a sensor component 914, and a communication component 916.
[0169] The processing component 902 generally controls the overall operation of the electronic device 900, such as operations associated with display, telephone calls, data communication, camera operations, and recording operations. The processing component 902 may include one or more processors 920 to execute instructions to complete all or part of the steps of the above method. In addition, the processing component 902 may include one or more modules to facilitate the interaction between the processing component 902 and other components. For example, the processing component 902 may include a multimedia module to facilitate the interaction between the multimedia component 908 and the processing component 902.
[0170] The memory 904 is configured to store various types of data to support the operation of the electronic device 900. Examples of these data include instructions for any application or method operating on the electronic device 900, contact data, phone book data, messages, pictures, videos, etc. The memory 904 may 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, a magnetic disk, or an optical disc.
[0171] The power supply component 906 provides power to various components of the electronic device 900. The power supply component 906 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 900.
[0172] The multimedia component 908 includes a screen that provides an output interface between the electronic device 900 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of the touch or swipe actions, but also detect the duration and pressure associated with the touch or swipe operations. In some embodiments, the multimedia component 908 includes a front camera and / or a rear camera. When the electronic device 900 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.
[0173] The audio component 910 is configured to output and / or input audio signals. For example, the audio component 910 includes a microphone (MIC) that is configured to receive external audio signals when the electronic device 900 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 904 or transmitted via the communication component 916. In some embodiments, the audio component 910 further includes a speaker for outputting audio signals.
[0174] The I / O interface 912 provides an interface between the processing component 902 and a peripheral interface module, and the peripheral interface module can be a keyboard, a click wheel, buttons, etc. These buttons can include, but are not limited to: a home button, a volume button, a power button, and a lock button.
[0175] The sensor component 914 includes one or more sensors for providing a status assessment of various aspects of the electronic device 900. For example, the sensor component 914 can detect the on / off state of the electronic device 900, the relative positioning of components, such as the display and the keypad of the electronic device 900. The sensor component 914 can also detect a change in the position of the electronic device 900 or a component of the electronic device 900, the presence or absence of user contact with the electronic device 900, the orientation or acceleration / deceleration of the electronic device 900, and the temperature change of the electronic device 900. The sensor component 914 can include a proximity sensor that is configured to detect the presence of nearby objects without any physical contact. The sensor component 914 can also include a light sensor, such as a CMOS or a CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 914 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0176] The communication component 916 is configured to facilitate communication between the electronic device 900 and other devices in a wired or wireless manner. The electronic device 900 can access a communication standard-based wireless network, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 916 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 916 further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0177] In an exemplary embodiment, the electronic device 900 can be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above method.
[0178] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 904 including instructions, and the above instructions can be executed by a processor 920 of the electronic device 900 to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, Random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0179] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute the shortcut operation control method provided by the exemplary embodiments of the present disclosure.
[0180] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common general knowledge or conventional technical means in the technical field not disclosed by the present disclosure. The specification and embodiments are only to be considered as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.
[0181] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.
Claims
1. A method for controlling shortcut key operations, characterized in that, A mobile terminal applied to connect an external input device, and the shortcut key operation control method includes: Receiving a shortcut key operation input by the external input device when a third-party application is in the foreground running state; Obtaining an execution result of the third-party application for the shortcut key operation; If the execution result indicates that the third-party application does not execute the instruction corresponding to the shortcut key operation, based on a target control in the display interface of the third-party application, controlling the third-party application to forcibly execute the instruction corresponding to the shortcut key operation, where the target control is used to represent the instruction corresponding to the shortcut key operation.
2. The shortcut key operation control method according to claim 1, wherein The controlling the third-party application to forcibly execute the instruction corresponding to the shortcut key operation based on the target control in the display interface of the third-party application includes: Determining an associated control having a preset association relationship with the target control based on the target control; Performing a virtual click operation on the associated control to control the third-party application to forcibly execute the instruction corresponding to the shortcut key operation.
3. The shortcut key operation control method according to claim 2, characterized in that The determining an associated control having a preset association relationship with the target control based on the target control includes: Searching for the target control in the display interface of the third-party application, where the target control includes at least one of a text control and an image control; Searching for an associated control having a preset association relationship with the target control, where the associated control is a control with a click attribute in a clickable state.
4. The shortcut key operation control method according to claim 3, wherein The searching for an associated control having a preset association relationship with the target control includes: Searching for an upper-layer control of the target control based on a control group in the display interface of the third-party application; Using a control with a click attribute in a clickable state in the upper-layer controls as the associated control.
5. The shortcut key operation control method according to claim 3, wherein The shortcut key operation control method further includes: Obtaining the number of preset controls in the display interface of the third-party application; If the number of the preset controls meets a preset condition, searching for the target control in the display interface of the third-party application.
6. The shortcut key operation control method according to any one of claims 1 to 5, characterized in that The shortcut key operation control method further includes: If the execution result indicates that the third-party application has executed the instruction corresponding to the shortcut key operation, determining whether the third-party application has executed a first preset operation associated with the shortcut key operation within a preset duration; If the third-party application does not execute the first preset operation, controlling the third-party application to forcibly execute the instruction corresponding to the shortcut key operation.
7. The shortcut key operation control method according to claim 6, characterized in that, When the shortcut key operation includes any one of a copy operation and a cut operation, the first preset operation includes writing target content to a clipboard.
8. The shortcut key operation control method according to any one of claims 1 to 5, characterized in that The obtaining the execution result of the third-party application for the shortcut key operation includes: Listening to a process of the third-party application executing the instruction corresponding to the shortcut key operation; Determining the execution result according to the listening result.
9. A shortcut key operation control device, characterized in that, A mobile terminal applied to connect an external input device, and the shortcut key operation control device includes: A receiving module, configured to receive a shortcut key operation input by the external input device when a third-party application is in the foreground running state; An acquisition module, configured to acquire an execution result of the third-party application for the shortcut key operation; A control module, configured to, if the execution result indicates that the third-party application does not execute an instruction corresponding to the shortcut key operation, based on a target control in a display interface of the third-party application, control the third-party application to compulsorily execute the instruction corresponding to the shortcut key operation, where the target control is used to represent the instruction corresponding to the shortcut key operation.
10. An electronic device, characterized in that, Comprising: A processor; A memory for storing processor-executable instructions; Wherein, the processor is configured to execute the shortcut key operation control method according to any one of claims 1-8.
11. A non-transitory computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the shortcut key operation control method according to any one of claims 1-8.