Response processing method, electronic device and storage medium
By displaying the cursor on the first window and monitoring the mouse event, the response problem caused by the new window grabbing focus is solved, ensuring that the window can still handle mouse operation events under the new display, improving the reliability of response processing.
Patent Information
- Application Number
- CN202310947660.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-29
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2043-07-29
AI Technical Summary
In the prior art, the newly displayed window grabs focus and causes the problem of the current window not responding, affecting the fluency and efficiency of user operations.
By displaying the cursor on the first window and monitoring the mouse pressing and releasing events, we can determine whether the cursor is on the first object, ensuring that when the second window is newly displayed, the first window can continue to process the mouse operation event and regain focus. .
Improve the reliability of response processing, ensuring that the current window can still handle mouse operation events smoothly when the newly displayed window appears, and solves the response problem caused by focus grabbing.
Smart Images

Figure CN117707395B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a response processing method, an electronic device and a storage medium. Background Art
[0002] When a user uses an electronic device (such as a terminal), the electronic device will display relevant content for the user in the form of a window so that the user can perform relevant operations or view relevant content in the window. For example, when a user uses an input device (such as a mouse device) to perform relevant operations (such as a click operation) on the window displayed by the electronic device, the window will trigger a corresponding response. Summary of the invention
[0003] The present application provides a response processing method, an electronic device and a storage medium, which are used to solve the problem that a current window becomes unresponsive due to a newly displayed window grabbing the focus.
[0004] In order to achieve the above objectives, this application adopts the following technical solutions:
[0005] In a first aspect, a response processing method is provided, which is applied to an electronic device, and the method includes:
[0006] The electronic device displays a first window, and displays a cursor on a first object in the first window;
[0007] The electronic device receives a mouse press event from an input device of the electronic device;
[0008] The electronic device displays a second window, and the focus is occupied by the second window, and the electronic device receives a mouse release event from an input device of the electronic device;
[0009] When the cursor is displayed on the first object, the electronic device responds to the operation of the first object based on the mouse press event and the mouse release event.
[0010] In the above technical solution, after displaying a cursor on the first object of the first window and receiving a mouse press event from the input device of the electronic device, if a new second window is displayed and the focus is occupied by the second window, after receiving a mouse release event from the input device of the electronic device, it can be determined whether to respond to the operation of the first object in the first window by judging whether the cursor is displayed on the first object. Furthermore, in the case where the cursor is displayed on the first object, based on the mouse press event and the mouse release event, the operation of the first object is responded to, and the mouse operation event can be smoothly responded to in the first window. In this way, by setting the judgment condition of the above cursor position, it can be determined whether the current first window needs to process the mouse operation event. Furthermore, in the case where the second window is newly displayed, the current first window that needs to process the mouse operation event continues to respond, which can solve the problem that the current window does not respond due to the newly displayed window grabbing the focus, and improve the reliability of the response processing.
[0011] In a possible implementation of the first aspect, the electronic device includes an event monitor, and the event monitor is used to monitor a mouse press event and a mouse release event of an input device of the electronic device;
[0012] The method further includes:
[0013] The event monitor sends the mouse press event and the mouse release event to the process corresponding to the first window.
[0014] In this possible implementation, a method for obtaining the current mouse operation event for the first window is provided. Among them, when a mouse press event is received from the input device of the electronic device, the mouse press event needs to be sent to the process corresponding to the first window, so that the process corresponding to the first window can subsequently process based on the received mouse press event. In the case of a newly displayed second window, when a mouse release event is received from the input device of the electronic device, the mouse release event needs to be sent to the process corresponding to the first window, so that the process corresponding to the first window can subsequently process based on the received mouse release event. In this way, it can be ensured that the current mouse operation event is responded to smoothly in the first window, and the reliability of the response processing is improved.
[0015] In another possible implementation of the first aspect, the event monitor sends the mouse press event and the mouse release event to a process corresponding to the first window, including:
[0016] In the case that the mouse-press event and the mouse-release event belong to preset mouse events, the event monitor sends the mouse-press event and the mouse-release event to the process corresponding to the first window.
[0017] In this possible implementation, a method for triggering the sending of the current mouse operation event based on a preset mouse event is provided. Among them, when a mouse press event is received from the input device of the electronic device, by judging whether the mouse press event belongs to the preset mouse event, it is ensured that the mouse press event is sent to the process corresponding to the first window when the mouse press event belongs to the preset mouse event. In the case of a newly displayed second window, when a mouse release event is received from the input device of the electronic device, by judging whether the mouse release event belongs to the preset mouse event, it is ensured that the mouse release event is sent to the process corresponding to the first window when the mouse release event belongs to the preset mouse event. In this way, it can be ensured that the current mouse operation event is responded to smoothly in the first window, and the reliability of the response processing is improved.
[0018] In another possible implementation manner of the first aspect, after the event monitor sends the mouse release event to the process corresponding to the first window, the method further includes:
[0019] The focus is switched from the second window to the first window.
[0020] In this possible implementation, when the second window is newly displayed, the focus can be switched back to the first window by continuing to send the mouse release event to the process corresponding to the first window, thereby solving the problem of the current window becoming unresponsive due to the newly displayed window grabbing the focus, and improving the reliability of the response processing.
[0021] In another possible implementation manner of the first aspect, after the electronic device receives a mouse release event from an input device of the electronic device, the method further includes:
[0022] The event monitor obtains a position detection result of the cursor, where the position detection result is used to indicate whether the cursor is displayed on the first object.
[0023] In this possible implementation, a method for obtaining a cursor position detection result is provided, which can quickly and accurately determine whether the cursor is displayed on the first object.
[0024] In another possible implementation manner of the first aspect, the mouse press event includes a first position in the display screen corresponding to when the mouse is pressed, and the mouse release event includes a second position in the display screen corresponding to when the mouse is released;
[0025] The electronic device responds to the operation of the first object based on the mouse pressing event and the mouse releasing event, including:
[0026] When the first position and the second position are both located within the first window, the electronic device responds to the operation of the first object within the first window.
[0027] In this possible implementation, by judging whether the first position corresponding to the mouse press event and the second position corresponding to the mouse release event in this mouse operation event are both located within the first window, it is judged whether the mouse press event and the mouse release event belong to the same mouse operation event, thereby ensuring that a response is made to the same mouse operation event, avoiding the problem of abnormal response, and improving the reliability of response processing.
[0028] In another possible implementation manner of the first aspect, the first window is a window including a target control;
[0029] When both the first position and the second position are located within the first window, the electronic device responds to the operation of the first object within the first window, including:
[0030] When the first position and the second position are both located in the first window, the electronic device switches the display state of the target control from the first state to the second state in the first window.
[0031] In this possible implementation, a response processing scheme is provided using a control window as an example. When a second window is newly displayed, the control window that needs to process the current mouse operation event can continue to respond, that is, the display state of the target control is switched from the first state to the second state, thereby improving the reliability of the response processing.
[0032] In another possible implementation manner of the first aspect, the first window is a window including text content;
[0033] When both the first position and the second position are located within the first window, the electronic device responds to the operation of the first object within the first window, including:
[0034] In a case where both the first position and the second position are located within the first window, the electronic device displays a third window within the first window, and the third window includes at least one function control related to the text content.
[0035] In this possible implementation, a response processing scheme is provided using a text window as an example. When a second window is newly displayed, the text window that needs to process the current mouse operation event can continue to respond, that is, a third window including at least one functional control is displayed, thereby improving the reliability of the response processing.
[0036] In a second aspect, the present application provides an electronic device, comprising: a display screen, a memory and a processor. The display screen is used to provide a display function. The memory is used to store program codes, and the processor is used to call the program codes stored in the memory, so as to implement any one of the methods provided in the first aspect.
[0037] According to a third aspect, a computer-readable storage medium is provided, comprising a program code. When the program code is executed on an electronic device, the electronic device executes any one of the methods provided in the first aspect.
[0038] According to a fourth aspect, a computer program product is provided, including a program code. When the program code is executed on an electronic device, the electronic device executes any one of the methods provided in the first aspect.
[0039] It should be noted that the technical effects brought about by any implementation method in the second to fourth aspects can refer to the technical effects brought about by the corresponding implementation method in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A schematic diagram of an electronic device provided in an embodiment of the present application;
[0041] Figure 2 A schematic diagram of a display screen of an electronic device provided in an embodiment of the present application;
[0042] Figure 3 A schematic diagram of a display screen of an electronic device provided in an embodiment of the present application;
[0043] Figure 4 A schematic diagram of a display screen of an electronic device provided in an embodiment of the present application;
[0044] Figure 5 A schematic diagram of a display screen of an electronic device provided in an embodiment of the present application;
[0045] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0046] Figure 7 A schematic diagram of the software structure of an electronic device provided in an embodiment of the present application;
[0047] Figure 8 A flowchart of a response processing method provided in an embodiment of the present application;
[0048] Fig. 9 A schematic diagram of the architecture of a response processing method provided in an embodiment of the present application;
[0049] Fig.10An architectural interaction diagram of a response processing method provided in an embodiment of the present application;
[0050] Fig.11 A structural block diagram of a response processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] In the description of this application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, "at least one" means one or more, and "plurality" means two or more. The words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not limit them to be different.
[0052] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0053] In some embodiments, the response processing method provided in the embodiments of the present application can be applied to Figure 1 The electronic device 100 shown is exemplary. Figure 1 A schematic diagram of an electronic device provided in an embodiment of the present application.
[0054] The electronic device 100 may be a terminal device. For example, the electronic device 100 may be at least one of a smart phone, a smart watch, a desktop computer, a laptop computer, a virtual reality terminal, an augmented reality terminal, a wireless terminal, and a laptop computer.
[0055] In the embodiment of the present application, the electronic device 100 may be connected to an input device 101. Exemplarily, the input device 101 may be a mouse device, a touch pad, a stylus pen, etc. For example, the electronic device 100 may be connected to the input device 101 in a wired or wireless manner.
[0056] In some embodiments, the electronic device 100 is provided with a function of triggering a window response based on the input device 101. For example, see Figure 1When the user uses the electronic device 100, the electronic device 100 will display relevant content for the user in the form of a window, so that the user can perform relevant operations or view relevant content in the window. Furthermore, when the user uses the input device 101 to perform relevant operations (such as clicking operations) on the window displayed by the electronic device 100, the window will trigger a corresponding response.
[0057] The response processing method provided in the embodiment of the present application can be applied to the response scenario of the window displayed by the electronic device 100.
[0058] The window may be an application window, that is, a window related to application display. For example, an application window may be divided into an application main window and an application sub-window. The application main window is used to display an application interface, such as an interface including text content. The application sub-window is used to display an application pop-up window, such as a floating window or other auxiliary window.
[0059] For example, taking a text application (such as a wps application, a word application, an excel application, a ppt application or a txt application) as an example, the window may be the main application window of the text application, that is, the window for displaying text content. Alternatively, the window may also be an application subwindow of the text application, such as the window where the function control is located.
[0060] For example, taking a social application (such as a chat application) as an example, the window may be the main application window of the social application, that is, the window for displaying the conversation content. Alternatively, the window may also be an application subwindow of the social application, such as the window where the function control is located.
[0061] For example, taking the mail application as an example, the window may be the main application window of the mail application, that is, the window for displaying the mail content. Alternatively, the window may also be the application sub-window of the mail application, such as the window where the function control is located.
[0062] To simplify the description, a window including text content may be referred to as a text window, a window including a function control may be referred to as a control window, a window including conversation content may be referred to as a conversation window, and a window including mail content may be referred to as a mail window.
[0063] The following is an example of a word-picking application provided by an electronic device to illustrate the solution. The word-picking application is used for text word-picking or picture word-picking. The following is an introduction to the word-picking application.
[0064] The computer manager application, side shortcut bar or other location provided by the electronic device can provide an entrance to the word retrieval application. For example, taking the entrance in the computer manager application as an example, Figure 2A schematic diagram of a display screen of an electronic device provided in an embodiment of the present application. After receiving the user's operation to open the computer manager application, the electronic device Figure 2 In response, the electronic device may display a computer manager interface 201. The computer manager interface 201 includes various functional controls, such as a word retrieval control 202. It should be understood that the word retrieval control 202 is also the entrance to the above-mentioned word retrieval application.
[0065] The user can start the word retrieval application by performing a trigger operation on the entrance of the word retrieval application. Figure 3 A schematic diagram of a display screen of an electronic device provided in an embodiment of the present application. After receiving a trigger operation of the user on the entry of the word retrieval application, the electronic device Figure 3 In response, the electronic device may display at least one functional control of the word-taking application. For example, the at least one functional control may include a copy all control 301, a translate all control 302, a read all control 303, a favorite all control 304, and a screenshot word-taking control 305. Among them, the copy all control 301 is used to copy all the selected text contents. The translate all control 302 is used to translate all the selected text contents. The read all control 303 is used to read all the selected text contents. The favorite all control 304 is used to favorite all the selected text contents. The screenshot word-taking control 305 is used to trigger screenshots and perform image recognition on the images obtained by the screenshots to obtain text content. It should be understood that the electronic device displays at least one of the above functional controls, which means that the word-taking application is turned on at this time.
[0066] In some embodiments, taking the text word retrieval scenario as an example, the electronic device may display a text window including text content. For example, the text window may be a window of a wps application, a window of a word application, a window of an excel application, a window of a ppt application, or a window of a txt application, etc. After the word retrieval application is turned on, the user may use an input device (such as a mouse device) to implement a sliding word retrieval operation in the text window (i.e., pressing the left button of the mouse device and moving the mouse device, and releasing the left button of the mouse after selecting the desired text), and the electronic device responds to the sliding word retrieval operation and displays a function window for text word retrieval. Among them, the function window may include at least one function control, such as a copy control, a translation control, a search control, a jump control, a read control, a collection control, and the like.
[0067] For example, Figure 4 A schematic diagram of a display screen of an electronic device provided in an embodiment of the present application. Figure 4 After receiving the user's sliding operation in the text window, the electronic device Figure 4In response, the electronic device may display a text word extraction function window 401. The text word extraction function window 401 includes various function controls, such as a copy control 402, a translation control 403, a search control 404, a jump control 405, a read aloud control 406, and a collection control 407.
[0068] In other embodiments, taking the picture word-taking scenario as an example, the electronic device may display a window 1 (which may be referred to as a picture window) including a picture, and the picture includes text. At this time, the user may use an input device (such as a mouse device) to click the screenshot word-taking control. Here, the component including the screenshot word-taking control may also be referred to as a window. Then, the user uses the mouse device to click the screenshot word-taking control, which may also be understood as the user uses the mouse device to implement a click operation in the window 2 including the screenshot word-taking control (i.e., pressing the left button of the mouse device and releasing the left button of the mouse device). In response to the click operation, the electronic device switches the display state of the screenshot word-taking control from state 1 to state 2 in the window 2. Among them, state 1 is used to indicate that the screenshot word-taking control has not been triggered, and state 2 is used to indicate that the screenshot word-taking control has been triggered, such as state 1 is gray and state 2 is blue. In addition, in response to the click operation, the electronic device takes a screenshot of the content displayed on the display screen of the electronic device and performs image recognition on the image obtained by the screenshot to obtain text. Furthermore, the electronic device displays the text obtained by image recognition on the above-mentioned window 1. In addition, the text is in an optional state (such as a grayed-out state, i.e., the text background is gray). Afterwards, the user can use a mouse device to perform a sliding word-picking operation in the displayed text, and the electronic device responds to the sliding word-picking operation and displays a text word-picking function window.
[0069] For example, Figure 5 A schematic diagram of a display screen of an electronic device provided in an embodiment of the present application. Figure 5 , the above-mentioned window 1 including the picture can be Figure 5 The window 501 shown. The window 2 including the screenshot word acquisition control may be Figure 5 The electronic device displays the text 503 obtained by image recognition in window 501. After receiving the user's click operation in window 502, the electronic device can, in response, switch the display state of the screenshot word retrieval control from gray to blue in window 502, and take a screenshot of the content displayed on the display screen of the electronic device and perform image recognition on the screenshot image to obtain text. Figure 5 In response, the electronic device may display a text word extraction function window 504. The function window 504 is the same as the above-mentioned function window 401 and will not be described in detail.
[0070] It should be understood that for the text word extraction scenario, since the text window itself supports sliding to select text, there is no need to use the screenshot word extraction control of the word extraction application, and text word extraction can be performed directly. In the picture word extraction scenario, since the picture window does not support sliding to select text, it is necessary to use the screenshot word extraction control of the word extraction application, first take a screenshot and then perform image recognition on the image obtained by the screenshot to obtain text, thereby completing text word extraction. Of course, in some embodiments, in the text word extraction scenario, by triggering the screenshot word extraction control of the word extraction application, taking a screenshot of the display screen and performing image recognition on the image obtained by the screenshot to obtain text, text word extraction can also be achieved.
[0071] Currently, if a new window is displayed when a user uses an input device (such as a mouse device) to perform related operations, the current window will become unresponsive because the new window grabs the focus.
[0072] For example, taking the above-mentioned word-capturing application as an example, when clicking the screenshot word-capturing control, if a new window is displayed, the focus will be changed to the newly displayed window, causing the click of the screenshot word-capturing control to be unresponsive. For another example, taking the text window as an example, when sliding the word in the text window, if a new window is displayed, the focus will be changed to the newly displayed window, causing the sliding word-capturing to be unresponsive.
[0073] In some embodiments, the response processing method provided in the embodiments of the present application can be applied to the response scenarios of the windows involved in the above-mentioned word-taking application, such as text windows, picture windows (including optional text), windows where all controls are copied, windows where all controls are translated, windows where all controls are read aloud, windows where all controls are collected, windows including screenshot word-taking controls, etc. It should be understood that here, similar to the window including the screenshot word-taking control, the component including the copy all controls can also be referred to as a window, the component including the translate all controls can also be referred to as a window, the component including the read all controls can also be referred to as a window, and the component including the collection all controls can also be referred to as a window.
[0074] It should be noted that the word retrieval application can be a program plug-in attached to the text application, and runs when the text application is opened. Alternatively, the word retrieval application can also be a word retrieval application that runs independently of the text application, such as MagicText AI, etc. The embodiment of the present application does not limit the word retrieval application.
[0075] In view of this, the embodiment of the present application provides a response processing method. After displaying a cursor on the first object of the first window and receiving a mouse press event from the input device of the electronic device, if a second window is newly displayed and the focus is occupied by the second window, after receiving a mouse release event from the input device of the electronic device, it can be determined whether to respond to the operation of the first object in the first window by judging whether the cursor is displayed on the first object. Furthermore, in the case where the cursor is displayed on the first object, based on the mouse press event and the mouse release event, the operation of the first object is responded to, so that the mouse operation event can be smoothly responded to in the first window later. In this way, by setting the judgment condition of the above cursor position, it can be determined whether the current first window needs to process the mouse operation event. Furthermore, in the case where the second window is newly displayed, the current first window that needs to process the mouse operation event continues to respond, which can solve the problem that the current window does not respond due to the newly displayed window grabbing the focus, and improve the reliability of the response processing.
[0076] It is understandable that after the electronic device is connected to the input device (such as a mouse device), a cursor (or mouse pointer) can be displayed on the display screen of the electronic device to prompt the user that the input device has been successfully connected. In an embodiment of the present application, the electronic device is used to display a first window, display a cursor on a first object in the first window; receive a mouse press event from the input device of the electronic device; display a second window, and the focus is occupied by the second window, and receive a mouse release event from the input device of the electronic device; when the cursor is displayed on the first object, based on the mouse press event and the mouse release event, respond to the operation of the first object.
[0077] For example, Figure 1 The structural diagram of the electronic device 100 is shown in FIG. Figure 6 shown. Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
[0078] See also Figure 6 The electronic device 100 may include a processor 610, an external memory interface 620, an internal memory 621, a universal serial bus (USB) interface 630, a charging management module 640, a power management module 641, a battery 642, an antenna 1, an antenna 2, a mobile communication module 650, a wireless communication module 660, an audio module 670, a sensor module 680, a button 690, and a display screen 691. The sensor module 680 may include a pressure sensor 680A, a touch sensor 680B, and the like.
[0079] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0080] The processor 610 may include one or more processing units, for example, the processor 610 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0081] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0082] The processor 610 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 610 is a cache memory. The memory may store instructions or data that the processor 610 has just used or cyclically used. If the processor 610 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 610, and thus improves the efficiency of the system.
[0083] In some embodiments, the processor 610 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a USB interface 603, etc.
[0084] The USB interface 630 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 630 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and peripheral devices. For example, the USB interface 630 can be used to connect an input device, such as a mouse device. For another example, the USB interface 630 can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.
[0085] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0086] The charging management module 640 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 640 may receive charging input from a wired charger through the USB interface 630. In some wireless charging embodiments, the charging management module 640 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 640 is charging the battery 642, it may also power the electronic device through the power management module 641.
[0087] The power management module 641 is used to connect the battery 642, the charging management module 640 and the processor 610. The power management module 641 receives input from the battery 642 and / or the charging management module 640, and supplies power to the processor 610, the internal memory 621, the external memory, the display screen 691 and the wireless communication module 660. The power management module 641 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 641 can also be set in the processor 610. In other embodiments, the power management module 641 and the charging management module 640 can also be set in the same device.
[0088] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 650, the wireless communication module 660, the modem processor, the baseband processor, and the like.
[0089] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0090] The mobile communication module 650 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 650 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 650 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 650 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 650 can be set in the processor 610. In some embodiments, at least some of the functional modules of the mobile communication module 650 can be set in the same device as at least some of the modules of the processor 610.
[0091] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker, a receiver, etc.), or displays an image or video through a display screen 691. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 610 and be set in the same device as the mobile communication module 650 or other functional modules.
[0092] The wireless communication module 660 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (bluetoo2, BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR), etc. applied to the electronic device 100. The wireless communication module 660 can be one or more devices integrating at least one communication processing module. The wireless communication module 660 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and filters it, and sends the processed signal to the processor 610. The wireless communication module 660 can also receive the signal to be sent from the processor 610, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2. In some embodiments, the electronic device 100 can connect to an input device, such as a mouse device, through the Bluetooth in the wireless communication module 660.
[0093] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 650, and antenna 2 is coupled to wireless communication module 660, so that electronic device 100 can communicate with the network and other devices through wireless communication technology.
[0094] The electronic device 100 implements the display function through a GPU, a display screen 691, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 691 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 610 may include one or more GPUs that execute program instructions to generate or change display information.
[0095] The display screen 691 is used to display images, videos, etc. The display screen 691 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 691, where N is a positive integer greater than 1.
[0096] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0097] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0098] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0099] The external memory interface 620 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 610 through the external memory interface 620 to implement a data storage function, such as storing files such as music and videos in the external memory card.
[0100] The internal memory 621 can be used to store computer executable program codes, which include instructions. The processor 610 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 621. The internal memory 621 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 621 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0101] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 670 and the application processor.
[0102] The audio module 670 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal. The audio module 670 can also be used to encode and decode audio signals. In some embodiments, the audio module 670 can be arranged in the processor 610, or some functional modules of the audio module 670 can be arranged in the processor 610.
[0103] The pressure sensor 680A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 680A can be set on the display screen 691. There are many types of pressure sensors 680A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 680A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 691, the electronic device 100 detects the touch operation intensity according to the pressure sensor 680A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 680A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
[0104] The touch sensor 680B is also called a "touch panel". The touch sensor 680B can be arranged on the display screen 691, and the touch sensor 680B and the display screen 691 form a touch screen, also called a "touch screen". The touch sensor 680B is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 691. In other embodiments, the touch sensor 680B can also be arranged on the surface of the electronic device 100, which is different from the position of the display screen 691.
[0105] It should be pointed out that Figure 6 The structure shown in the figure does not constitute a limitation on the electronic device, except Figure 6 In addition to the components shown, the electronic device may include more or fewer components than shown, or combine certain components, or arrange the components differently.
[0106] The software system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. In some embodiments, the software structure of the embodiment of the present application may be a structure based on an Android system or a structure based on a Window system. The embodiment of the present application takes the Window system of a layered architecture as an example to illustrate the software structure of the electronic device. For example, Figure 7 A schematic diagram of the software structure of an electronic device provided in an embodiment of the present application.
[0107] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Windows system can be divided into an application layer, a middle layer, a system layer, and a hardware driver layer.
[0108] The application layer is also the application program layer. In the embodiment of the present application, the application layer is used to receive and record the mouse operation event, and then respond to the mouse operation event based on the mouse operation event.
[0109] like Figure 7 As shown, the application layer may include a series of application packages. For example, the application package may include computer housekeeper application, wps application, word application, txt application, excel application, ppt application, word retrieval application, music application, video application, social application and other applications.
[0110] In some embodiments, the electronic device displays the relevant content of the above application in the form of a window, so that the user can perform relevant operations or view relevant content in the window.
[0111] like Figure 7As shown, the middle layer may include an event monitor, which is used to monitor all types of mouse operation events in the system of the electronic device. In some embodiments, the event monitor may be a global hook function.
[0112] Exemplarily, the mouse operation event may include a mouse press event and a mouse release event, such as a mouse press event may include a mouse left button press event, a mouse right button press event, a mouse wheel press event, etc. Further, the mouse press event may include a mouse press move event, such as a mouse left button press move event, a mouse right button press move event, a mouse wheel press move event, etc. The mouse release event may include a mouse left button release event, a mouse right button release event, a mouse wheel release event, etc.
[0113] In the embodiment of the present application, the middle layer is used to determine whether the mouse operation event belongs to the preset mouse event, and then, if the mouse operation event belongs to the preset mouse event, send the mouse operation event to the process corresponding to the first window of the application layer. For example, determine whether the mouse press event belongs to the preset mouse event, and then, if the mouse press event belongs to the preset mouse event, send the mouse press event to the process corresponding to the first window of the application layer, and determine whether the mouse release event belongs to the preset mouse event, and then, if the mouse release event belongs to the preset mouse event, obtain the cursor position detection result, and if the cursor position detection result indicates that the cursor is displayed on the first object of the first window, send the mouse release event to the process corresponding to the first window of the application layer.
[0114] The system layer is responsible for basic data collection, daily business processing, management and monitoring, etc. Figure 7 As shown, the system layer may include a Window system. In the embodiment of the present application, the system layer is used to detect mouse operation events and send the mouse operation events to the event monitor of the middle layer.
[0115] In some embodiments, a mouse operation event may include a mouse button flag (used to indicate whether the user has performed an operation on the mouse device, such as pressing, lifting, moving, or scrolling the mouse wheel), coordinate information (when the user moves the mouse device, used to indicate the X-coordinate and Y-coordinate of the movement of the mouse device), scroll wheel information (when the user operates the scroll wheel of the mouse device, used to indicate the X-axis distance and Y-axis distance of the scroll wheel), and key position information (used to indicate which of the left, middle, or right buttons of the mouse device the user has operated).
[0116] like Figure 7As shown, the hardware driver layer is a layer between hardware and software. In some embodiments, the hardware driver layer at least includes a mouse driver, a keyboard driver, a display driver, a camera driver, an audio driver, a sensor driver, etc. In the embodiment of the present application, the hardware driver layer is used to connect the input device to the electronic device.
[0117] In the embodiment of the present application, the electronic device can complete the function of triggering a window response based on an input device through the mutual cooperation among the above-mentioned application layer, middle layer, system layer and hardware driver layer.
[0118] Figure 8 A flow chart of a response processing method provided in an embodiment of the present application. Figure 8 , with the electronic device as the execution subject, the method includes the following S801-S807:
[0119] S801: The electronic device displays a first window, and displays a cursor on a first object in the first window.
[0120] In the embodiment of the present application, the first window is used to refer to the window to be triggered by the user among the windows currently displayed by the electronic device.
[0121] In some embodiments, the first window may be a control window, a text window, a picture window, a conversation window, an email window, etc. For example, the control window may be a window where functional controls such as an opening control, a viewing control, and a full-screen control are located. The text window may be a window of a word application, a window of a wps application, a window of an excel application, a window of a ppt application, or a window of a txt application, etc. The embodiments of the present application will be described later using the control window and the text window as examples.
[0122] The first object refers to the object to be operated included in the first window. Taking the first window as a control window as an example, the first object is also the function control included in the control window. Taking the first window as a text window as an example, the first object is also the text content included in the text window.
[0123] For example, Figure 8 As shown in S801, taking the first window as a window including a screenshot word retrieval control in a word retrieval application as an example, the first object is also the screenshot word retrieval control. At this time, the cursor is displayed on the screenshot word retrieval control.
[0124] S802: The electronic device receives a mouse press event from an input device of the electronic device.
[0125] The mouse down event is also a down event of the input device. It should be understood that the mouse down event is also an event based on the mouse down operation.
[0126] In some embodiments, the mouse press event may be a mouse left button press event, a mouse right button press event, or a mouse wheel press event, etc. Further, the mouse press event may also be a mouse press move event, that is, an event in which a mouse button (such as a left button, a right button, or a mouse wheel) is pressed and then the mouse moves. For example, the operation of moving left or right after pressing a mouse button, or the operation of moving up or down after pressing a mouse button, etc.
[0127] The mouse press event may include a mouse button flag (pressed), key position information (such as the left button), and the first position in the display screen corresponding to the mouse press. The first position is also the position coordinate in the display screen corresponding to the mouse press.
[0128] The mouse button flag can be represented by a name, a number, or an identity document (ID). The key position information can also be represented by a name, a number, or an identity document (ID). The first position can be represented by two-dimensional coordinates (such as X coordinates and Y coordinates).
[0129] In some embodiments, the electronic device includes a system layer. If a user performs a mouse-pressing operation on an input device, the electronic device can detect the mouse-pressing operation of the input device through the system layer and receive a mouse-pressing event from the input device.
[0130] In some embodiments, the electronic device further comprises an intermediate layer, the intermediate layer comprising an event monitor, the event monitor being used to monitor mouse press events and mouse release events of an input device of the electronic device. Further, in some embodiments, after receiving the mouse press event from the input device, the system layer also sends the mouse press event to the event monitor, so that the event monitor can perform subsequent response processing.
[0131] S803: The event monitor in the electronic device sends the mouse press event to the process corresponding to the first window.
[0132] After the event monitor sends the mouse press event to the process corresponding to the first window, the process corresponding to the first window receives and records the mouse press event.
[0133] Thus, a method for obtaining the current mouse operation event for the first window is provided. When a mouse press event is received from the input device of the electronic device, the mouse press event needs to be sent to the process corresponding to the first window, so that the process corresponding to the first window can subsequently process based on the received mouse press event, so that the first window can subsequently respond to the current mouse operation event smoothly, thereby improving the reliability of the response processing.
[0134] In some embodiments, before sending the mouse press event to the first window, the event monitor further determines whether the mouse press event belongs to a preset mouse event based on the preset mouse event. Furthermore, if the mouse press event belongs to the preset mouse event, the event monitor sends the mouse press event to the process corresponding to the first window.
[0135] The preset mouse event may be a mouse operation event supported by the first window in advance. For example, a left mouse button press event, a left mouse button release event, a mouse wheel press event, a mouse wheel release event, a left mouse button press and move event, and a mouse wheel press and move event. Alternatively, in the embodiment of the mouse press event, the preset mouse event may also be a mouse button press event supported by the first window in advance. For example, a left mouse button press event, a mouse wheel press event, a left mouse button press and move event, and a mouse wheel press and move event.
[0136] Thus, a method for triggering the sending of the current mouse operation event based on a preset mouse event is provided. When a mouse press event is received from an input device of the electronic device, by determining whether the mouse press event belongs to a preset mouse event, it is ensured that the mouse press event is sent to the process corresponding to the first window if the mouse press event belongs to the preset mouse event, so that a subsequent response to the current mouse operation event is successfully made in the first window, thereby improving the reliability of the response processing.
[0137] In an embodiment of the present application, by setting up an event monitor, all types of mouse operation events in the system can be monitored, and then, for mouse operation events that belong to preset mouse events, the subsequent process of sending the mouse operation events is executed to ensure that the mouse operation event proceeds smoothly.
[0138] S804: The electronic device displays a second window, and the focus is occupied by the second window. The electronic device receives a mouse release event from an input device of the electronic device.
[0139] In the embodiment of the present application, the second window is used to refer to any newly displayed window. In some embodiments, the second window can be an alarm window (i.e., a window including alarm information), a prompt window (i.e., a window including prompt information), a session window (i.e., a window including session information), etc. It should be noted that the first window and the second window can belong to the same window application or different window applications.
[0140] In some embodiments, after the electronic device displays the second window, the process corresponding to the second window automatically occupies the focus.
[0141] The mouse release event is also the up event of the input device. It should be understood that the mouse release event is also the event based on the mouse release operation. In certain embodiments, the mouse release event can be a mouse left button release event, a mouse right button release event or a mouse wheel release event, etc.
[0142] The mouse release event may include a mouse button flag (lifted), key position information (such as left button), and a second position of the display screen corresponding to the mouse release. The second position is the position coordinates of the display screen corresponding to the mouse release. The second position may be represented by two-dimensional coordinates.
[0143] In some embodiments, the electronic device includes a system layer. If the user performs a mouse release operation on the input device, the electronic device can detect the mouse release operation of the input device through the system layer and receive a mouse release event from the input device.
[0144] Furthermore, in some embodiments, after receiving the mouse release event from the input device, the system layer also sends the mouse release event to the event monitor so that the event monitor can perform subsequent response processing.
[0145] S805: The event monitor in the electronic device obtains a position detection result of the cursor, where the position detection result is used to indicate whether the cursor is displayed on the first object.
[0146] Among them, whether the cursor is displayed on the first object refers to whether the cursor is displayed in a preset area of the first object. For example, the preset area may be an area within a preset distance from the center point of the first object, or the preset area may be a rectangular frame area where the first object is located. It should be understood that if the cursor is displayed in an area near the first object, it means that the cursor is displayed on the first object.
[0147] In some embodiments, the event monitor obtains the cursor position detection result from a preset function, wherein the preset function is used to detect the cursor position to determine whether the cursor is displayed on the first object.
[0148] In some embodiments, the process of obtaining the cursor position detection result through a preset function may be: obtaining the cursor position and the rectangular frame position of the first object, and then determining the cursor position detection result based on the cursor position and the rectangular frame position.
[0149] Exemplarily, the preset function may include a Get Cursor Pos() function, which is used to obtain the cursor position. The preset function may also include a Get Window Rect() function, which is used to obtain the rectangular frame position of the first object. The preset function may also include a Pt In Rect(pt, rect) function, which is used to compare the cursor position with the rectangular frame position to determine whether the cursor is displayed on the first object. Furthermore, the Pt In Rect(pt, rect) function may be used to determine whether the cursor is located within the rectangular frame position, thereby obtaining the cursor position detection result.
[0150] It should be noted that, in some embodiments, the cursor position detection result can be actively returned to the event monitor through the Pt In Rect (pt, rect) function, so that the event monitor can execute the subsequent process of sending the mouse release event to the process corresponding to the first window.
[0151] In the above embodiment, a method for obtaining a cursor position detection result is provided, wherein by comparing the relationship between the cursor position and the rectangular frame position of the first object, it is possible to quickly and accurately determine whether the cursor is displayed on the first object, thereby obtaining the cursor position detection result.
[0152] S806: When the cursor is displayed on the first object, the event monitor sends the mouse release event to the process corresponding to the first window.
[0153] After the event monitor sends the mouse release event to the process corresponding to the first window, the process corresponding to the first window receives and records the mouse release event.
[0154] Thus, a method is provided for the first window to obtain the event information of the current mouse operation event. When the second window is newly displayed, upon receiving a mouse release event from the input device of the electronic device, the mouse release event needs to be sent to the process corresponding to the first window, so that the process corresponding to the first window can subsequently process based on the received mouse release event, so that the first window can subsequently respond to the current mouse operation event smoothly, thereby improving the reliability of the response processing.
[0155] In some embodiments, before sending the mouse release event to the first window, the event monitor further determines whether the mouse release event belongs to a preset mouse event based on the preset mouse event. Furthermore, if the mouse release event belongs to the preset mouse event, the event monitor sends the mouse release event to the process corresponding to the first window.
[0156] In the embodiment of the mouse release event, the preset mouse event may also be a mouse release event supported by the first window, for example, a mouse left button release operation, a mouse wheel release operation, and the like.
[0157] Thus, a method for triggering the sending of the current mouse operation event based on a preset mouse event is provided. When the second window is newly displayed, when a mouse release event from the input device of the electronic device is received, by determining whether the mouse release event belongs to the preset mouse event, it is ensured that the mouse release event is sent to the process corresponding to the first window if the mouse release event belongs to the preset mouse event, so that the mouse operation event can be responded to smoothly in the first window later, thereby improving the reliability of the response processing.
[0158] In the embodiments shown in S804 to S806 above, when the electronic device displays the second window in S804, the process corresponding to the second window automatically occupies the focus, that is, the focus is switched from the first window to the second window. Furthermore, after the mouse release event is sent to the process corresponding to the first window in S806, the process corresponding to the first window switches the focus from the second window to the first window. In this way, when the second window is newly displayed, the focus can be switched back to the first window by continuing to send the mouse release event to the process corresponding to the first window, thereby solving the problem of the current window not responding due to the newly displayed window grabbing the focus, and improving the reliability of the response processing.
[0159] In addition, in some embodiments, when the electronic device sends the mouse release event to the process corresponding to the first window, it may also send the mouse release event to the process corresponding to the newly displayed second window. It should be noted that the response priority of the first window is higher than the response priority of the newly displayed second window. For example, the mouse release event may be sent to the process corresponding to the first window first, and then to the process corresponding to the newly displayed second window. For another example, the first window may be controlled to respond to the mouse operation event first, and the newly displayed second window may respond to the mouse operation event later. For another example, the first window may be controlled to respond to the mouse operation event, and the newly displayed second window may not respond to the mouse operation event. It should be understood that the newly displayed second window does not respond under normal circumstances.
[0160] S807: The electronic device responds to the operation of the first object based on the mouse press event and the mouse release event.
[0161] In some embodiments, after the process corresponding to the first window receives the mouse press event and the mouse release event, the process responds to the operation of the first object in the first window based on the mouse press event and the mouse release event.
[0162] In some embodiments, taking the first position corresponding to the mouse press event and the second position corresponding to the mouse release event as examples, the electronic device determines whether the first position and the second position are both located within the first window. Furthermore, if the first position and the second position are both located within the first window, the electronic device responds to the operation of the first object within the first window.
[0163] In this embodiment, by judging whether the first position corresponding to the mouse press event and the second position corresponding to the mouse release event in this mouse operation event are both located within the first window, it is judged whether the mouse press event and the mouse release event belong to the same mouse operation event, so as to ensure that a response is made to the same mouse operation event, avoid the problem of abnormal response, and improve the reliability of response processing.
[0164] In some embodiments, taking the first window as an example of a window including a target control, correspondingly, the above S807 can be replaced as: when the first position and the second position are both located in the first window, the electronic device switches the display state of the target control from the first state to the second state in the first window.
[0165] For example, in the scenario of word retrieval application, the target control may be a copy all control, a translate all control, a read all control, a favorite all control, a screenshot word retrieval control, etc. Of course, in addition to the example controls shown above, other controls may also be set. The present application embodiment does not limit the setting of the target control.
[0166] The first state is used to indicate that the target control has not been triggered. The second state is used to indicate that the target control has been triggered. For example, the first state may be a gray state, and the second control may be a blue (or other color) state. For another example, the first state may be a stationary state, and the second control may be a shaking state. For another example, the first state may be a normal state, and the second control may be a highlighted state. Of course, in addition to the example states shown above, other states may also be set. The embodiments of the present application do not limit the setting of the display state.
[0167] Exemplarily, in the scenario of word retrieval application, taking the first window as a window including a screenshot word retrieval control as an example, the mouse press event is an event based on the mouse press operation. Accordingly, the above S807 can be replaced with: based on the mouse press event and the mouse release event, the display state of the screenshot word retrieval control is switched from a gray state to a blue state.
[0168] In the above embodiment, a response processing scheme is provided using a control window as an example, which enables the control window that needs to process the current mouse operation event to continue to respond when a second window is newly displayed, that is, the display state of the target control is switched from the first state to the second state, thereby improving the reliability of the response processing.
[0169] In other embodiments, taking the first window as a text window including text content as an example, the mouse press event is an event based on a mouse press and move operation, and accordingly, the above S807 can be replaced by: when the first position and the second position are both located in the first window, the electronic device displays a third window in the first window. The third window includes at least one functional control related to the text content.
[0170] Exemplarily, in the scenario of word retrieval application, the text window may be a text window displayed in a text word retrieval scenario, or a picture window including selectable text newly displayed in a picture word retrieval scenario.
[0171] In another exemplary embodiment, in the scenario of word retrieval application, the third window may be a function window of text word retrieval. The at least one function control included in the third window may include, for example, a copy control, a translation control, a search control, a jump control, a reading control, a collection control, etc.
[0172] In this embodiment, a response processing scheme is provided using a text window as an example, which enables the text window that needs to process the current mouse operation event to continue to respond when a second window is newly displayed, that is, to display a third window including at least one functional control, thereby improving the reliability of the response processing.
[0173] For example, taking the down event and up event based on the mouse device as an example, after a down event occurs in the current first window, if the focus is taken away by another newly displayed second window, when an up event occurs, the event monitor will still send the up event to the process corresponding to the current first window. Then, the process corresponding to the current first window determines whether the positions of the down event and the up event are both within the current first window, and if so, responds within the current first window.
[0174] In the following, when the word retrieval application is turned on, taking the first object as a screenshot word retrieval control as an example, and the first window as a window including the screenshot word retrieval control as an example, the response processing process of the window including the screenshot word retrieval control is exemplified.
[0175] In one example, taking the input device as a mouse device as an example, after the electronic device receives a mouse press event of the mouse device in a window including a screenshot word-taking control, the mouse press event is sent to the window including the screenshot word-taking control. At this time, the focus of the mouse device is on the window including the screenshot word-taking control. When the electronic device displays a second window and the focus is occupied by the second window, after the electronic device receives a mouse release event of the mouse device in the window including the screenshot word-taking control, it is determined whether the cursor of the mouse device is displayed on the screenshot word-taking control. If the cursor of the mouse device is displayed on the screenshot word-taking control, the mouse release event is sent to the window including the screenshot word-taking control. At this time, the focus of the mouse device is switched from the second window back to the window including the screenshot word-taking control. Furthermore, the window including the screenshot word-taking control switches the screenshot word-taking control from a gray state to a blue state based on the received mouse press event and the mouse release event.
[0176] In the following, when the word retrieval application is turned on, the response processing process of the text window is exemplified by taking the first object as text and the first window as a text window as an example.
[0177] In another example, taking the input device as a mouse device, after the electronic device receives a mouse press event of the mouse device in the text window, the mouse press event is sent to the text window. At this time, the focus of the mouse device is on the text window. When the electronic device displays a second window and the focus is occupied by the second window, it is determined whether the cursor of the mouse device is displayed on the text. If the cursor of the mouse device is displayed on the text, the mouse release event is sent to the text window. At this time, the focus of the mouse device is switched back from the second window to the text window. Then, the text window displays a text word extraction function window based on the received mouse press event and the mouse release event.
[0178] The technical solution provided by the embodiment of the present application is that after displaying a cursor on the first object of the first window and receiving a mouse press event from the input device of the electronic device, if a new second window is displayed and the focus is occupied by the second window, after receiving a mouse release event from the input device of the electronic device, it can be determined whether to respond to the operation of the first object in the first window by judging whether the cursor is displayed on the first object. Furthermore, in the case where the cursor is displayed on the first object, based on the mouse press event and the mouse release event, the operation of the first object is responded to, so that the mouse operation event can be smoothly responded to in the first window later. In this way, by setting the judgment condition of the above-mentioned cursor position, it can be determined whether the current first window needs to process the mouse operation event. Furthermore, in the case where the second window is newly displayed, the current first window that needs to process the mouse operation event continues to respond, which can solve the problem that the current window does not respond due to the newly displayed window grabbing the focus, and improve the reliability of the response processing.
[0179] exist Figure 7 Based on the software structure diagram shown, for example, Fig. 9 This is a schematic diagram of the architecture of a response processing method provided in an embodiment of the present application. Fig. 9 Taking the layered architecture of the system layer, the middle layer, and the application layer as an example, by setting an event monitor (hook function) in the middle layer, it is possible to monitor mouse operation events in the system, such as mouse press events and mouse release events of the input device of the electronic device. Furthermore, by determining whether the first window needs to process the mouse operation event, such as determining whether the cursor of the mouse device is displayed on the first object of the first window. If the first window needs to process the mouse operation event, the first window is triggered to process the mouse response. If the first window does not need to process the mouse operation event, the mouse operation event is triggered to flow automatically.
[0180] Among them, through the Window system of the system layer, it is possible to detect the mouse operation event based on the mouse device in the first window. After detecting the mouse operation event based on the mouse device in the first window, the mouse operation event can be sent to the event monitor of the middle layer through the hook function. Fig. 9 In the dot-dash process shown, the event monitor of the middle layer determines whether the cursor of the mouse device is displayed on the first object of the first window. If the cursor of the mouse device is displayed on the first object of the first window, it means that the first window needs to process the mouse operation event, and then the mouse operation event is sent to the first window to trigger the first window to process the mouse response. Fig. 9In the dotted line process shown, if the cursor of the mouse device is not displayed on the first object of the first window, it means that the first window does not need to process the mouse operation event, and then the mouse operation event is returned to the system layer to trigger the system layer to send the mouse operation event to the application layer, so that the mouse operation event is automatically transferred to the second window. In this way, when a new window pops up but the first window needs to process the mouse operation event, it can ensure that the first window responds to the mouse operation event.
[0181] Fig.10 This is an architecture interaction diagram of a response processing method provided in an embodiment of the present application. Fig.10 , taking the input device as a mouse device as an example, taking the interaction process between the system layer, the middle layer, and the application layer as an example, the method includes the following S1001-S1015:
[0182] S1001. The application layer displays a first window, and displays a cursor on a first object in the first window.
[0183] S1002: The user performs a mouse click operation in the first window using a mouse device.
[0184] S1003: After the system layer detects a mouse press operation in the first window based on the mouse device, it receives a mouse press event from the mouse device.
[0185] S1004: The system layer sends the mouse press event to the event monitor of the middle layer.
[0186] S1005: The event monitor receives the mouse press event and determines whether the mouse press event belongs to a preset mouse event.
[0187] S1006: When the mouse press event is a preset mouse event, the event monitor sends the mouse press event to the process corresponding to the first window of the application layer.
[0188] S1007: The process corresponding to the first window receives and records the mouse press event.
[0189] S1008: The application layer displays a second window, and the focus is occupied by the second window.
[0190] S1009: The user releases the mouse in the first window using the mouse device.
[0191] S1010: After the system layer detects a mouse release operation performed by the mouse device in the first window, it receives a mouse release event from the mouse device.
[0192] S1011. The system layer sends the mouse release event to the event monitor.
[0193] S1012: The event monitor receives the mouse release event and determines whether the mouse release event belongs to a preset mouse event.
[0194] S1013: When the mouse release event is a preset mouse event, the event monitor obtains a cursor position detection result.
[0195] S1014: When the cursor position detection result indicates that the cursor is displayed on the first object, the event monitor sends the mouse release event to the process corresponding to the first window.
[0196] S1015. The process corresponding to the first window receives the mouse release event, and responds to the operation of the first object in the first window based on the mouse press event and the mouse release event.
[0197] Compared with the solutions of the related art, when the window focus changes, the mouse release event originally sent to the first window is sent to the newly displayed second window, resulting in the first window being unable to obtain the mouse release event of the mouse device, thereby causing the first window to become unresponsive. The technical solution provided by the present application can solve the problem of the current first window becoming unresponsive due to the newly displayed second window grabbing the focus.
[0198] Fig.11 A schematic diagram of a response processing device provided in an embodiment of the present application. Fig.11 The response processing device includes a display module 1101, a receiving module 1102 and a response module 1103.
[0199] The display module 1101 is used to display a first window and display a cursor on a first object in the first window;
[0200] The receiving module 1102 is used to receive a mouse press event from an input device of the electronic device;
[0201] The display module 1101 is further used to display a second window, and the focus is occupied by the second window, and the electronic device receives a mouse release event from an input device of the electronic device;
[0202] The response module 1103 is used for, when the cursor is displayed on the first object, the electronic device responds to the operation of the first object based on the mouse press event and the mouse release event.
[0203] The technical solution provided by the embodiment of the present application is that after displaying a cursor on the first object of the first window and receiving a mouse press event from the input device of the electronic device, if a new second window is displayed and the focus is occupied by the second window, after receiving a mouse release event from the input device of the electronic device, it can be determined whether to respond to the operation of the first object in the first window by judging whether the cursor is displayed on the first object. Furthermore, in the case where the cursor is displayed on the first object, based on the mouse press event and the mouse release event, the operation of the first object is responded to, so that the mouse operation event can be smoothly responded to in the first window later. In this way, by setting the judgment condition of the above-mentioned cursor position, it can be determined whether the current first window needs to process the mouse operation event. Furthermore, in the case where the second window is newly displayed, the current first window that needs to process the mouse operation event continues to respond, which can solve the problem that the current window does not respond due to the newly displayed window grabbing the focus, and improve the reliability of the response processing.
[0204] In some embodiments, the electronic device includes an event monitor for monitoring mouse press events and mouse release events of an input device of the electronic device;
[0205] The device also includes a sending module, which is used to:
[0206] The event monitor sends the mouse press event and the mouse release event to the process corresponding to the first window.
[0207] In some embodiments, the sending module is specifically used to:
[0208] In the case that the mouse-press event and the mouse-release event belong to preset mouse events, the event monitor sends the mouse-press event and the mouse-release event to the process corresponding to the first window.
[0209] In some embodiments, the apparatus further comprises a switching module, configured to:
[0210] The focus is switched from the second window to the first window.
[0211] In some embodiments, the apparatus further comprises an acquisition module, configured to:
[0212] The event monitor obtains a position detection result of the cursor, where the position detection result is used to indicate whether the cursor is displayed on the first object.
[0213] In some embodiments, the mouse press event includes a first position in the display screen corresponding to when the mouse is pressed, and the mouse release event includes a second position in the display screen corresponding to when the mouse is released;
[0214] The response module 1103 is specifically used for:
[0215] When the first position and the second position are both located within the first window, the electronic device responds to the operation of the first object within the first window.
[0216] In some embodiments, the first window is a window including a target control;
[0217] The response module 1103 is specifically used for:
[0218] When the first position and the second position are both located in the first window, the electronic device switches the display state of the target control from the first state to the second state in the first window.
[0219] In some embodiments, the first window is a window including text content;
[0220] The response module 1103 is specifically used for:
[0221] In a case where both the first position and the second position are located within the first window, the electronic device displays a third window within the first window, and the third window includes at least one function control related to the text content.
[0222] It is understandable that the electronic device (such as terminal) in the embodiment of the present application includes a hardware structure and / or software module corresponding to each function in order to realize the above functions. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present application.
[0223] The embodiment of the present application also provides an electronic device, including: a display screen, a memory and a processor. The display screen is used to provide a display function. The processor is connected to the memory, the memory is used to store program codes, and the processor executes the program codes stored in the memory, thereby implementing the response processing method provided in the embodiment of the present application.
[0224] An embodiment of the present application further provides a computer-readable storage medium having program code stored thereon. When the program code is executed on an electronic device, the electronic device executes each function or step executed by the electronic device in the above method embodiment.
[0225] An embodiment of the present application also provides a computer program product, including program code. When the program code is executed on an electronic device, the electronic device executes each function or step executed by the electronic device in the above method embodiment.
[0226] Among them, the electronic device, computer-readable storage medium or computer program product provided in the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0227] Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device (such as an electronic device) is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device (such as an electronic device) and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0228] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices (such as electronic devices) and methods can be implemented in other ways. For example, the device (such as electronic device) embodiments described above are only schematic. For example, the division of the module or unit is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0229] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0230] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0231] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method of each embodiment of the present application. The aforementioned storage medium includes: flash memory, mobile hard disk, read-only memory, random access memory, disk or optical disk and other media that can store program codes.
[0232] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A response processing method, characterized in that: Applied to electronic equipment, the method comprises: The electronic device displays a first window, and displays a cursor on a first object in the first window; The electronic device receives a mouse press event from an input device of the electronic device; The electronic device displays a second window, and the focus is switched from the process corresponding to the first window to the process corresponding to the second window, where the second window is any newly displayed window; The electronic device receives a mouse release event from an input device of the electronic device; Determine whether the cursor is displayed on the first object. If the cursor is displayed on the first object, switch the focus from the process corresponding to the second window to the process corresponding to the first window, and the electronic device responds to the operation of the first object based on the mouse press event and the mouse release event.
2. The method according to claim 1, characterized in that The electronic device comprises an event monitor, and the event monitor is used to monitor a mouse pressing event and a mouse releasing event of an input device of the electronic device; The method further comprises: The event monitor sends the mouse press event and the mouse release event to a process corresponding to the first window.
3. The method according to claim 2, characterized in that The event monitor sends the mouse press event and the mouse release event to the process corresponding to the first window, including: In a case where the mouse-press event and the mouse-release event are preset mouse events, the event monitor sends the mouse-press event and the mouse-release event to a process corresponding to the first window.
4. The method according to claim 2, characterized in that: After the electronic device receives a mouse release event from an input device of the electronic device, the method further includes: The event monitor obtains a position detection result of the cursor, where the position detection result is used to indicate whether the cursor is displayed on the first object.
5. The method according to claim 1, characterized in that The mouse press event includes a first position on the display screen corresponding to when the mouse is pressed, and the mouse release event includes a second position on the display screen corresponding to when the mouse is released; The electronic device responds to the operation of the first object based on the mouse press event and the mouse release event, including: When both the first position and the second position are located within the first window, the electronic device responds to the operation of the first object within the first window.
6. The method according to claim 5, characterized in that The first window is a window including a target control; When both the first position and the second position are located within the first window, the electronic device responds to the operation of the first object within the first window, including: When both the first position and the second position are located in the first window, the electronic device switches the display state of the target control from the first state to the second state in the first window.
7. The method according to claim 5, characterized in that The first window is a window including text content; When both the first position and the second position are located within the first window, the electronic device responds to the operation of the first object within the first window, including: In a case where both the first position and the second position are located within the first window, the electronic device displays a third window within the first window, where the third window includes at least one functional control related to the text content.
8. An electronic device, characterized in that: It comprises a display screen, a memory and a processor; the display screen is used to provide a display function; the memory is used to store program code; the processor is used to call the program code to execute the method according to any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that: The method comprises a program code, and when the program code is executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 7.
