A control method and device
By acquiring and processing the position information of the touch operation in the electronic device, directly switching and tracking the status of the editable area, data input can be completed in one touch operation, which solves the problem of low data input efficiency in the existing technology and improves input efficiency. Efficiency and simplicity.
Patent Information
- Application Number
- CN202210173076.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-24
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2042-02-24
AI Technical Summary
Existing electronic equipment requires two steps for data input, which is inefficient and the data input method is not concise enough.
By obtaining the position information of the touch operation, if it is located in the track input area of the editable area in the non-focused state, it will be directly switched to the focused state, and the track information of the touch operation will be tracked and identified, so that data input can be completed with one touch operation. .
The data input process is simplified, the data input efficiency is improved, and the problem of low data input efficiency in the existing technology is solved.
Smart Images

Figure CN114594889B
Abstract
Description
Technical Field
[0001] The present application relates to the field of information processing technology, and in particular to a control method and device. Background Art
[0002] When a user uses an electronic device to perform data input operations, the user usually needs to first select an editable area through a touch or key operation, and then perform the data input operation through a second touch or key operation. This data input method is not concise enough. Summary of the invention
[0003] Based on the above problems, an embodiment of the present application provides a control method and device.
[0004] The technical solution provided by the embodiment of the present application is as follows:
[0005] The present application provides a control method, the method comprising:
[0006] A touch operation is obtained;
[0007] If the position information of the touch operation indicates that the touch operation is located in a track input area corresponding to an editable area in a non-focused state in the display window, controlling the editable area to switch to a focused state;
[0008] Tracking the touch operation in the track input area based on the position information of the touch operation to obtain track information of the touch operation;
[0009] Identify the trajectory information and obtain an identification result;
[0010] The recognition result is transmitted to the editable area so that the editable area displays the recognition result.
[0011] The present application also provides a control device, including:
[0012] An acquisition module, used to acquire a touch operation;
[0013] a control module, configured to control the editable area to switch to a focused state if the position information of the touch operation indicates that the touch operation is located in a track input area corresponding to an editable area in a non-focused state in the display window;
[0014] A tracking and identifying module, configured to track the touch operation in the track input area based on the position information of the touch operation to obtain track information of the touch operation; and to identify the track information to obtain an identification result;
[0015] The transmission module is used to transmit the recognition result to the editable area so that the editable area displays the recognition result.
[0016] An embodiment of the present application also provides an electronic device, including a processor and a memory; a computer program is stored in the memory; when the computer program is executed by the processor, it can implement any of the control methods described above.
[0017] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor of an electronic device, the control method as described above can be implemented.
[0018] From the above, it can be seen that the control method provided in the embodiment of the present application, when a touch operation is detected on the trajectory input area corresponding to the editable area in the non-focused state in the display window, directly controls the editable area to switch from the non-focused state to the focused state, and tracks the trajectory information of the touch operation and further identifies the trajectory information to obtain an identification result, so that through a single touch operation, not only the editable area in the display window can be switched to the focused state, but also the trajectory information of the touch operation can be tracked and identified, which simplifies the data input process, improves the efficiency of data input, and solves the technical problem of low data input efficiency caused by requiring two steps to perform data input operations on the editable area of the electronic device in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 A flow chart of a control method provided in an embodiment of the present application;
[0020] Figure 2 A schematic diagram of a flow chart of controlling an editable area to switch to a focus state provided in an embodiment of the present application;
[0021] Figure 3 A schematic diagram of a process for obtaining trajectory information of a touch operation provided in an embodiment of the present application;
[0022] Figure 4 Another schematic diagram of a process for obtaining track information of a touch operation provided in an embodiment of the present application;
[0023] Figure 5 Another schematic diagram of a control method according to an embodiment of the present invention;
[0024] Figure 6 A schematic diagram of the structure of a control device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0026] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0027] The present application relates to the field of information technology, and in particular to a control method and device.
[0028] For some electronic devices that provide a human-computer interaction mechanism and can receive user input data, if the user wants to input data to the electronic device through the display area of the electronic device, the user usually needs to first perform a touch or key operation in the editable area displayed by the electronic device to switch the display area to a focused state, and then perform a second touch or key operation before the editable area can receive the user's input data. This data input method is not concise and inefficient.
[0029] Based on the above problems, an embodiment of the present application provides a control method and device.
[0030] The control method provided in the embodiment of the present application can be implemented by a processor of an electronic device. It should be noted that the processor of the electronic device can be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, and a microprocessor.
[0031] Exemplarily, the above-mentioned electronic device may include a device with a human-computer interaction mechanism and capable of receiving, tracking and identifying touch operations performed by a user; exemplary, the above-mentioned electronic device may be a computer device; exemplary, the above-mentioned electronic device may also be a mobile intelligent terminal, such as a smart phone or a tablet electronic device, etc., which is not limited to the embodiments of the present application.
[0032] Exemplarily, the electronic device may detect the user's touch operation through a touch detection function of the display device.
[0033] Figure 1The following is a flow chart of the control method provided in the embodiment of the present application. Figure 1 As shown, the method may include steps 101 to 105:
[0034] Step 101: Acquire a touch operation.
[0035] In one embodiment, the touch operation may be a sliding or clicking operation on the display area of the electronic device; exemplarily, the touch operation may be a manual input by a user into the display area of the electronic device; exemplarily, the user may touch the display area of the electronic device with a hand to trigger the touch operation, and may also touch the display area of the electronic device through an input device such as a stylus to trigger the touch operation.
[0036] Step 102: If the position information of the touch operation indicates that the touch operation is located in the track input area corresponding to the editable area in the display window that is in a non-focused state, control the editable area to switch to a focused state.
[0037] Correspondingly, if the position information of the touch operation indicates that the touch operation is located in other areas of the display window except the track input area corresponding to the editable area, the editable area may not be controlled to switch to the focus state.
[0038] In one embodiment, the position information of the touch operation may include the relative position of the execution position of the touch operation with respect to a specified point of the display area; exemplarily, the specified point of the display area may include at least one corner point of the display screen, or may include the geometric center point of the display screen; exemplarily, the position information of the touch operation may be expressed in the form of two-dimensional coordinates.
[0039] In one implementation, the display window may include any window in a front display state on a display screen of the electronic device, that is, the display window may be any user-operable window among multiple windows displayed on the electronic device.
[0040] In one embodiment, the display window may include at least one editable area; exemplarily, the editable area may include an area capable of providing editing functions; exemplarily, the editing functions include text editing / input and graphic editing, etc.; exemplarily, graphic editing may include editing operations on graphics and / or images such as graphic drawing and graphic modification.
[0041] In one implementation, the editable area may include an area capable of displaying the editing result of the user, such as a text editing box of a notepad application.
[0042] In one embodiment, the electronic device may continuously collect window node control parameters of any window created and / or displayed by the electronic device, such as a display window, through a system accessibility service (AccessibilityService), and determine whether any window, such as a display window, contains an editable area, as well as location information of the editable area, etc. based on the window node control parameters; illustratively, the above-mentioned collection operation of the electronic device may be performed dynamically, such as dynamically collecting window node control parameters of the window according to the order in which the window is created and / or displayed during the user's use of the electronic device.
[0043] In one implementation, the track input area may be an editable area. In this case, the editable area may be an area capable of displaying the user's editing track, such as a graphics drawing area in a drawing application.
[0044] In one embodiment, the trajectory input area may be an area different from the editable area, in which case the trajectory input area may be associated with the editable area; exemplarily, the trajectory input area may be located in or include a peripheral area of the editable area; exemplarily, if the editable area is the area where the search control is located, the trajectory input area may be located in or include an area adjacent to the search control; exemplarily, the electronic device may also obtain the user's editing habits during the user's editing process, and create a trajectory input area associated with the editable area in the display window according to the user's editing habits.
[0045] In one implementation, the electronic device may obtain state parameters of the editable area in the display window, thereby determining whether the editable area is in a non-focused state.
[0046] In one implementation, the electronic device may obtain the position information of the track input area, and compare the position information of the touch operation with the position information of the track input area to determine whether the position area of the touch operation is located in the track input area, that is, whether the touch operation is directed to the editable area.
[0047] In one embodiment, controlling the editable area to switch to a focused state can be reflected by displaying an icon of an input device in the editable area; for example, in the case where the input device is an input pen, the icon of the input device can be a cursor. At this time, the cursor of the input pen can be displayed in a flashing form in the editable area to prompt the user that the editable area is switched to a focused state.
[0048] Step 103: Track the touch operation in the track input area based on the position information of the touch operation to obtain track information of the touch operation.
[0049] In one embodiment, the trajectory information of the touch operation can be any shape such as a straight line, a curve, and a point; illustratively, the trajectory information of the touch operation can include any combination of at least two of the straight line, the curve, and the point, which is not limited in this embodiment of the present application.
[0050] In one implementation, tracking the touch operation in the track input area based on the position information of the touch operation to obtain the track information of the touch operation may be implemented in the following manner:
[0051] The position corresponding to the position information of the touch operation is used as the starting point of the touch operation, and the touch operation is continuously tracked in the track input area. When the touch operation switches to a key release operation such as a KEY_UP event, the track information of the touch operation is obtained based on the starting point and the touch track obtained by continuously tracking the touch operation.
[0052] Step 104: Identify the trajectory information and obtain a recognition result.
[0053] In one implementation, the recognition result may be consistent with the trajectory graphic corresponding to the trajectory information. For example, when the editable area is a graphic drawing area, the recognition result obtained by recognizing the trajectory information may be a graphic drawn by the user.
[0054] In one embodiment, the recognition result may be inconsistent with the trajectory graphic corresponding to the trajectory information; exemplarily, when the editable area is a text editing area, the trajectory information may include a first type of text trajectory input by the user, and the recognition result obtained by recognizing the first type of text trajectory may be a second type of text trajectory; wherein the first type may be, for example, cursive script; the second type may be a pre-set or preferred data display format for the editable area, for example, the second type may be regular script.
[0055] Step 105: Transmit the recognition result to the editable area so that the editable area displays the recognition result.
[0056] In one embodiment, since the editable area is in a focused state and the touch operation is a trajectory input area for the editable area, the electronic device can set the target area for receiving the recognition result as the editable area of the display window, and then transmit the recognition result to the editable area through the message transmission mechanism provided by the operating system (OS) of the electronic device; after receiving the recognition result, the editable area can display the recognition result in the editable area.
[0057] In one embodiment, after receiving the recognition result, the editable area can process the recognition result according to the data volume of the recognition result and the display parameters set in the editable area to improve the display effect of the recognition result. For example, when the recognition result is text data and the data volume of the text data exceeds the data volume threshold, the editable area can adjust the text data according to the display parameters to achieve multi-line display of the text data.
[0058] From the above, it can be seen that in the control method provided in the embodiment of the present application, when a touch operation is obtained and the position information of the touch operation indicates that the touch operation is located in the track input area corresponding to the editable area in the non-focused state in the display window, the editable area can be controlled to switch to a focused state, and the touch operation can be tracked in the track input area based on the position information of the touch operation to obtain the track information of the touch operation, and then the track information is identified to obtain the recognition result and the recognition result is transmitted to the editable area for display.
[0059] In this way, the control method provided in the embodiment of the present application, when detecting a touch operation on the trajectory input area corresponding to the editable area in the non-focused state in the display window, directly controls the editable area to switch from the non-focused state to the focused state, tracks the trajectory information of the touch operation and further identifies the trajectory information to obtain an identification result, so that through a single touch operation, not only the editable area in the display window can be switched to the focused state, but also the trajectory information of the touch operation can be tracked and identified, which simplifies the data input process, improves the efficiency of data input, and solves the technical problem of low data input efficiency caused by requiring two steps to perform data input operations on the editable area of the electronic device in the related art.
[0060] Based on the above embodiments, in the control method provided in the embodiments of the present application, if the position information of the touch operation indicates that the touch operation is located in the track input area corresponding to the editable area in the non-focused state in the display window, the editable area is controlled to switch to the focused state, which can be achieved by Figure 2 The process shown is implemented as follows, Figure 2 A schematic diagram of a process for controlling an editable area to switch to a focus state provided in an embodiment of the present application, such as Figure 2 As shown, the process may include steps 1021 to 1022:
[0061] Step 1021: If the position information of the touch operation indicates that the touch operation is located in the track input area, create a key event and a key release event associated with the editable area based on the position information of the touch operation.
[0062] Correspondingly, if the position information of the touch operation indicates that the touch operation is not located in the track input area, it is not necessary to create a key event and a key release event associated with the editable area.
[0063] In one embodiment, the key event and the key release event associated with the editable area may be standard events related to the key operation in the OS of the electronic device; exemplarily, the above-mentioned key event may be created by the electronic device according to the position information of the touch operation when it is determined that the position information of the touch operation is located in the track input area; exemplarily, the above-mentioned key event may be a KEY_DOWN event; exemplarily, the above-mentioned key release event may be a KEY_UP event.
[0064] In one embodiment, the key event associated with the editable area can be triggered by the touch operation itself, that is, the key event associated with the editable area is created by the electronic device automatically triggering the window message processing mechanism of the electronic device when the electronic device detects the touch operation.
[0065] In one embodiment, a key release event associated with an editable area may represent a key release event for a trajectory input area corresponding to a touch operation, which is simulated by the electronic device when the electronic device detects a touch operation and the touch operation has not switched to a key release state; in this way, a key event associated with an editable area, which is created by the electronic device based on the position information of the touch operation, and a key release event associated with the editable area, which is simulated by the electronic device, may constitute a standard trigger event that can be recognized by the OS of the electronic device to switch the editable area from a non-focused state to a focused state.
[0066] Step 1022: Based on the key event and the key release event associated with the editable area, control the editable area to switch to a focused state.
[0067] In one embodiment, the window message processing mechanism in the OS of the electronic device, when it is determined that the position information of the touch operation is located in the track input area and the editable area is in a non-focused state, can automatically trigger the editable area to switch from a non-focused state to a focused state based on the key events generated according to the position information of the touch operation and the simulated key release events. That is to say, the conditions for switching the focus state of the editable area are created by associating the key events and key release events to the editable area.
[0068] From the above, it can be seen that in the control method provided in the embodiment of the present application, when the electronic device determines that the position information of the touch operation is located in the track input area and the editable area is in a non-focused state, it can create a key event and a key release event associated with the editable area, so that through the key event corresponding to a touch operation and the simulated key release event corresponding to the touch operation, it is possible to quickly create the conditions for controlling the focus state switching of the editable area; and, since the key event and the key release event associated with the editable area are standard conditions for controlling the focus state switching of the editable area in the OS of the electronic device, it is also possible to make full use of the focus state switching conditions in the OS of the electronic device, thereby improving the accuracy and stability of the control of the focus state switching of the editable area.
[0069] In the control method provided in the embodiment of the present application, the target window can be created in the following manner:
[0070] If the position information of the touch operation indicates that the touch operation is located in a track input area corresponding to an editable area in a non-focused state in the display window, a target window is created.
[0071] The target window at least covers the trajectory input area.
[0072] Correspondingly, if the position information of the touch operation indicates that the touch operation is not located in the track input area, or the editable area in the display window is already in a focused state, then the target window may not be created.
[0073] In one implementation, the target window may only cover the track input area; illustratively, the target window may also cover the track input area and the editable area; illustratively, the target window may also cover the entire window area of the display window.
[0074] In one implementation, when the editable area in the display window is in a non-focused state and the position information of the touch operation indicates that the touch operation is located in the track input area corresponding to the editable area, a target window may be created through a window management mechanism of the electronic device.
[0075] In one implementation, if the display window includes at least one editable area, and any editable area is in a non-focused state, then a target window that only covers the editable area in the non-focused state may be created.
[0076] From the above, it can be seen that in the control method provided in the embodiment of the present application, when the editable area in the display window is in a non-focused state and the position information of the touch operation is located in the trajectory input area corresponding to the editable area, a target window that at least covers the estimated input area can be created.
[0077] In this way, on the one hand, the target window is created according to the actual state of the editable area in the display window, thereby realizing on-demand creation of the target window and reducing the memory consumption of the electronic device; on the other hand, since the target window at least covers the track input area and the transparency of the target window is greater than or equal to the transparency threshold, the influence of the target window on the track input area can be weakened.
[0078] In the control method provided in the embodiment of the present application, the target window can also be created in the following manner:
[0079] After the OS booting of the electronic device is completed, a target window is created.
[0080] The target window covers a display area of a display device of the electronic device.
[0081] In one implementation, the display device of the electronic device may be a display screen; and the display area of the display device of the electronic device may include the entire data output area of the display screen.
[0082] In one implementation, when the OS of the electronic device is started and the window management mechanism of the electronic device is ready, the window management mechanism of the electronic device can be triggered to create a target window and set the target window to the top display state.
[0083] In one embodiment, when an electronic device creates any number of windows, the target windows can all be in the top display state. In this way, when the display window includes an editable area in a non-focused state and the position information of the touch operation is located in the track input area corresponding to the editable area, the target area can be quickly determined from the target window in the top display state, thereby laying a foundation for real-time tracking of the track information of the touch operation.
[0084] As can be seen from the above, in the control method provided in the embodiment of the present application, after the electronic device OS is started, a target window is created that is in the top display state and covers the display area of the display device of the electronic device. In this way, when any display window includes an editable area in a non-focused state and the position information of the touch operation is located in the track input area corresponding to the editable area, the target area corresponding to the track input area can be determined from the target window in real time, thereby improving the efficiency of tracking the track information of the touch operation.
[0085] Based on the above embodiments, in the control method provided in the embodiments of the present application, creating a target window can be achieved in the following ways:
[0086] Create a target window through the target input method.
[0087] The target input method is different from the default input method set in the electronic device.
[0088] In one implementation, the default input method may be an input method that is pre-set in the electronic device and has a higher priority.
[0089] In one implementation, after the trajectory information of the touch operation is detected and determined, a target window may be created through a target input method.
[0090] In one implementation, after the OS of the electronic device is started and the window processing mechanism of the electronic device is ready, a target window may be created through a target input method.
[0091] In one embodiment, after the OS of the electronic device is started, the target input method can be controlled to switch to a ready state. After the window processing mechanism of the electronic device is ready, or after the trajectory information of the touch operation is detected, the target window can be created through the target input method.
[0092] In one embodiment, the target input method may be an application pre-set in the electronic device. Exemplarily, the target input method may be a system application set in the electronic device; Exemplarily, the target input method may be a user application installed by the user; Exemplarily, the OS of the electronic device may detect whether the target input method is set in the electronic device. If the target input method is set, the target window may be created through the target input method.
[0093] From the above, it can be seen that in the control method provided in the embodiment of the present application, the target window for tracking the trajectory information of the touch operation is created through the target input method. In this way, a specific creation method of the target window is provided. Then, by controlling the target input method, flexible control of the target window creation can be achieved.
[0094] Based on the above embodiments, in the control method provided in the embodiments of the present application, the touch operation is tracked in the track input area based on the position information of the touch operation to obtain the track information of the touch operation, which can be obtained by Figure 3 The process shown is a manifestation of Figure 3 A schematic diagram of a process for obtaining track information of a touch operation provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the process may include steps 1031 to 1033:
[0095] Step 1031, obtaining the position information of the trajectory input area;
[0096] In an implementation, the position information of the track input area may be obtained by analyzing the parameter values of the attribute parameters of the window elements in the display window; illustratively, the position information of the track input area may include the position information of the edge of the track input area.
[0097] Step 1032: Based on the position information of the track input area, determine a target area corresponding to the track input area from the target window in the top display state.
[0098] The transparency of the target window is greater than or equal to the transparency threshold.
[0099] In one implementation, the Z-order of the target window may be the highest value among the Z-orders of all windows currently displayed by the electronic device, and the target window may be in a top-level display state.
[0100] In one embodiment, the target window may be in a completely transparent state, so that the target window may not block the data displayed in the display area of the electronic device; illustratively, the target window may be in a semi-transparent state, for example, the target window may be displayed with a transparency and / or color set by the user, which, on the one hand, reduces the probability of the target window blocking the data displayed in the display area of the electronic device, and on the other hand, can also achieve personalized setting and flexible adjustment control of the target window parameters.
[0101] In one implementation, based on the position information of the track input area, determining the target area corresponding to the track input area from the target window in the top display state may be implemented in any of the following ways:
[0102] When the target window in the top-level display state completely covers the display window of the electronic device, the position information of the target area corresponding to the track input area can be determined from the target window based on the position information of the track input window. At this time, the position information of the target area can be completely consistent with the position information of the track input area.
[0103] If the target window in the top-level display state does not completely cover the display window, the display area of the target window can be adjusted, such as moving the target window until it covers the display window, or expanding the area of the target window until it covers the display window, and then determining the target area whose position information is consistent with the position information of the trajectory input area from the target window.
[0104] Step 1033: Track the touch operation in the target area based on the position information of the touch operation to obtain trajectory information of the touch operation.
[0105] In one embodiment, after the target area is determined, the electronic device can transmit the position information of the touch operation from the track input area to the target area, and use the position information of the touch operation as a starting point to detect and track the touch operation in the target area, thereby obtaining track information of the touch operation.
[0106] In one implementation, after the track information of the touch operation is obtained, the track information of the touch operation may also be displayed in the target area.
[0107] In one embodiment, after obtaining the trajectory information of the touch operation, the trajectory information of the touch operation can be transmitted to the trajectory input area, and the trajectory information of the touch operation can be displayed in the trajectory input area. Since the transparency of the target window is greater than or equal to the transparency threshold, the trajectory information of the touch operation in the trajectory input area will not be blocked by the target area or the target window.
[0108] From the above, it can be seen that the control method provided by the embodiment of the present application, after obtaining the position information of the track input area, can determine the target area corresponding to the track input area from the target window in the top display state based on the position information of the track input area, and track the touch operation based on the position information of the touch operation in the target area, thereby obtaining the track information of the touch operation. Therefore, the control method provided by the embodiment of the present application, through the target area corresponding to the track input area in the target window, realizes the interception and acquisition of the track information of the touch operation through the target window in the top display state, thereby providing convenient conditions for the identification of the track information of the touch operation.
[0109] Based on the above embodiments, in the control method provided in the embodiments of the present application, the touch operation is tracked based on the position information of the touch operation in the target area to obtain the trajectory information of the touch operation. Figure 4 The process shown is implemented as follows, Figure 4 Another schematic diagram of a process for obtaining track information of a touch operation provided by an embodiment of the present application. Figure 4 As shown, the process may include steps 10331 to 10334:
[0110] Step 10331: Create a key event associated with the target window based on the position information of the touch operation.
[0111] In one implementation, the electronic device may transmit the position information of the touch operation to the target window; illustratively, the electronic device may also add the position information of the touch operation to a key event associated with the target window.
[0112] In one embodiment, a key event associated with a target window can bind a touch operation to the target window, so that when the position information of the touch operation changes in the track input area or the target area, the position information of the touch operation can be transmitted to the target area of the target window in real time.
[0113] In one implementation, the operation of creating a key event associated with a target window based on the position information of the touch operation may be implemented through a window processing mechanism and a message processing mechanism of the electronic device.
[0114] In one embodiment, the key event created by the electronic device to associate with the target window is simulated by the window message processing mechanism in the electronic device when the touch operation has not switched to the key release state. That is to say, in the embodiment of the present application, the key event associated with the target window does not need to be triggered by a secondary key of the touch operation. Therefore, in the control method provided in the embodiment of the present application, the electronic device can associate the current touch operation with the target window by simulating the key event of the touch operation through software without relying on the secondary key trigger of the touch operation.
[0115] In one implementation, the key event associated with the target window may be a standard key event in the window management mechanism of the electronic device, such as a KEY_DOWN event.
[0116] Step 10332: Track the position movement information of the touch operation in the target area.
[0117] For example, by creating a key event associated with a target window based on the position information of the touch operation, the electronic device can bind the touch operation to the target window. When the touch operation position information moves in the target area, the position movement information of the touch operation can be tracked in the target area through the window management mechanism and message transmission mechanism of the electronic device.
[0118] In one implementation, the position movement information of the touch operation may include the speed of the touch operation during the movement, the size of the contact area between the touch operation and the target area during the movement, whether the touch operation stops during the movement, and the stop time of the touch operation.
[0119] Step 10333: If it is detected that the touch operation switches to the key release state, create a key release event associated with the target window.
[0120] In one embodiment, if the electronic device cannot detect a touch operation in the target area, the electronic device determines that the detected touch operation switches to a key release event; exemplarily, the electronic device cannot detect a touch operation in the target area, which may include the touch operation switching to a key release state such as a state where the user's finger is lifted or the input pen is lifted; exemplarily, the electronic device cannot detect a touch operation in the target area, which may also include the touch operation switching from the target area to other areas of the target window.
[0121] In one implementation, the key release event associated with the target window may be a standard key release event in the electronic device such as a KEY_UP event.
[0122] In one embodiment, the key release event associated with the target window can be a KEY_UP event triggered by the lifting of the touch operation in the target area, or it can be a KEY_UP event simulated by the electronic device triggered by the touch operation leaving the target area. That is to say, the key release event associated with the target window is not created by the simulation of the electronic device, but is created by the electronic device triggered by the touch operation.
[0123] In one implementation, the key release event associated with the target window may also include position information where the touch operation leaves the target area.
[0124] Step 10334: Obtain trajectory information based on the key events associated with the target window, the position movement information, and the key release events associated with the target window.
[0125] In one implementation, the key event associated with the target window may carry the key type of the touch operation and the location information of the touch operation; the location movement information may include the moving route information of the touch operation in the target area; the key release event associated with the target window may include the location information of the end of the touch operation. In this way, the location information of the touch operation in the target area, the moving route or moving shape information of the touch operation in the target area, and the location information of the touch operation leaving the target area are integrated to obtain the track information of the touch operation.
[0126] As can be seen from the above, the control method provided by the embodiment of the present application creates a key event associated with the target window based on the position information of the touch operation, and tracks the position movement information of the touch operation in the target area. If it is detected that the touch operation is switched to a key release operation, a key release event associated with the target window is created, and then based on the key event associated with the target window, the position movement information and the key release event associated with the target window, a complete touch operation detection and tracking process in the window message management mechanism of the electronic device is formed. In this way, the key event associated with the target window is simulated based on the position information of the touch operation, the key release event associated with the target window is created based on the actual switching state of the touch operation, and the position movement information of the touch operation in the target area constitutes the complete elements of the track tracking in the window message processing mechanism of the electronic device, so that on the basis of making full use of the window message processing mechanism of the electronic device, with the help of the key event simulated by the electronic device and the key release event actually triggered by the touch operation, the track information of the touch operation can be accurately tracked in the target area.
[0127] Based on the above embodiments, in the control method provided in the embodiments of the present application, identifying the trajectory information and obtaining the identification result can be achieved by the following methods:
[0128] The input method of the electronic device is controlled to switch from a default input method to a target input method; the trajectory information is recognized through the target input method to obtain a recognition result.
[0129] In one embodiment, the electronic device can control the input method of the electronic device to switch from the default input method to the target input method when it detects that the position information of the touch operation indicates that the touch operation is located in the track input area and the editable area associated with the track input area is in a non-focused state; correspondingly, if the position information of the touch operation indicates that the touch operation is switched to other areas in the display window except the track input area, the input method of the electronic device can be controlled to switch from the target input method to the default input method.
[0130] In one implementation, after acquiring the track information of the touch operation, the electronic device may control the input method of the electronic device to switch from the default input method to the target input method.
[0131] In one implementation, the target input method may identify the moving direction information included in the position movement information in the track information of the touch operation and the route information in the track information of the touch operation, thereby obtaining a recognition result.
[0132] In one embodiment, the target input method can identify the trajectory information in combination with the attribute parameters of the editable area and / or the trajectory input area; exemplarily, if the editable area and / or the trajectory input area is a text input area, the target input method can identify the trajectory information of the touch operation as text data, and the recognition result at this time is text data; exemplarily, if the editable area and / or the trajectory input area is a graphic input area, the target input method can save and record the trajectory information of the touch operation, and identify and adjust the trajectory information of the touch operation based on the area and / or shape of the editable area, and the recognition result at this time may include the trajectory information of the touch operation after identification and adjustment.
[0133] Accordingly, transmitting the recognition result to the editable area can be achieved by:
[0134] Transfer the recognition result to the editable area through the target input method.
[0135] In one embodiment, the target input method can associate the target window with the display window. Then, when a recognition result corresponding to the trajectory information of the touch operation is obtained, the target input method can determine the display window based on the target window, and determine the corresponding editable area according to the trajectory information of the touch operation, and then transmit the recognition result to the editable area in the display window.
[0136] As can be seen from the above, in the control method provided by the embodiment of the present application, after the input method of the electronic device is switched from the default input method to the target input method for creating the target window, the target input method can be used to identify the trajectory information to obtain the recognition result, and then the target input method can be used to transmit the recognition result to the editable area. In this way, since the target input method is associated with the target window, identifying the trajectory information through the target input method can not only improve the pertinence of the recognition of the trajectory information obtained from the target window, but also improve the efficiency of transmitting the recognition result to the editable area.
[0137] Based on the above embodiments, the control method provided in the embodiments of the present application may further include the following steps:
[0138] If the position information of the touch operation indicates that the touch operation is located in an area of the display window excluding the track input area, the touch operation is responded to through a control corresponding to the position information of the touch operation in the display window.
[0139] In one embodiment, the area in the display window other than the track input area may include an area in the display window for loading controls or for displaying data, such as an area in the display window for displaying menu controls and a display area for read-only data, etc.; illustratively, the read-only data may include image data and text data, etc., which is not limited in this embodiment of the present application.
[0140] In one implementation, the control corresponding to the position information of the touch operation in the display window may include any type of control loaded in the display window at the position of the touch operation when the touch operation is detected; illustratively, the above control may include a Button control, a list box (ListBox), and a scroll bar, etc. This embodiment of the application is not limited to this.
[0141] In one implementation, the control corresponding to the position information of the touch operation in the display window may respond to the touch operation based on a message transmission mechanism and a window processing mechanism set in the electronic device.
[0142] As can be seen from the above, in the control method provided by the embodiment of the present application, if the position information of the touch operation indicates that the touch operation is located in an area other than the track input area in the display window, the touch operation is responded to through the control corresponding to the position information of the touch operation in the display window. In this way, different processing methods for the touch operation are realized according to the position information of the touch operation, thereby realizing targeted processing of the touch operation.
[0143] Based on the above embodiments, the present application also provides another control method: Figure 5 Another flow chart of the control method provided in the embodiment of the present application, it should be noted that, Figure 5 In the embodiment, the electronic device may be a mobile smart phone or a tablet electronic device, such as Figure 5 As shown, the method may include steps 501 to 512:
[0144] Step 501: The display window switches to the front display state.
[0145] Exemplarily, switching the display window to the front display state may include directly controlling the display window to switch to the front display state after the electronic device completes the operation of creating the display window, or the electronic device may control the display window to switch from a hidden state to the front display state.
[0146] Step 502: Detect a touch operation.
[0147] Exemplarily, the touch operation may be input by a user through an input device such as a stylus, or may be triggered by a user's finger.
[0148] Exemplarily, after detecting a touch operation, the electronic device may obtain location information of the touch operation.
[0149] Step 503: Determine whether the display window includes an editable area.
[0150] Exemplarily, the electronic device may obtain attribute parameters of each window element in the display window, and determine whether the display window includes an editable area based on the attribute parameters; exemplary, the display window may include at least one editable area.
[0151] Exemplarily, after any window is created, the electronic device can, through the system accessibility service (AccessibilityService), collect whether any of the above-mentioned windows and other windows associated with the window contain editable areas based on the association relationship between the window and other windows; exemplary, after obtaining a series of parameter information of editable areas, the parameter information of the editable areas can be added to the parameter set of the editable areas.
[0152] Exemplarily, if the display window does not include an editable area, step 504 may be executed; if the display window includes an editable area, step 505 may be executed.
[0153] Step 504: respond to the touch operation by displaying a control in the window corresponding to the position information of the touch operation.
[0154] Exemplarily, the above controls may include a Button control, a list box (ListBox), a scroll bar, and the like.
[0155] Step 505: Determine whether the touch operation is located in the track input area corresponding to the editable area in the non-focused state.
[0156] Exemplarily, the electronic device may determine whether the touch operation is located in the track input area corresponding to the editable area based on the position information of the touch operation and the contour information of the track input area corresponding to the editable area.
[0157] Exemplarily, if the editable area is in a non-focused state and the touch operation is located in a track input area corresponding to the editable area, step 506 may be executed.
[0158] Exemplarily, if the touch operation is not located in the track input area corresponding to the editable area or the editable area is in a focused state, step 504 may be executed.
[0159] Step 506: Switch the input method through System_server and detect the position movement information of the touch operation.
[0160] Exemplarily, switching the input method through the System_server may be implemented through the Input Method Manager Service (IMMS) in the System_server; exemplary, the IMMS may switch from the default input method of the electronic device to the target input method, and execute step 507 .
[0161] Exemplarily, System_server may continuously detect the position movement information of the touch operation, and detect whether the touch operation is switched to a key release state.
[0162] Step 507: Start the target input method.
[0163] Exemplarily, if the target input method is in an inactive state, the target input method may be activated; if the target input method is in a paused state, the target input method may be switched to an active state, and step 508 is executed.
[0164] Step 508: Create a target window.
[0165] Exemplarily, the target window may be created by the target input method; exemplary, the transparency of the target window may be greater than or equal to a transparency threshold; exemplary, the target window may at least cover the track input area corresponding to the editable area in the display window; exemplary, the target window may be in a top-level display state.
[0166] Exemplarily, in the embodiment of the present application, the target window may also be created through the target input method after the OS of the electronic device is started and the window processing mechanism in the electronic device is ready.
[0167] After the target window is created, step 509 may be executed.
[0168] Step 509: Create a key event and a key release event associated with the editable area, and a key event associated with the target window through InputFlinger, and distribute the above events.
[0169] Exemplarily, InputFlinger may sequentially create a key event and a key release event associated with the editable area, and a key event associated with the target window.
[0170] Exemplarily, when the electronic device detects a touch operation and determines that the touch operation is located in a track input area corresponding to the editable area, the electronic device may determine a target area corresponding to the track input area from the target window based on the position information of the track input area.
[0171] Exemplarily, when the touch operation is located in the track input area corresponding to the editable area, the touch operation will trigger the electronic device to create a key event associated with the editable area.
[0172] Exemplarily, a key release event associated with an editable area may be created through software simulation when the electronic device does not detect that the touch operation has switched to a key release state. In this way, by associating key events and key release events with the editable area, it is possible to construct conditions for changing the focus state of the editable area, and switch the editable area from a non-focused state to a focused state under this condition.
[0173] Exemplarily, the Reader in the electronic device can create a new NotifyMotionArgs object and set the type of the NotifyMotionArgs object to KEY_UP, combined with a key event triggered by a touch operation, namely a KEY_DOWN event, thereby switching the editable area from a non-focused state to a focused state.
[0174] Exemplarily, when the touch operation has not ended, the electronic device creates a new NotifyMotionArgs object and sets the NotifyMotionArgs object to KEY_DOWN, ie, a key event associated with the target window, and then sends the object to the Dispatcher through the InputListener for the Dispatcher to distribute the object.
[0175] Exemplarily, during the process of the Dispatcher distributing the NotifyMotionArgs object of type KEY_DOWN, if it is detected that the receiving window of the object is the target window, the object is distributed to the target window and step 510 is executed.
[0176] Step 510: Track the trajectory information of the touch operation in the target window.
[0177] Exemplarily, since a target area corresponding to the track input area has been determined in the target window, the track information of the touch operation can be tracked in the target area.
[0178] Exemplarily, when it is detected that the touch operation switches to the key release state, the trajectory information of the touch operation can be obtained in the target window; exemplary, after the trajectory information of the touch operation is obtained in the target window, the trajectory information of the touch operation can also be transmitted to the target input method, and step 511 is executed.
[0179] Step 511: Obtain a recognition result through the target input method, and transmit the recognition result to the editable area.
[0180] Exemplarily, the target input method may identify the trajectory information of the touch operation to obtain a recognition result.
[0181] Exemplarily, the target input method transmits the recognition result to the editable area through a standard message transmission mechanism provided by the OS of the electronic device.
[0182] Step 512: Display the recognition result in the editable area.
[0183] Exemplarily, the electronic device may adjust the display format of the recognition result according to the data display parameters of the editable area, thereby improving the display effect of the recognition result.
[0184] From the above, it can be seen that the control method provided in the embodiment of the present application can directly switch the editable area to the focused state without relying on two touch operations, by combining the key release event associated with the editable area simulated by the electronic device with the key event triggered by the touch operation, and the key event associated with the target window simulated by the electronic device, and the key release event triggered by the touch operation switching to the key release state, so as to achieve fine tracking of the trajectory information of the touch operation in the target window. At the same time, after the target input method identifies the trajectory information of the touch operation and obtains the recognition result, the target input method can also transmit the recognition result to the editable area with the help of the window message transmission mechanism of the electronic device, so that the editable area can be switched to the focused state according to a single touch operation and the recognition result of the touch operation can be obtained, thereby simplifying the input process of the electronic device and improving the data input efficiency of the electronic device.
[0185] Based on the above embodiments, the present application also provides a control device 6. Figure 6 A schematic diagram of the structure of the control device 6 provided in the embodiment of the present application is shown in FIG. Figure 6 As shown, the device may include:
[0186] The acquisition module 601 is used to acquire a touch operation.
[0187] The control module 601 is configured to control the editable area to switch to a focused state if the position information of the touch operation indicates that the touch operation is located in a track input area corresponding to an editable area in a non-focused state in the display window.
[0188] The tracking and identifying module 603 is used to track the touch operation in the track input area based on the position information of the touch operation, obtain the track information of the touch operation, identify the track information, and obtain the identification result.
[0189] The transmission module 604 is used to transmit the recognition result to the editable area so that the editable area displays the recognition result.
[0190] In some embodiments, the control module 602 is used to create a key event and a key release event associated with the editable area based on the position information of the touch operation if the position information of the touch operation indicates that the touch operation is located in the track input area; and control the editable area to switch to a focused state based on the key event and the key release event associated with the editable area.
[0191] In some embodiments, the tracking and identification module 603 is used to obtain position information of the trajectory input area; based on the position information of the trajectory input area, determine the target area corresponding to the trajectory input area from the target window in the top display state; track the touch operation based on the position information of the touch operation in the target area to obtain trajectory information of the touch operation; wherein the transparency of the target window is greater than or equal to the transparency threshold.
[0192] In some embodiments, the tracking and identification module 603 is used to create a key event associated with the target window based on the position information of the touch operation; track the position movement information of the touch operation in the target area; if it is detected that the touch operation switches to the key release state, create a key release event associated with the target window; based on the key event associated with the target window, the position movement information and the key release event associated with the target window, obtain trajectory information.
[0193] In some implementations, the control module 602 is configured to create a target window if the position information of the touch operation indicates that the touch operation is located in a track input area corresponding to an editable area in a non-focused state in the display window; wherein the target window at least covers the track input area.
[0194] In some implementations, the control module 602 is used to create a target window after the OS of the electronic device is started up; wherein the target window covers a display area of a display device of the electronic device.
[0195] In some implementations, the control module 602 is configured to create a target window through a target input method; wherein the target input method is different from a default input method set in the electronic device.
[0196] In some implementations, the control module 602 is used to control the input method of the electronic device to switch from the default input method to the target input method; identify the trajectory information through the target input method to obtain a recognition result;
[0197] The transmission module 604 is used to transmit the recognition result to the editable area through the target input method.
[0198] In some embodiments, the tracking and identifying module 603 is used to respond to the touch operation through a control corresponding to the position information of the touch operation in the display window if the position information of the touch operation indicates that the touch operation is located in an area outside the track input area in the display window.
[0199] Based on the foregoing embodiments, an embodiment of the present application further provides an electronic device, which includes a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor of the electronic device, it can implement any of the control methods described above.
[0200] It should be noted that the above-mentioned processor can be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor.
[0201] The above-mentioned memory can be a volatile memory (volatile memory), such as a random access memory (Random Access Memory, RAM); or a non-volatile memory (non-volatile memory), such as a read-only memory (Read-Only Memory, ROM), flash memory, a hard disk drive (Hard Disk Drive, HDD) or a solid state drive (SSD); or a combination of the above types of memory, and provide instructions and data to the processor.
[0202] Exemplarily, the acquisition module 601, the control module 602, the tracking and identification module 603 and the transmission module 604 may be implemented by a processor of an electronic device.
[0203] Based on the foregoing embodiments, an embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor of an electronic device, it can implement any of the control methods described above.
[0204] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.
[0205] The methods disclosed in the various method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0206] The features disclosed in the various product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0207] The features disclosed in the various method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0208] It should be noted that the above-mentioned computer-readable storage medium can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM) and other memories; it can also be various electronic devices including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0209] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0210] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0211] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus necessary general hardware nodes, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0212] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a heating module of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the heating module of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0213] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0214] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0215] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A control method, include: A touch operation is obtained; If the position information of the touch operation indicates that the touch operation is located in the track input area corresponding to the editable area in the display window that is in a non-focused state, control the editable area to switch to a focused state, wherein the focused state indicates that the editable area is selected by the input device, and the non-focused state indicates that the editable area is not selected by the input device; Tracking the touch operation in the track input area based on the position information of the touch operation to obtain track information of the touch operation; Identify the trajectory information and obtain an identification result; The recognition result is transmitted to the editable area so that the editable area displays the recognition result.
2. The method according to claim 1, in, If the position information of the touch operation indicates that the touch operation is located in a track input area corresponding to an editable area in a non-focused state in the display window, controlling the editable area to switch to a focused state includes: If the position information of the touch operation indicates that the touch operation is located in the track input area, based on the position information of the touch operation, create a key event and a key release event associated with the editable area; Based on the key event and the key release event associated with the editable area, the editable area is controlled to switch to the focus state.
3. The method according to claim 1, in, Tracking the touch operation in the track input area based on the position information of the touch operation to obtain track information of the touch operation includes: Acquire the position information of the track input area; Based on the position information of the track input area, determining a target area corresponding to the track input area from a target window in a top-level display state; wherein the transparency of the target window is greater than or equal to a transparency threshold; The touch operation is tracked in the target area based on the position information of the touch operation to obtain trajectory information of the touch operation.
4. The method according to claim 3, in, Tracking the touch operation based on the position information of the touch operation in the target area to obtain the track information of the touch operation includes: Creating a key event associated with the target window based on the position information of the touch operation; Tracking position movement information of the touch operation in the target area; If it is detected that the touch operation switches to a key release state, creating a key release event associated with the target window; The track information is obtained based on the key event associated with the target window, the position movement information, and the key release event associated with the target window.
5. The method according to claim 3, in, The method further comprises: If the position information of the touch operation indicates that the touch operation is located in the track input area corresponding to the editable area in the non-focused state in the display window, the target window is created; wherein the target window at least covers the track input area.
6. The method according to claim 3, in, The method further comprises: After the operating system OS of the electronic device is started, the target window is created; wherein the target window covers the display area of the display device of the electronic device.
7. The method according to claim 5 or 6, in, The step of creating the target window comprises: The target window is created by a target input method; wherein the target input method is different from a default input method set in the electronic device.
8. The method according to claim 7, in, The identifying the trajectory information to obtain an identification result includes: Controlling the input method of the electronic device to switch from the default input method to the target input method; Recognize the trajectory information through the target input method to obtain the recognition result; The transmitting the recognition result to the editable area includes: The recognition result is transmitted to the editable area through the target input method.
9. The method according to claim 1, in, The method further comprises: If the position information of the touch operation indicates that the touch operation is located in an area of the display window excluding the track input area, the touch operation is responded to by a control corresponding to the position information of the touch operation in the display window.
10. A control device, include: An acquisition module, used to acquire a touch operation; a control module, configured to control the editable area to switch to a focused state if the position information of the touch operation indicates that the touch operation is located in a track input area corresponding to an editable area in a non-focused state in the display window, wherein the focused state indicates that the editable area is selected by an input device, and the non-focused state indicates that the editable area is not selected by the input device; A tracking and identifying module, configured to track the touch operation in the track input area based on the position information of the touch operation to obtain track information of the touch operation; Identify the trajectory information and obtain an identification result; The transmission module is used to transmit the recognition result to the editable area so that the editable area displays the recognition result.
