CN117707395B - Response processing method, electronic device and storage medium - Google Patents
Response processing method, electronic device and storage medium Download PDFInfo
- Publication number
- CN117707395B CN117707395B CN202310947660.XA CN202310947660A CN117707395B CN 117707395 B CN117707395 B CN 117707395B CN 202310947660 A CN202310947660 A CN 202310947660A CN 117707395 B CN117707395 B CN 117707395B
- Authority
- CN
- China
- Prior art keywords
- window
- mouse
- event
- electronic device
- application
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0484—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
- G06F3/04842—Selection of displayed objects or displayed text elements
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0487—Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The application discloses a response processing method, electronic equipment and a storage medium, relates to the technical field of terminals, and is used for solving the problem that a current window does not respond due to focus robbery of a newly displayed window. The method comprises the following steps: the electronic equipment displays a first window, and a cursor is displayed on a first object of the first window; the electronic device receives a mouse-down event from an input device of the electronic device; the electronic device displays a second window, 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; in a case where the cursor is displayed on the first object, the electronic device responds to the operation of the first object based on the mouse-down event and the mouse-release event.
Description
Technical Field
The present application relates to the field of terminal technologies, and in particular, to a response processing method, an electronic device, and a storage medium.
Background
During the use of the electronic device (e.g., terminal) by the user, the electronic device may display related content to the user in the form of a window, so that the user may perform related operations within the window or view the related content, etc. For example, when a user performs a related operation (e.g., a click operation) on a window displayed by an electronic device using an input device (e.g., a mouse device), the window triggers a corresponding response.
Disclosure of Invention
The application provides a response processing method, electronic equipment and a storage medium, which are used for solving the problem that a current window does not respond due to focus robbery of a newly displayed window.
In order to achieve the above purpose, the application adopts the following technical scheme:
In a first aspect, a response processing method is provided, applied to an electronic device, and the method includes:
The electronic equipment displays a first window, and a cursor is displayed on a first object of the first window;
the electronic device receives a mouse-down event from an input device of the electronic device;
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;
in a case where the cursor is displayed on the first object, the electronic device responds to an operation of the first object based on the mouse-down event and the mouse-release event.
In the above technical solution, after displaying a cursor on a first object of the first window and receiving a mouse-down event from an input device of the electronic device, if a second window is newly displayed and focus is occupied by the second window, after receiving a mouse-release event from the input device of the electronic device, it may be determined whether to respond to an operation of the first object within the first window by determining whether the cursor is displayed on the first object. Further, when the cursor is displayed on the first object, the operation of the first object is responded based on the mouse-down event and the mouse-up event, and the current mouse operation event can be smoothly responded within the first window. Therefore, by setting the judgment condition of the cursor position, whether the current first window needs to process the current mouse operation event or not can be determined. Furthermore, under the condition of newly displaying the second window, the current first window which needs to process the current mouse operation event is enabled to continuously respond, the problem that the current window does not respond due to the fact that the newly displayed window robs a focus can be solved, and reliability of response processing is improved.
In a possible implementation manner of the first aspect, the electronic device includes an event monitor, the event monitor being configured to monitor a mouse-down event and a mouse-release event of an input device of the electronic device;
the method further comprises the steps of:
The event monitor sends the mouse-down event and the mouse-release event to a process corresponding to the first window.
In this possible implementation manner, a manner of acquiring the current mouse operation event for the first window is provided. When a mouse-down event from an input device of the electronic device is received, the mouse-down event needs to be sent to a process corresponding to the first window, so that a subsequent process corresponding to the first window processes based on the received mouse-down event. When a mouse release event from an input device of the electronic device is received under the condition that a second window is newly displayed, the mouse release event needs to be sent to a process corresponding to the first window so that a subsequent process corresponding to the first window can process based on the received mouse release event. Therefore, smooth response to the current mouse operation event in the first window can be ensured, and the reliability of response processing is improved.
In another possible implementation manner of the first aspect, the sending, by the event monitor, the mouse down event and the mouse release event to a process corresponding to the first window includes:
And under the condition that the mouse pressing event and the mouse releasing event belong to preset mouse events, the event monitor sends the mouse pressing event and the mouse releasing event to a process corresponding to the first window.
In this possible implementation manner, a manner of triggering the sending of the current mouse operation event based on the preset mouse event is provided. When a mouse-down event from an input device of the electronic device is received, whether the mouse-down event belongs to a preset mouse event or not is judged, and the mouse-down event is ensured to be sent to a process corresponding to the first window under the condition that the mouse-down event belongs to the preset mouse event. When a mouse release event from an input device of the electronic device is received under the condition that a second window is newly displayed, whether the mouse release event belongs to a preset mouse event or not is judged, and the mouse release event is ensured to be sent to a process corresponding to the first window under the condition that the mouse release event belongs to the preset mouse event. Therefore, smooth response to the current mouse operation event in the first window can be ensured, and the reliability of response processing is improved.
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:
The focus is switched from the second window to the first window.
In the possible implementation manner, under the condition that the second window is newly displayed, the focus can be switched back to the first window by continuously sending the mouse release event to the process corresponding to the first window, so that the problem that the current window does not respond due to focus robbery of the newly displayed window can be solved, and the reliability of response processing is improved.
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:
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.
In this possible implementation manner, a manner of acquiring the position detection result of the cursor is provided, so that whether the cursor is displayed on the first object can be quickly and accurately determined.
In another possible implementation manner of the first aspect, the mouse-down event includes a first position in the corresponding display screen when the mouse is down, and the mouse-down event includes a second position in the corresponding display screen when the mouse is down;
The electronic device responding to the operation of the first object based on the mouse down event and the mouse release event, comprising:
The electronic device responds to the operation of the first object in the first window under the condition that the first position and the second position are both positioned in the first window.
In the possible implementation manner, whether the mouse pressing event and the mouse releasing event belong to the same mouse operation event is judged by judging whether the first position corresponding to the mouse pressing event and the second position corresponding to the mouse releasing event in the mouse operation event are both positioned in the first window, so that response to the same mouse operation event is ensured, the problem of abnormal response is avoided, and the reliability of response processing is improved.
In another possible implementation manner of the first aspect, the first window is a window including a target control;
The electronic device responding to the operation of the first object in the first window under the condition that the first position and the second position are both positioned in the first window, comprising:
And under the condition that the first position and the second position are both positioned in the first window, the electronic equipment switches the display state of the target control from a first state to a second state in the first window.
In this possible implementation manner, a response processing scheme is provided, where the control window is taken as an example, and the control window that needs to process the current mouse operation event can continuously respond under the condition that the second window is newly displayed, that is, the display state of the target control is switched from the first state to the second state, so that the reliability of response processing is improved.
In another possible implementation manner of the first aspect, the first window is a window including text content;
The electronic device responding to the operation of the first object in the first window under the condition that the first position and the second position are both positioned in the first window, comprising:
In the case that 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, wherein the third window comprises at least one function control related to the text content.
In this possible implementation manner, a response processing scheme is provided, where the text window is taken as an example, and the text window that needs to process the current mouse operation event can be made to continuously respond under the condition that the second window is newly displayed, that is, a third window including at least one functional control is displayed, so that reliability of response processing is improved.
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 for providing a display function. The memory is configured to store program code and the processor is configured to invoke the program code stored in the memory to implement any of the methods provided in the first aspect.
In a third aspect, there is provided a computer readable storage medium comprising program code which, when run on an electronic device, causes the electronic device to perform any one of the methods provided in the first aspect.
In a fourth aspect, there is provided a computer program product comprising program code which, when run on an electronic device, causes the electronic device to perform any one of the methods provided in the first aspect.
It should be noted that, the technical effects caused by any implementation manner of the second aspect to the fourth aspect may refer to the technical effects caused by the corresponding implementation manner in the first aspect, which are not described herein.
Drawings
Fig. 1 is a schematic diagram of an electronic device according to an embodiment of the present application;
Fig. 2 is a schematic diagram of a display screen of an electronic device according to an embodiment of the present application;
fig. 3 is a schematic diagram of a display screen of an electronic device according to an embodiment of the present application;
Fig. 4 is a schematic diagram of a display screen of an electronic device according to an embodiment of the present application;
Fig. 5 is a schematic diagram of a display screen of an electronic device according to an embodiment of the present application;
fig. 6 is a schematic hardware structure of an electronic device according to an embodiment of the present application;
fig. 7 is a schematic software structure of an electronic device according to an embodiment of the present application;
FIG. 8 is a flow chart of a response processing method according to an embodiment of the present application;
FIG. 9 is a schematic diagram of a response processing method according to an embodiment of the present application;
FIG. 10 is a schematic diagram of a response processing method according to an embodiment of the present application;
Fig. 11 is a block diagram of a response processing apparatus according to an embodiment of the present application.
Detailed Description
In the description of the present application, "/" means "or" unless otherwise indicated, for example, A/B may mean A or B. "and/or" herein is merely an association relationship describing an association object, and means that three relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist together, and B exists alone. Furthermore, "at least one" means one or more, and "a plurality" means two or more. The terms "first," "second," and the like do not limit the number and order of execution, and the terms "first," "second," and the like do not necessarily differ.
It should be noted that, in the embodiments of the present application, words such as "exemplary" or "such as" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "for example" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
In some embodiments, the response processing method provided in the embodiments of the present application may be applied to the electronic device 100 shown in fig. 1. Fig. 1 is a schematic diagram of an electronic device according to an embodiment of the present application.
The electronic device 100 may be a terminal device. By way of 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, a laptop portable computer, and the like.
In an embodiment of the present application, the input device 101 may be connected to the electronic device 100. By way of example, the input device 101 may be a mouse device, a touchpad, a stylus, and the like. For example, the electronic device 100 may be connected to the input device 101 by wired or wireless means.
In some embodiments, the electronic device 100 is provided with functionality to trigger a window response based on the input device 101. For example, referring to fig. 1, during a user's use of the electronic device 100, the electronic device 100 displays related content to the user in the form of a window so that the user performs related operations within the window or views the related content, etc. Further, when a user performs a related operation (e.g., a click operation) on a window displayed on the electronic device 100 using the input device 101, the window triggers a corresponding response.
The response processing method provided by the embodiment of the application can be applied to the response scene of the window displayed by the electronic equipment 100.
Wherein the window may be an application window, i.e. a window related to the display of the application. 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 for displaying popup windows of the application, such as auxiliary windows like a floating window.
Illustratively, taking a text application (such as wps application, word application, excel application, ppt application, or txt application) as an example, the window may be an application main window of the text application, that is, a window for displaying text content. Or the window may be an application sub-window of the text application, such as the window in which the functionality control is located.
Also by way of example, taking a social application (e.g., chat application) as an example, the window may be an application main window of the social application, i.e., a window for displaying session content. Or the window may also be an application sub-window of the social application, such as the window in which the functionality control is located.
Also illustratively, taking a mail application as an example, the window may be an application main window of the mail application, i.e., a window for displaying mail content. Or the window may be an application sub-window of the mail application, such as the window in which the functionality control is located.
For simplicity of description, the window including text content may be hereinafter abbreviated as text window, the window including functionality control as control window, the window including conversation content as conversation window, and the window including mail content as mail window.
The following exemplifies a scheme by taking a word taking application provided by the electronic device as an example. The word taking application is used for text word taking or picture word taking. The word-taking application will be described first.
The entry for the word-taking application may be provided in a computer manager application, a side shortcut bar, or other location provided by the electronic device. Taking an example of an entry in a computer housekeeping application as an example, fig. 2 is a schematic diagram of a display screen of an electronic device according to an embodiment of the present application. Upon receiving a user's opening operation of the computer manager application, referring to fig. 2, in response, the electronic device may display a computer manager interface 201. Various functional controls, such as a word taking control 202, are included in the computer manager interface 201. It should be appreciated that the term control 202 is also the portal to the term application described above.
The user can start the word capturing application by triggering the entry of the word capturing application. Fig. 3 is a schematic diagram of a display screen of an electronic device according to an embodiment of the present application. After receiving a trigger operation of the user on the entry of the word capturing application, the electronic device may display at least one function control of the word capturing application in response, see fig. 3. For example, the at least one functionality control may include a copy all control 301, a translate all control 302, a read all control 303, a collect all control 304, and a screen capture word control 305. Wherein the copy all control 301 is used to copy all of the selected text content. The translate all control 302 is used to translate all of the selected text content. The read all control 303 is used to read all of the selected text content. The collect all control 304 is used to collect all of the selected text content. The screen capture word control 305 is used to trigger a screen capture and to identify images from the screen capture to obtain text content. It should be understood that the electronic device displays at least one of the above-mentioned functionality controls, i.e. it indicates that the word capturing application is opened at this time.
In some embodiments, taking text word taking scenes as an example, the electronic device can display a text window that includes text content. Such as text windows may be windows of wps applications, windows of word applications, windows of excel applications, windows of ppt applications or windows of txt applications, etc. After the word-taking application is started, the user can use an input device (such as a mouse device) to implement a sliding word-taking operation (namely, an operation of pressing a left button of the mouse device and moving the mouse device, and releasing the left button of the mouse after selecting a required text) in the text window, and then the electronic device responds to the sliding word-taking operation to display a functional window for text word-taking. The functionality window may include at least one functionality control, such as a copy control, a translate control, a search control, a skip control, a read-aloud control, a collection control, and so forth.
Fig. 4 is a schematic diagram of a display screen of an electronic device according to an embodiment of the present application. Referring to fig. 4, after receiving a sliding word-taking operation of the user within the text window, referring to fig. 4, in response, the electronic device may display a text-word-taking function window 401. The text word-taking function window 401 includes various function controls, such as a copy control 402, a translation control 403, a search control 404, a skip control 405, a read control 406, and a collection control 407.
In other embodiments, taking a picture-taking scene as an example, the electronic device may display a window 1 (which may be simply referred to as a picture window) including a picture, where the picture includes text. At this time, the user may perform a click operation on the screen capturing word control using an input device (e.g., a mouse device). The component including the screen capturing and word capturing control may be referred to as a window, and then the user performs a clicking operation on the screen capturing and word capturing control using the mouse device, which may also be understood as performing a clicking operation (i.e., an operation of pressing a left button of the mouse device and releasing the left button of the mouse device) within the window 2 including the screen capturing and word capturing control using the mouse device. And responding to the clicking operation by the electronic equipment, and switching the display state of the screen capturing word taking control from the state 1 to the state 2 in the window 2. The state 1 is used for indicating that the screen capturing word capturing control is not triggered, and the state 2 is used for indicating that the screen capturing word capturing control is triggered, for example, the state 1 is gray, and the state 2 is blue. In addition, the electronic device is used for responding to the clicking operation, capturing a screen of content displayed in a display screen of the electronic device and performing image recognition on an image obtained by capturing the screen to obtain a text. Further, the electronic device displays the text obtained by the image recognition on the window 1. In addition, the text is in an optional state (e.g., gray state, i.e., text background is gray). And then, the user can use the mouse device to implement sliding word-taking operation in the displayed text, and the electronic device responds to the sliding word-taking operation to display a functional window for text word-taking.
Fig. 5 is a schematic diagram of a display screen of an electronic device according to an embodiment of the present application. Referring to fig. 5, the window 1 including a picture may be a window 501 shown in fig. 5. Window 2 described above, including the screen capture word control, may be window 502 shown in fig. 5. After the electronic device receives the click operation of the user in the window 502, the electronic device may switch the display state of the screen capturing word capturing control from the gray state to the blue state in the window 502 in response, and screen capture the content displayed in the display screen of the electronic device and image recognition is performed on the image obtained by the screen capturing to obtain the text. Further, the electronic device displays the text 503 obtained by image recognition in the window 501, and after receiving a user's sliding word-taking operation in the displayed text 503, referring to fig. 5, in response, the electronic device may display a function window 504 for text word-taking. The function window 504 is the same as the function window 401 described above, and will not be described again.
It should be understood that, for a text word-taking scene, since the text window itself supports sliding selection of text, text word-taking is directly performed without using a screen capturing word-taking control of the word-taking application. In the picture word-taking scene, because the picture window does not support sliding selection text, a screen capturing word-taking control of the word-taking application is needed to be utilized, screen capturing is firstly carried out, then image recognition is carried out on an image obtained through screen capturing to obtain text, and therefore word-taking of the text is completed. Of course, in some embodiments, in a text word-taking scene, by triggering a screen capturing word-taking control of the word-taking application, a screen capturing is performed on a display screen, and an image obtained by the screen capturing is subjected to image recognition to obtain a text, so that text word-taking can be realized.
Currently, if a window is newly displayed when a user performs a related operation using an input device (such as a mouse device), the current window does not respond due to the fact that the newly displayed window robs a focus.
For example, taking the above word capturing application as an example, when clicking the screen capturing word capturing control, if a window is newly displayed, the focus becomes the newly displayed window, so that the screen capturing word capturing control is clicked and does not respond. For another example, taking a text window as an example, when a word is fetched by sliding in the text window, if the window is newly displayed, the focus becomes the newly displayed window, so that the word is fetched by sliding and does not respond.
In some embodiments, the response processing method provided by the embodiment of the application can be applied to the response scene of the window related to the word capturing application, such as a text window, a picture window (including optional text), a window where all the controls are copied, a window where all the controls are translated, a window where all the controls are read aloud, a window where all the controls are collected, a window including a screen capturing word capturing control, and the like. It should be appreciated that, similar to a window including a screen capture word control, a component including a copy of all controls may be referred to herein as a window, a component including a translate all controls may be referred to herein as a window, a component including a read all controls may be referred to herein as a window, and a component including a collection of all controls may be referred to herein as a window.
It should be noted that, the word taking application may be a program plug-in attached to the text application, and run with the text application being opened. Alternatively, the word-taking application may be a word-taking application running independently of the text application, such as MagicText AI, etc. The embodiment of the application is not limited to word-taking application.
In view of this, an embodiment of the present application provides a response processing method, after displaying a cursor on a first object of the first window and receiving a mouse-down event from an input device of the electronic device, if a second window is newly displayed and a focus is occupied by the second window, after receiving a mouse release event from the input device of the electronic device, determining whether to respond to an operation of the first object within the first window by determining whether the cursor is displayed on the first object. Further, when the cursor is displayed on the first object, the operation of the first object is responded based on the mouse-down event and the mouse-up event, so that the subsequent response to the current mouse operation event is smoothly performed within the first window. Therefore, by setting the judgment condition of the cursor position, whether the current first window needs to process the current mouse operation event or not can be determined. Furthermore, under the condition of newly displaying the second window, the current first window which needs to process the current mouse operation event is enabled to continuously respond, the problem that the current window does not respond due to the fact that the newly displayed window robs a focus can be solved, and reliability of response processing is improved.
It will be appreciated that after the electronic device is connected to an input device (e.g., a mouse device), a cursor (or mouse pointer) may be displayed on the display of the electronic device for use in prompting a user that the input device has been successfully accessed. In the embodiment of the application, the electronic equipment is used for displaying a first window, and a cursor is displayed on a first object of the first window; receiving a mouse-down event from an input device of the electronic device; displaying a second window, wherein the focus is occupied by the second window, and receiving a mouse release event from an input device of the electronic device; in a case where the cursor is displayed on the first object, an operation of the first object is responded based on the mouse-down event and the mouse-release event.
Exemplary, a schematic structural diagram of the electronic device 100 in fig. 1 is shown in fig. 6. Fig. 6 is a schematic hardware structure of an electronic device according to an embodiment of the present application.
Referring to fig. 6, the electronic device 100 may include a processor 610, an external memory interface 620, an internal memory 621, a universal serial bus (universal serial bus, USB) interface 630, a charge 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, keys 690, a display 691. Wherein the sensor module 680 may include a pressure sensor 680A, a touch sensor 680B, and the like.
It should be understood that the illustrated structure of the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the application, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 610 may include one or more processing units, such as: the processor 610 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (IMAGE SIGNAL processor, ISP), a controller, a memory, a video codec, a digital signal processor (DIGITAL SIGNAL processor, DSP), a baseband processor, and/or a neural-Network Processor (NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller may be a neural hub and a command center of the electronic device 100, among others. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 610 for storing instructions and data. In some embodiments, the memory in the processor 610 is a cache memory. The memory may hold instructions or data that the processor 610 has just used or recycled. If the processor 610 needs to reuse the instruction or data, it may be called directly from the memory. Repeated accesses are avoided, reducing the latency of the processor 610 and thus improving the efficiency of the system.
In some embodiments, the processor 610 may include one or more interfaces. The interfaces may include an integrated circuit (inter-INTEGRATED CIRCUIT, I2C) interface, an integrated circuit built-in audio (inter-INTEGRATED CIRCUIT SOUND, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a USB interface 603, among others.
The USB interface 630 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 630 may be used to connect a charger to charge the electronic device 100, and may also be used to transfer data between the electronic device 100 and a peripheral device. For example, USB interface 630 may be used to connect input devices, such as a mouse device. As another example, USB interface 630 may also be used to connect headphones through which audio is played. The interface may also be used to connect other electronic devices, such as AR devices, etc.
It should be understood that the interfacing relationship between the modules illustrated in the embodiments of the present application is only illustrative, and is not meant to limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also employ different interfacing manners in the above embodiments, or a combination of multiple interfacing manners.
The charge management module 640 is used to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charge management module 640 may receive a charging input of a wired charger through the USB interface 630. In some wireless charging embodiments, the charge management module 640 may receive wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 640 may also provide power to the electronic device through the power management module 641 while charging the battery 642.
The power management module 641 is used for connecting the battery 642, the charge management module 640 and the processor 610. The power management module 641 receives input from the battery 642 and/or the charge management module 640 to power the processor 610, the internal memory 621, the external memory, the display 691, the wireless communication module 660, and the like. The power management module 641 may also be used to monitor battery capacity, battery cycle times, battery health (leakage, impedance), etc. In other embodiments, the power management module 641 may also be disposed in the processor 610. In other embodiments, the power management module 641 and the charge management module 640 may be disposed in the same device.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 650, the wireless communication module 660, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 650 may provide a solution for wireless communication, including 2G/3G/4G/5G, as applied to the electronic device 100. The mobile communication module 650 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), or the like. The mobile communication module 650 may receive electromagnetic waves from the antenna 1, perform processes such as filtering and amplifying the received electromagnetic waves, and transmit the electromagnetic waves to the modem processor for demodulation. The mobile communication module 650 may amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate the electromagnetic waves. In some embodiments, at least some of the functional modules of the mobile communication module 650 may be disposed in the processor 610. In some embodiments, at least some of the functional modules of the mobile communication module 650 may be disposed in the same device as at least some of the modules of the processor 610.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating 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. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs sound signals through an audio device (not limited to speakers, receivers, etc.), or displays images or video through a display screen 691. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 650 or other functional module, independent of the processor 610.
The wireless communication module 660 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (WIRELESS FIDELITY, wi-Fi) network), bluetooth (bluetoo, BT), global navigation satellite system (global navigation SATELLITE SYSTEM, GNSS), frequency modulation (frequency modulation, FM), near field communication (NEAR FIELD communication, NFC), infrared (IR), etc., as applied to the electronic device 100. The wireless communication module 660 may be one or more devices that integrate at least one communication processing module. The wireless communication module 660 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 610. The wireless communication module 660 can also receive signals to be transmitted from the processor 610, frequency modulate and amplify the signals, and convert the signals to electromagnetic waves to radiate the electromagnetic waves through the antenna 2. In some embodiments, the electronic device 100 is capable of connecting to an input device, such as a mouse device, via bluetooth in the wireless communication module 660.
In some embodiments, antenna 1 and mobile communication module 650 of electronic device 100 are coupled, and antenna 2 and wireless communication module 660 are coupled, such that electronic device 100 may communicate with a network and other devices through wireless communication techniques.
The electronic device 100 implements display functions through a GPU, a display screen 691, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 691 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 610 may include one or more GPUs that execute program instructions to generate or change display information.
The display 691 is used to display images, videos, and the like. The display 691 includes a display panel. The display panel may employ a Liquid Crystal Display (LCD) CRYSTAL DISPLAY, an organic light-emitting diode (OLED), an active-matrix organic LIGHT EMITTING diode (AMOLED), a flexible light-emitting diode (FLED), miniled, microLed, micro-oLed, a quantum dot LIGHT EMITTING diodes (QLED), or the like. In some embodiments, the electronic device 100 may include 1 or N display screens 691, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, or the like.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: dynamic picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
The NPU is a neural-network (NN) computing processor, and can rapidly process input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent awareness of the electronic device 100 may be implemented through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, etc.
The external memory interface 620 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 100. The external memory card communicates with the processor 610 through an external memory interface 620 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 621 may be used to store computer-executable program code that includes instructions. The processor 610 executes instructions stored in the internal memory 621 to thereby perform various functional applications and data processing of the electronic device 100. The internal memory 621 may include a storage program area and a storage data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device 100 (e.g., audio data, phonebook, etc.), and so on. In addition, the internal memory 621 may include a high-speed random access memory, and may also include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like.
The electronic device 100 may implement audio functions through an audio module 670, an application processor, and the like. Such as music playing, recording, etc.
The audio module 670 is used to convert digital audio information to an analog audio signal output and also to convert an analog audio input to a digital audio signal. The audio module 670 may also be used to encode and decode audio signals. In some embodiments, the audio module 670 may be disposed in the processor 610, or some of the functional modules of the audio module 670 may be disposed in the processor 610.
The pressure sensor 680A is used to sense a pressure signal, and may convert the pressure signal into an electrical signal. In some embodiments, pressure sensor 680A may be disposed on display 691. The pressure sensor 680A is of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a capacitive pressure sensor comprising at least two parallel plates with conductive material. When a force is applied to the pressure sensor 680A, the capacitance between the electrodes changes. The electronic device 100 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display 691, the electronic apparatus 100 detects the intensity of the touch operation based on the pressure sensor 680A. The electronic device 100 may also calculate the location of the touch based on the detection signal of the pressure sensor 680A. In some embodiments, touch operations that act on the same touch location, but at different touch operation strengths, may correspond to different operation instructions. For example: and executing an instruction for checking the short message when the touch operation with the touch operation intensity smaller than the first pressure threshold acts on the short message application icon. And executing an instruction for newly creating the short message when the touch operation with the touch operation intensity being greater than or equal to the first pressure threshold acts on the short message application icon.
The touch sensor 680B, also referred to as a "touch panel". The touch sensor 680B may be disposed on the display 691, and the touch sensor 680B and the display 691 form a touch screen, which is also referred to as a "touch screen". The touch sensor 680B is used to detect a touch operation acting on or near it. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display 691. In other embodiments, the touch sensor 680B may also be disposed on a surface of the electronic device 100 at a different location than the display 691.
It should be noted that the structure shown in fig. 6 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown in fig. 6, or may combine some components, or may be arranged with different components.
The software system of the electronic device may employ a layered architecture, an event driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. In some embodiments, the software structure of the embodiments of the present application may be an Android system-based structure or a Window system-based structure. In the embodiment of the application, a Window system with a layered architecture is taken as an example, and the software structure of the electronic equipment is illustrated. Fig. 7 is a schematic software structure of an electronic device according to an embodiment of the present application.
The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the Window system may be divided into an application layer, an intermediate layer, a system layer, and a hardware driver layer.
Wherein the application layer is also referred to as an application program layer. In the embodiment of the application, the application layer is used for receiving and recording the mouse operation event, and then responding to the current mouse operation event based on the mouse operation event.
As shown in fig. 7, the application layer may include a series of application packages. For example, the application packages may include application programs such as a computer manager application, wps application, word application, txt application, excel application, ppt application, word taking application, music application, video application, social application, and the like.
In some embodiments, the electronic device displays relevant content of the application program in the form of a window, so that a user performs relevant operations or views relevant content in the window, and the like.
As shown in fig. 7, the middle tier may include an event monitor for monitoring 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.
By way of example, the mouse operation event may include a mouse down event and a mouse release event, such as a mouse down event may be a mouse left-click event, a mouse right-click event, a mouse wheel-click event, and the like. Further, the mouse-down event may also include a mouse-down movement event, such as a mouse-left key-down movement event, a mouse-right key-down movement event, a mouse-wheel-down movement event, and the like. The mouse release event may be a mouse left button release event, a mouse right button release event, a mouse wheel release event, or the like.
In the embodiment of the application, the middle layer is used for judging whether the mouse operation event belongs to a preset mouse event or not, and further, sending the mouse operation event to a process corresponding to the first window of the application layer under the condition that the mouse operation event belongs to the preset mouse event. For example, judging whether a mouse-down event belongs to a preset mouse event, further, sending the mouse-down event to a process corresponding to a first window of an application layer under the condition that the mouse-down event belongs to the preset mouse event, judging whether a mouse-down event belongs to the preset mouse event, further, obtaining a position detection result of a cursor under the condition that the mouse-down event belongs to the preset mouse event, and sending the mouse-down event to the process corresponding to the first window of the application layer if the position detection result of the cursor indicates that the cursor is displayed on a first object of the first window.
The system layer is responsible for basic data acquisition, daily business processing, management monitoring and the like. As shown in fig. 7, the system layer may include a Window system. In the embodiment of the application, the system layer is used for detecting the mouse operation event and sending the mouse operation event to the event monitor of the middle layer.
In some embodiments, the mouse operation event may include a mouse button flag bit (for indicating which of a press, a lift, a move, or a scroll wheel scroll the user has performed), coordinate information (for indicating an X-coordinate and a Y-coordinate of the mouse device movement when the user has moved the mouse device), scroll wheel information (for indicating an X-axis distance and a Y-axis distance of the scroll wheel scroll when the user has operated the scroll wheel of the mouse device), key position information (for indicating which of a left, a center, or a right key of the mouse device the user has performed the operation).
As shown in fig. 7, the hardware driver layer is a layer between hardware and software. In some embodiments, the hardware driver layer includes at least a mouse driver, a keyboard driver, a display driver, a camera driver, an audio driver, a sensor driver, and the like. In the embodiment of the application, the hardware driving layer is used for connecting the input device and the electronic device.
In the embodiment of the application, the electronic equipment can complete the function of triggering window response based on the input equipment through the mutual coordination among the application layer, the middle layer, the system layer and the hardware driving layer.
Fig. 8 is a flow chart of a response processing method according to an embodiment of the present application. Referring to fig. 8, with an electronic device as an execution subject, the method includes the following S801-S807:
S801, the electronic equipment displays a first window, and a cursor is displayed on a first object of the first window.
In the embodiment of the application, the first window is used for referring to a window to be triggered by a user in a window currently displayed by the electronic equipment.
In some embodiments, the first window may be a control window, a text window, a picture window, a conversation window, a mail window, or the like. For example, the control window may be a window in which a functionality control such as an open control, a view control, a full screen control, etc. is 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 embodiment of the application takes a control window and a text window as examples, and a description is given to the embodiment of the application.
The first object refers to an object to be operated included in the first window. Taking the first window as a control window as an example, the first object is the functional control included in the control window. Taking the first window as a text window as an example, the first object is text content included in the text window.
Illustratively, as shown in S801 in fig. 8, taking a first window as an example of a window including a screen capturing and word capturing control in the word capturing application, the first object is the screen capturing and word capturing control, and at this time, a cursor is displayed on the screen capturing and word capturing control.
S802, the electronic device receives a mouse-down event from an input device of the electronic device.
Wherein the mouse down event is the down event of the input device. It should be understood that the mouse-down event is an event based on a mouse-down operation.
In some embodiments, the mouse-down event may be a mouse left-click event, a mouse right-click event, or a mouse wheel-click event, among others. Further, the mouse-down event may also be a mouse-down movement event, that is, an event in which movement is performed after a mouse key (e.g., a left key, a right key, or a wheel) is pressed. For example, an operation of moving left or right after pressing a mouse key, an operation of moving up or down after pressing a mouse key, or the like.
The mouse down event may include a mouse button flag (pressed), key location information (e.g., left key), and a first location in the corresponding display screen when the mouse is pressed. The first position is the position coordinate in the corresponding display screen when the mouse is pressed.
The mouse button zone bit can be represented by name, number and identity number (identity document, ID). Key location information may also be represented by name, number, identification number. The first location may be represented using two-dimensional coordinates (e.g., X-coordinates, Y-coordinates).
In some embodiments, the electronic device includes a system layer. If the user performs the mouse-down operation on the input device, the electronic device can detect the mouse-down operation of the input device and receive the mouse-down event from the input device through the system layer.
In some embodiments, the electronic device further comprises a middle tier comprising an event monitor for monitoring mouse down events and mouse release events of an input device of the electronic device. Further, in some embodiments, after receiving a mouse-down event from the input device, the system layer also sends the mouse-down event to the event monitor for the event monitor to perform a subsequent response process.
S803, the event monitor in the electronic device sends the mouse-down event to the process corresponding to the first window.
After the event monitor sends the mouse-down event to the process corresponding to the first window, the process corresponding to the first window receives and records the mouse-down event.
Thus, a way of acquiring the current mouse operation event for the first window is provided. When a mouse-down event from an input device of the electronic device is received, the mouse-down event needs to be sent to a process corresponding to the first window, so that a subsequent process corresponding to the first window processes based on the received mouse-down event, and thus the subsequent process smoothly responds to the current mouse-down event in the first window, and the reliability of response processing is improved.
In some embodiments, before sending the mouse down event to the first window, the event monitor further determines whether the mouse down event belongs to a preset mouse event based on the preset mouse event. And further, under the condition that the mouse-down event belongs to a preset mouse event, the event monitor sends the mouse-down event to a process corresponding to the first window.
The preset mouse event may be a preset mouse operation event supported by the first window. For example, a mouse left button press event, a mouse left button release event, a mouse wheel press event, a mouse wheel release event, a mouse left button press movement event, a mouse wheel press movement event, and the like. Or in the embodiment of the mouse-down event, the preset mouse event may also be a preset mouse-down event supported by the first window. For example, a mouse left button press event, a mouse wheel press event, a mouse left button press move event, a mouse wheel press move event, and the like.
Thus, a mode for triggering and sending the current mouse operation event based on the preset mouse event is provided. When a mouse-down event of an input device from the electronic device is received, whether the mouse-down event belongs to a preset mouse event or not is judged, so that the mouse-down event is ensured to be sent to a process corresponding to the first window under the condition that the mouse-down event belongs to the preset mouse event, and the response to the current mouse operation event is smoothly responded in the first window, and the reliability of response processing is improved.
In the embodiment of the application, by setting the event monitor, all types of mouse operation events in the system can be monitored, and further, the subsequent process of sending the mouse operation event is executed aiming at the mouse operation event belonging to the preset mouse event, so that the smooth progress of the mouse operation event is ensured.
S804, the electronic device displays a second window, 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.
In the embodiment of the application, the second window is used for referring to any window newly displayed. In some embodiments, the second window may be an alert window (i.e., a window that includes alert information), a reminder window (i.e., a window that includes reminder information), a session window (i.e., a window that includes session information), and so forth. It should be noted that the first window and the second window may belong to the same window application, or may belong to different window applications.
In some embodiments, after the electronic device displays the second window, the process corresponding to the second window automatically occupies the focus.
The mouse release event is also referred to as the up event of the input device. It should be understood that a mouse release event is an event based on a mouse release operation. In some embodiments, the mouse release event may be a mouse left key release event, a mouse right key release event, or a mouse wheel release event, among others.
The mouse release event may include a mouse button flag (raised), key position information (e.g., left key), and a second position on the corresponding display screen when the mouse is released. The second position is the position coordinate in the corresponding display screen when the mouse is released. Wherein the second location may be represented using two-dimensional coordinates.
In some embodiments, the electronic device includes a system layer. If the user performs the mouse release operation on the input device, the electronic device can detect the mouse release operation of the input device and receive the mouse release event from the input device through the system layer.
Further, in some embodiments, after the system layer receives the mouse release event from the input device, the mouse release event is also sent to the event monitor for the event monitor to perform a subsequent response process.
S805, an event monitor in the electronic device acquires a position detection result of the cursor, wherein the position detection result is used for indicating whether the cursor is displayed on the first object.
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 region may be a region within a preset distance from the center point of the first object, or the preset region may be a rectangular frame region where the first object is located. It should be appreciated that the cursor being displayed in the vicinity of the first object indicates that the cursor is displayed on the first object.
In some embodiments, the event monitor obtains the position detection result of the cursor from a preset function. The preset function is used for detecting the position of the cursor so as to judge whether the cursor is displayed on the first object.
In some embodiments, the process of obtaining the position detection result of the cursor through the preset function may be: and acquiring the cursor position and the rectangular frame position of the first object. Further, a position detection result of the cursor is determined based on the cursor position and the rectangular frame position.
Illustratively, the preset functions may include Get Cursor Pos () functions, which Get Cursor Pos () functions are used to obtain the cursor position. The preset function may further include a Get Window Rect () function, where the Get Window Rect () function is used to obtain a rectangular frame position of the first object. The predetermined function may further include a Pt In Rect function, where the Pt In Rect function is used to compare the cursor position with the rectangular frame position to determine whether the cursor is displayed on the first object. Further, it can be determined whether the cursor is located In the rectangular frame position by Pt In Rect function, so as to obtain the position detection result of the cursor.
It should be noted that, in some embodiments, through a Pt In Rect function, a position detection result of the cursor can also be actively returned to the event monitor, so that the event monitor executes a process of subsequently sending the mouse release event to the process corresponding to the first window.
In the above embodiment, a manner of acquiring the position detection result of the cursor is provided. By comparing the relation between the cursor position and the rectangular frame position of the first object, whether the cursor is displayed on the first object or not can be rapidly and accurately determined, and therefore a position detection result of the cursor is obtained.
S806, the event monitor sends the mouse release event to the process corresponding to the first window under the condition that the cursor is displayed on the first object.
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.
Thus, a way of acquiring event information of the current mouse operation event for the first window is provided. When a mouse release event from an input device of the electronic device is received under the condition that a second window is newly displayed, the mouse release event needs to be sent to a process corresponding to the first window, so that the subsequent process corresponding to the first window processes based on the received mouse release event, and the subsequent process smoothly responds to the current mouse operation event in the first window, and the reliability of response processing is improved.
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, under the condition that the mouse release event belongs to a preset mouse event, the event monitor sends the mouse release event to a process corresponding to the first window.
In the embodiment of the mouse release event, the preset mouse event may also be a mouse release event supported by a preset first window. For example, a left mouse button release operation, a mouse wheel release operation, and the like.
Thus, a mode for triggering and sending the current mouse operation event based on the preset mouse event is provided. When a mouse release event of an input device from the electronic device is received under the condition that a second window is newly displayed, whether the mouse release event belongs to a preset mouse event or not is judged, so that the mouse release event is ensured to be sent to a process corresponding to the first window under the condition that the mouse release event belongs to the preset mouse event, and the response to the current mouse operation event is smoothly responded in the first window, and the reliability of response processing is improved.
In the embodiment shown in S804 to S806, 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. Further, 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. Therefore, under the condition that the second window is newly displayed, the focus can be switched back to the first window by continuously sending the mouse release event to the process corresponding to the first window, so that the problem that the current window does not respond due to the fact that the newly displayed window robs the focus can be solved, and the reliability of response processing is improved.
In addition, in some embodiments, when the electronic device sends the mouse release event to the process corresponding to the first window, the electronic device may also send the mouse release event to the process corresponding to the newly displayed second window. 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 sent to the process corresponding to the newly displayed second window. For another example, the first window may be controlled to respond to the current mouse operation event first, and the second window that is newly displayed responds to the current mouse operation event later. For another example, the first window may be controlled to respond to the current mouse operation event, and the newly displayed second window may not respond to the current mouse operation event. It should be appreciated that the newly displayed second window typically does not respond.
S807, the electronic device responds to the operation of the first object based on the mouse down event and the mouse release event.
In some embodiments, after the process corresponding to the first window receives the mouse down event and the mouse release event, the process responds to the operation of the first object within the first window based on the mouse down event and the mouse release event.
In some embodiments, taking the first position corresponding to the mouse-down event and the second position corresponding to the mouse-up event as examples, the electronic device determines whether the first position and the second position are both located in the first window. Further, the electronic device responds to the operation of the first object within the first window if both the first location and the second location are within the first window.
In this embodiment, whether the mouse pressing event and the mouse releasing event belong to the same mouse operation event is determined by determining whether the first position corresponding to the mouse pressing event and the second position corresponding to the mouse releasing event in the current mouse operation event are both located in the first window, so as to ensure that the response is made to the same mouse operation event, avoid the problem of abnormal response, and improve the reliability of response processing.
In some embodiments, taking the first window as an example of a window including the target control, correspondingly, S807 described above may be replaced by: and under the condition that the first position and the second position are both positioned in the first window, the electronic equipment switches the display state of the target control from a first state to a second state in the first window.
For example, in the context of a word capturing application, the target control may be a copy all control, a translate all control, a read all control, a collect all control, a screen capture word capturing control, and so on. Of course, other controls may be set in addition to the example controls shown above. The setting of the target control is not limited in the embodiment of the application.
The first state is used to indicate that the target control is not 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. As another example, the first state may be a stationary state and the second control may be a jittered state. As another example, the first state may be a normal state and the second control may be a highlighted state. Of course, other states may be set in addition to the example states shown above. The embodiment of the application does not limit the setting of the display state.
For example, in the scenario of the word capturing application, taking the first window as an example of a window including a screen capturing word capturing control, the mouse pressing event is an event based on a mouse pressing operation, and correspondingly, S807 may be replaced by: and switching the display state of the screen capturing word taking control from a gray state to a blue state based on the mouse pressing event and the mouse releasing event.
In the foregoing embodiment, a response processing scheme is provided, where a control window is taken as an example, and the control window that needs to process a current mouse operation event can continuously respond under the condition that a second window is newly displayed, that is, the display state of the target control is switched from a first state to a second state, so that reliability of response processing is improved.
In other embodiments, taking the first window as a text window including text content as an example, the mouse-down event is an event based on a mouse-down and moving operation, and accordingly, S807 can be replaced by: and under the condition that the first position and the second position are both positioned in the first window, the electronic equipment displays a third window in the first window. Wherein the third window includes at least one functionality control associated with the text content.
For example, in the context of a word capturing application, the text window may be a text window displayed in the text word capturing scene, or a picture window including optional text that is newly displayed in the picture word capturing scene.
Also by way of example, in the context of a word-taking application, the third window may be a text word-taking function window. The at least one functionality control included in the third window may include, for example, a copy control, a translate control, a search control, a skip control, a read-aloud control, a collection control, and the like.
In this embodiment, a response processing scheme is provided, where a text window is taken as an example, and the text window that needs to process the current mouse operation event can continue to respond under the condition that a second window is newly displayed, that is, a third window including at least one functional control is displayed, so that reliability of response processing is improved.
Taking a down event and an up event based on a mouse device as an example, if focus is robbed by other newly displayed second windows after the down event occurs in the current first window, the event monitor still sends the up event to a process corresponding to the current first window when the up event occurs. And then, the process corresponding to the current first window responds in the current first window by judging whether the positions of the down event and the up event are both in the current first window or not, if so, the process corresponding to the current first window responds in the current first window.
In the following, when the word capturing application is opened, taking the first object as an example of the word capturing control, taking the first window as an example of the window including the word capturing control, and performing exemplary explanation on a response processing procedure of the window including the word capturing control.
In one example, taking the input device as a mouse device, after the electronic device receives a mouse down event of the mouse device within a window including the screenshot word capturing control, the mouse down event is sent to the window including the screenshot word capturing control. At this point, the focus of the mouse device is on the window that includes the screen capture word control. And under the condition that the electronic equipment displays a second window and the focus is occupied by the second window, after the electronic equipment receives a mouse release event of the mouse equipment in the window comprising the screen capturing word capturing control, judging whether a cursor of the mouse equipment is displayed on the screen capturing word capturing control or not. And if the cursor of the mouse device is displayed on the screen capturing word capturing control, sending the mouse release event to a window comprising the screen capturing word capturing control. At this point, the focus of the mouse device switches back from the second window to the window that includes the screen capture word control. Further, the window including the screen capturing word capturing control switches the screen capturing word capturing control from the gray state to the blue state based on the received mouse down event and the mouse release event.
In the following, when the word taking application is started, taking a first object as a text as an example, taking a first window as a text window as an example, a response processing procedure of the text window is exemplarily described.
In another example, taking the input device as a mouse device, after the electronic device receives a mouse down event of the mouse device within a text window, the mouse down event is sent to the text window. At this time, the focus of the mouse device is on the text window. And under the condition that the electronic equipment displays a second window and the focus is occupied by the second window, judging whether a cursor of the mouse equipment is displayed on a text or not. And if the cursor of the mouse device is displayed on the text, sending the mouse release event to the text window. At this point, the focus of the mouse device switches from the second window back to the text window. Further, the text window displays a text word-taking function window based on the received mouse-down event and the mouse-release event.
According to the technical scheme provided by the embodiment of the application, after the cursor is displayed on the first object of the first window and the mouse pressing event of the input device from the electronic device is received, if the second window is newly displayed and the focus is occupied by the second window, whether the cursor is displayed on the first object or not can be determined to respond to the operation of the first object in the first window by judging whether the cursor is displayed on the first object or not after the mouse releasing event of the input device from the electronic device is received. Further, when the cursor is displayed on the first object, the operation of the first object is responded based on the mouse-down event and the mouse-up event, so that the subsequent response to the current mouse operation event is smoothly performed within the first window. Therefore, by setting the judgment condition of the cursor position, whether the current first window needs to process the current mouse operation event or not can be determined. Furthermore, under the condition of newly displaying the second window, the current first window which needs to process the current mouse operation event is enabled to continuously respond, the problem that the current window does not respond due to the fact that the newly displayed window robs a focus can be solved, and reliability of response processing is improved.
Fig. 9 is an architecture diagram of a response processing method according to an embodiment of the present application, based on a software architecture diagram shown in fig. 7. Referring to fig. 9, taking a layered architecture of a system layer, a middle layer, and an application layer as an example, by setting an event monitor (hook function) in the middle layer, a mouse operation event in the system, such as a mouse down event and a mouse release event of an input device of the electronic device, can be monitored. Further, by determining whether the first window needs to process the mouse operation event, for example, determining whether a cursor of the mouse device is displayed on a first object of the first window. And if the first window needs to process the mouse operation event, triggering the first window to process a mouse response. And if the first window does not need to process the mouse operation event, triggering the automatic circulation of the mouse operation event.
The mouse operation event in the first Window based on the mouse device can be detected through a Window system of the system layer. After detecting a mouse operation event based on the mouse device within the first window, the mouse operation event may be sent to an event monitor of the middle tier via a hook function. Further, referring to the dot-dash flow shown in fig. 9, the event monitor in 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, which indicates that the first window needs to process the mouse operation event, the event monitor sends the mouse operation event to the first window to trigger the first window to process the mouse response. Referring to the dashed flow shown in fig. 9, if the cursor of the mouse device is not displayed on the first object of the first window, it indicates that the first window does not need to process the mouse operation event, the mouse operation event is returned to the system layer, so as to trigger the system layer to send the mouse operation event to the application layer, thereby enabling the mouse operation event to automatically flow to the second window. In this way, it is ensured that the first window responds to the mouse operation event in case a new window is popped up but the first window needs to handle the mouse operation event.
Fig. 10 is an architecture interaction diagram of a response processing method according to an embodiment of the present application. Referring to fig. 10, taking an input device as an example of a mouse device and taking an interaction flow among a system layer, an intermediate layer and an application layer as an example, the method includes the following steps S1001-S1015:
s1001, the application layer displays a first window, and a cursor is displayed on a first object of the first window.
S1002, the user performs mouse pressing operation in a first window based on the mouse device.
S1003, after the system layer detects the mouse pressing operation of the mouse device in the first window, a mouse pressing event from the mouse device is received.
S1004, the system layer sends the mouse-down event to the event monitor of the middle layer.
S1005, the event monitor receives the mouse-down event and judges whether the mouse-down event belongs to a preset mouse event.
S1006, under the condition that the mouse-down event belongs to a preset mouse event, the event monitor sends the mouse-down event to a process corresponding to a first window of an application layer.
S1007, the process corresponding to the first window receives and records the mouse down event.
S1008, the application layer displays a second window, and the focus is occupied by the second window.
S1009, the user performs a mouse release operation in the first window based on the mouse device.
S1010, after detecting the mouse release operation based on the mouse device in the first window, the system layer receives a mouse release event from the mouse device.
S1011, the system layer sends the mouse release event to the event monitor.
S1012, the event monitor receives the mouse release event and judges whether the mouse release event belongs to a preset mouse event.
S1013, under the condition that the mouse release event belongs to a preset mouse event, the event monitor acquires the position detection result of the cursor.
S1014, when the position detection result of the cursor 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.
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 pressing event and the mouse release event.
Compared with the scheme in the related art, under the condition that the focal point of the window is changed, the mouse release event originally sent to the first window is sent to the newly displayed second window, so that the first window cannot acquire the mouse release event of the mouse device, and the problem that the first window does not respond is caused. The technical scheme provided by the application can solve the problem that the current first window does not respond because the newly displayed second window robs the focus.
Fig. 11 is a schematic diagram of a frame of a response processing apparatus according to an embodiment of the present application. Referring to fig. 11, the response processing apparatus includes a display module 1101, a receiving module 1102, and a response module 1103. Wherein,
A display module 1101, configured to display a first window, and display a cursor on a first object of the first window;
a receiving module 1102, configured to receive a mouse-down event from an input device of the electronic device;
the display module 1101 is further configured to display a second window, and the focal point is occupied by the second window, where the electronic device receives a mouse release event from an input device of the electronic device;
A response module 1103, configured to respond to the operation of the first object based on the mouse down event and the mouse release event, in a case where the cursor is displayed on the first object.
According to the technical scheme provided by the embodiment of the application, after the cursor is displayed on the first object of the first window and the mouse pressing event of the input device from the electronic device is received, if the second window is newly displayed and the focus is occupied by the second window, whether the cursor is displayed on the first object or not can be determined to respond to the operation of the first object in the first window by judging whether the cursor is displayed on the first object or not after the mouse releasing event of the input device from the electronic device is received. Further, when the cursor is displayed on the first object, the operation of the first object is responded based on the mouse-down event and the mouse-up event, so that the subsequent response to the current mouse operation event is smoothly performed within the first window. Therefore, by setting the judgment condition of the cursor position, whether the current first window needs to process the current mouse operation event or not can be determined. Furthermore, under the condition of newly displaying the second window, the current first window which needs to process the current mouse operation event is enabled to continuously respond, the problem that the current window does not respond due to the fact that the newly displayed window robs a focus can be solved, and reliability of response processing is improved.
In some embodiments, the electronic device includes an event monitor for monitoring a mouse down event and a mouse release event of an input device of the electronic device;
the device also comprises a sending module for:
The event monitor sends the mouse-down event and the mouse-release event to a process corresponding to the first window.
In some embodiments, the sending module is specifically configured to:
And under the condition that the mouse pressing event and the mouse releasing event belong to preset mouse events, the event monitor sends the mouse pressing event and the mouse releasing event to a process corresponding to the first window.
In some embodiments, the apparatus further comprises a switching module for:
The focus is switched from the second window to the first window.
In some embodiments, the apparatus further comprises an acquisition module for:
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.
In some embodiments, the mouse down event comprises a first location in the corresponding display screen when the mouse is down, and the mouse down event comprises a second location in the corresponding display screen when the mouse is down;
The response module 1103 is specifically configured to:
The electronic device responds to the operation of the first object in the first window under the condition that the first position and the second position are both positioned in the first window.
In some embodiments, the first window is a window that includes a target control;
The response module 1103 is specifically configured to:
And under the condition that the first position and the second position are both positioned in the first window, the electronic equipment switches the display state of the target control from a first state to a second state in the first window.
In some embodiments, the first window is a window comprising text content;
The response module 1103 is specifically configured to:
In the case that 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, wherein the third window comprises at least one function control related to the text content.
It will be appreciated that, in order to implement the above-described functions, the electronic device (such as a terminal) in the embodiment of the present application includes corresponding hardware structures and/or software modules that perform the respective functions. Those of skill in the art will readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the embodiments of the present application.
The embodiment of the application also provides electronic equipment, which comprises: a display screen, a memory and a processor. The display screen is used for providing a display function. The processor is connected with the memory, the memory is used for storing program codes, and the processor executes the program codes stored in the memory, so that the response processing method provided by the embodiment of the application is realized.
The embodiment of the application also provides a computer readable storage medium, and the computer readable storage medium stores program code thereon, when the program code runs on the electronic device, the electronic device is caused to execute the functions or steps executed by the electronic device in the above method embodiment.
The embodiment of the application also provides a computer program product, which comprises program code, when the program code runs on the electronic device, causes the electronic device to execute the functions or steps executed by the electronic device in the embodiment of the method.
The electronic device, the computer readable storage medium or the computer program product provided by the embodiments of the present application are configured to execute the corresponding method provided above, and therefore, the beneficial effects achieved by the electronic device, the computer readable storage medium or the computer program product can refer to the beneficial effects in the corresponding method provided above, and are not repeated herein.
It will be apparent to those skilled in the art from this disclosure that, for convenience and brevity, only the above-described division of functional modules is illustrated, and in practical applications, the above-described functional allocation may be performed by different functional modules, that is, the internal structure of the apparatus (e.g., electronic device) is divided into different functional modules, so as to perform all or part of the above-described functions. The specific working processes of the above-described system, apparatus (e.g., electronic device) and unit may refer to the corresponding processes in the foregoing method embodiments, which are not described herein again.
In the several embodiments provided herein, it should be understood that the disclosed systems, apparatuses (e.g., electronic devices) and methods may be implemented in other ways. For example, the above-described embodiments of an apparatus (e.g., an electronic device) are merely illustrative, and the division of the module or unit is merely a logical function division, and may be implemented in other ways, such as multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of 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.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method of the various embodiments of the present application. And the aforementioned storage medium includes: flash memory, removable hard disk, read-only memory, random access memory, magnetic or optical disk, and the like.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (9)
1. A response processing method, characterized by being applied to an electronic device, the method comprising:
The electronic equipment displays a first window, and a cursor is displayed on a first object of the first window;
the electronic equipment receives a mouse-down event from an input device of the electronic equipment;
The electronic equipment 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, wherein the second window is any newly displayed window;
the electronic device receives a mouse release event from an input device of the electronic device;
And judging whether the cursor is displayed on the first object, and switching the focus from the process corresponding to the second window to the process corresponding to the first window under the condition that the cursor is displayed on the first object, wherein the electronic equipment responds to the operation of the first object based on the mouse pressing event and the mouse releasing event.
2. The method of claim 1, wherein the electronic device comprises an event monitor for monitoring a mouse down event and a mouse release event of an input device of the electronic device;
The method further comprises the steps of:
And the event monitor sends the mouse pressing event and the mouse releasing event to a process corresponding to the first window.
3. The method of claim 2, wherein the event monitor sending the mouse down event and the mouse release event to a process corresponding to the first window comprises:
And under the condition that the mouse pressing event and the mouse releasing event belong to preset mouse events, the event monitor sends the mouse pressing event and the mouse releasing event to a process corresponding to the first window.
4. The method of claim 2, wherein after the electronic device receives a mouse release event from an input device of the electronic device, the method further comprises:
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 of claim 1, wherein the mouse-down event comprises a first location in the corresponding display screen when the mouse is down, and wherein the mouse-down event comprises a second location in the corresponding display screen when the mouse is down;
the electronic device responding to the operation of the first object based on the mouse-down event and the mouse-release event, comprising:
The electronic device is responsive to operation of the first object within the first window if both the first location and the second location are within the first window.
6. The method of claim 5, wherein the first window is a window comprising a target control;
The electronic device responding to the operation of the first object in the first window under the condition that the first position and the second position are both positioned in the first window, comprising:
and under the condition that the first position and the second position are both positioned in the first window, the electronic equipment switches the display state of the target control from a first state to a second state in the first window.
7. The method of claim 5, wherein the first window is a window comprising text content;
The electronic device responding to the operation of the first object in the first window under the condition that the first position and the second position are both positioned in the first window, comprising:
And under the condition that the first position and the second position are both positioned in the first window, the electronic equipment displays a third window in the first window, wherein the third window comprises at least one function control related to the text content.
8. An electronic device comprising a display screen, a memory, and a processor; the display screen is used for providing a display function; the memory is used for storing program codes; the processor is configured to invoke the program code to perform the method of any of claims 1-7.
9. A computer readable storage medium comprising program code which, when run on an electronic device, causes the electronic device to perform the method of any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310947660.XA CN117707395B (en) | 2023-07-29 | 2023-07-29 | Response processing method, electronic device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310947660.XA CN117707395B (en) | 2023-07-29 | 2023-07-29 | Response processing method, electronic device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117707395A CN117707395A (en) | 2024-03-15 |
CN117707395B true CN117707395B (en) | 2024-11-15 |
Family
ID=90143033
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310947660.XA Active CN117707395B (en) | 2023-07-29 | 2023-07-29 | Response processing method, electronic device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117707395B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1560747A (en) * | 2004-02-24 | 2005-01-05 | 皓 于 | Method for enhancement of function of mouse roller |
CN109145273A (en) * | 2018-07-27 | 2019-01-04 | 广州视源电子科技股份有限公司 | Comment following display method, device, equipment and storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5721849A (en) * | 1996-03-29 | 1998-02-24 | International Business Machines Corporation | Method, memory and apparatus for postponing transference of focus to a newly opened window |
-
2023
- 2023-07-29 CN CN202310947660.XA patent/CN117707395B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1560747A (en) * | 2004-02-24 | 2005-01-05 | 皓 于 | Method for enhancement of function of mouse roller |
CN109145273A (en) * | 2018-07-27 | 2019-01-04 | 广州视源电子科技股份有限公司 | Comment following display method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN117707395A (en) | 2024-03-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2023279820A1 (en) | Method for adjusting touch panel sampling rate, and electronic device | |
CN117008777A (en) | Cross-equipment content sharing method, electronic equipment and system | |
CN111835530B (en) | Group joining method and device | |
CN113852714B (en) | Interaction method for electronic equipment and electronic equipment | |
CN114077529B (en) | Log uploading method and device, electronic equipment and computer readable storage medium | |
US11893302B2 (en) | Content transmission method and terminal device | |
WO2021000943A1 (en) | Method and apparatus for managing fingerprint switch | |
WO2022143094A1 (en) | Window page interaction method and apparatus, electronic device, and readable storage medium | |
CN113885973B (en) | Translation result display method and device and electronic equipment | |
CN116991274B (en) | A method for handling exceptions in upward sliding effects and electronic equipment | |
CN117707395B (en) | Response processing method, electronic device and storage medium | |
CN111626035B (en) | Layout analysis method and electronic equipment | |
CN114690985B (en) | Display method and electronic equipment | |
CN111475363B (en) | Card death recognition method and electronic equipment | |
CN116028966A (en) | Application display method, electronic equipment and storage medium | |
CN115730091A (en) | Comment display method and device, terminal device and readable storage medium | |
EP4116809B1 (en) | Display method and electronic device | |
CN116719468B (en) | Interaction event processing method and device | |
EP4116810B1 (en) | Display method and electronic device | |
CN114968059B (en) | Control sliding method and electronic equipment | |
CN117135729B (en) | Multi-device cooperation method, system and terminal device | |
CN118444865B (en) | Data processing method and electronic equipment | |
CN114006969B (en) | Window starting method and electronic equipment | |
CN119718149A (en) | Data dragging method, electronic equipment and storage medium | |
CN118277335A (en) | Data management method, graphic interface and related device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address |
Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Patentee after: Honor Terminal Co.,Ltd. Country or region after: China Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong Patentee before: Honor Device Co.,Ltd. Country or region before: China |
|
CP03 | Change of name, title or address |