Search

CN-121979417-A - Input processing method, input processing device, electronic equipment and storage medium

CN121979417ACN 121979417 ACN121979417 ACN 121979417ACN-121979417-A

Abstract

The embodiment of the application provides an input processing method, an input processing device, electronic equipment and a storage medium, which are applied to a compatible layer, wherein the method comprises the steps of monitoring a target message in real time in the process of receiving text input operation by a target input window of a target Windows application program running in the compatible layer; the target message comprises any one of a mouse moving message, a mouse clicking message and a window obtaining input focus message, when the target message is monitored, a first coordinate of a current input position under a screen coordinate system of the compatible layer is obtained, the first coordinate is converted into a second coordinate under a client area coordinate system of a target input window, the second coordinate is converted into a third coordinate under an X11 top-layer window coordinate system, and input position attributes of input contexts corresponding to the target input window are updated into the third coordinate. The application can realize real-time synchronization of the position of the candidate frame of the input method and the actual position of the input cursor, and improves the input efficiency.

Inventors

  • Request for anonymity
  • Request for anonymity
  • Request for anonymity

Assignees

  • 中科方德软件有限公司

Dates

Publication Date
20260505
Application Date
20251218

Claims (12)

  1. 1. An input processing method, which is applied to a compatible layer in a Linux system, comprising: The target information is monitored in real time in the process of receiving text input operation by a target input window of a target Windows application program running in the compatible layer, wherein the target information comprises any one of a mouse moving information, a mouse clicking information and an input focus information obtained by a window; when the target message is monitored, a first coordinate of a current input position under a screen coordinate system of the compatible layer is obtained, and the first coordinate is converted into a second coordinate under a client area coordinate system of the target input window; And converting the second coordinate into a third coordinate under an X11 top-level window coordinate system, and updating the input position attribute of the input context corresponding to the target input window into the third coordinate.
  2. 2. The method of claim 1, wherein the obtaining a first coordinate of the current input position in a screen coordinate system of the compatible layer and converting the first coordinate to a second coordinate in a client area coordinate system of the target input window comprises: Acquiring current GUI thread information of the target Windows application program, and judging whether a target handle in the current GUI thread information is valid or not; if the target handle is valid, acquiring a first coordinate of the movable insert, and converting the first coordinate of the movable insert into a second coordinate; And if the target handle is invalid, acquiring the first coordinate of the current mouse, and converting the first coordinate of the current mouse into the second coordinate.
  3. 3. The method of claim 1, wherein updating the input location attribute of the input context corresponding to the target input window to the third coordinate comprises: Setting the value of a preset global variable as the third coordinate, and setting the value of a preset global identifier as a target value; acquiring an input context corresponding to the target input window by calling a first interface provided by the compatible layer; And writing the value of the preset global variable into the input position attribute of the input context corresponding to the target input window.
  4. 4. The method according to claim 1, wherein the method further comprises: Reading a value of a preset global identifier when an input context corresponding to the target input window is created; If the value of the preset global identifier is the target value, reading the value of a preset global variable as an initial coordinate, wherein the preset global variable is used for recording the value of the last updated input position attribute; If the value of the preset global identifier is not the target value, calculating to obtain a third coordinate of the movable insert as an initial coordinate; and initializing the input position attribute of the input context corresponding to the target input window as the initial coordinate.
  5. 5. The method according to claim 1, wherein the method further comprises: and notifying the input method service that the input position attribute of the target input window is updated, so that the input method service displays the input method candidate frame according to the position indicated by the updated input position attribute.
  6. 6. The method according to claim 1, wherein the method further comprises: receiving a first coded character string submitted by an input method service to a candidate word selected by a user; Converting the first coded character string into a second coded character string conforming to a Windows system; And submitting the second coded character string to a message queue corresponding to the target window so as to enable the target window to be received and displayed in sequence.
  7. 7. The method of claim 6, wherein submitting the second encoded string to a message queue corresponding to a target window comprises: judging whether the target input window is a focus window or not; If the target input window is a focus window, submitting the second coding character string to a message queue corresponding to the target input window by calling a second interface provided by the compatible layer; And if the target input window is not the focus window, determining the focus window by calling a third interface provided by the compatible layer, and submitting the second coding character string to a message queue corresponding to the focus window by calling the second interface.
  8. 8. The method of claim 6, wherein submitting the second encoded string to a message queue corresponding to a target window comprises: And if the target Windows application program does not support the input method message, submitting the second coded character strings to a message queue corresponding to the target window one by one in a character form.
  9. 9. The method of claim 6, wherein submitting the second encoded string to a message queue corresponding to a target window comprises: Splitting the second code character string into characters to be submitted sequentially, comparing the characters to be submitted currently on different paths with the characters in a target cache, and if the characters are identical and the interval time is smaller than the preset duration, ignoring the characters to be submitted currently, wherein the target cache is used for caching the characters submitted successfully last time.
  10. 10. An input processing device for use in a compatibility layer in a Linux system, the device comprising: the message monitoring module is used for monitoring a target message in real time in the process of receiving text input operation by a target input window of a target Windows application program running in the compatible layer, wherein the target message comprises any one of a mouse moving message, a mouse clicking message and a window obtaining input focus message; the coordinate conversion module is used for acquiring a first coordinate of the current input position under the screen coordinate system of the compatible layer when the target message is monitored, converting the first coordinate into a second coordinate under the client area coordinate system of the target input window, and converting the second coordinate into a third coordinate under the X11 top-layer window coordinate system; And the attribute updating module is used for updating the input position attribute of the input context corresponding to the target input window into the third coordinate.
  11. 11. An electronic device comprising a processor, a memory, a communication interface and a communication bus, said processor, said memory and said communication interface being in communication with each other via said communication bus, said memory being adapted to store at least one executable instruction for causing said processor to perform the steps of the input processing method according to any one of claims 1 to 9.
  12. 12. A readable storage medium, characterized in that the readable storage medium has stored thereon a program or instructions which, when executed by a processor, implement the steps of the input processing method according to any of claims 1 to 9.

Description

Input processing method, input processing device, electronic equipment and storage medium Technical Field The present application relates to the field of computer technologies, and in particular, to an input processing method, an input processing device, an electronic device, and a storage medium. Background Wine is an open source compatible layer that allows Windows applications to run on Unix-like systems such as Linux, macOS, etc. In order to enable Windows applications to normally use input methods (Input Method Editor, IMEs) in the compatible layer, the compatible layer typically implements input functions by interfacing with the underlying input method services. At present, although the input function of the input method can be realized in a compatible layer, when a user moves an input cursor on an input interface (such as a CAD command line), the bottom-layer input method service cannot obtain a new cursor position, so that the candidate frame of the input method is seriously misplaced with the actual cursor position, and the user always needs to find the candidate frame first and then select a candidate text from the candidate frame, thereby influencing the input efficiency and input experience. Disclosure of Invention In view of the above problems, embodiments of the present application are provided to provide an input processing method for overcoming the above problems or at least partially solving the above problems, which can achieve real-time synchronization between the position of an input method candidate frame and the actual position of an input cursor, so as to improve input efficiency and input experience. Correspondingly, the embodiment of the application also provides an input processing device, electronic equipment and a storage medium, which are used for ensuring the realization and application of the method. In a first aspect, an embodiment of the present application discloses an input processing method, which is applied to a compatible layer Wine in a Linux system, and the method includes: The target information is monitored in real time in the process of receiving text input operation by a target input window of a target Windows application program running in the compatible layer, wherein the target information comprises any one of a mouse moving information, a mouse clicking information and an input focus information obtained by a window; when the target message is monitored, a first coordinate of a current input position under a screen coordinate system of the compatible layer is obtained, and the first coordinate is converted into a second coordinate under a client area coordinate system of the target input window; And converting the second coordinate into a third coordinate under an X11 top-level window coordinate system, and updating the input position attribute of the input context corresponding to the target input window into the third coordinate. In a second aspect, an embodiment of the present application discloses an input processing device, which is characterized in that the input processing device is applied to a compatible layer in a Linux system, and the device includes: the message monitoring module is used for monitoring a target message in real time in the process of receiving text input operation by a target input window of a target Windows application program running in the compatible layer, wherein the target message comprises any one of a mouse moving message, a mouse clicking message and a window obtaining input focus message; the coordinate conversion module is used for acquiring a first coordinate of the current input position under the screen coordinate system of the compatible layer when the target message is monitored, converting the first coordinate into a second coordinate under the client area coordinate system of the target input window, and converting the second coordinate into a third coordinate under the X11 top-layer window coordinate system; And the attribute updating module is used for updating the input position attribute of the input context corresponding to the target input window into the third coordinate. In a third aspect, an embodiment of the present application discloses an electronic device, including a processor, a memory, a communication interface, and a communication bus, where the processor, the memory, and the communication interface complete communication with each other through the communication bus, and the memory is configured to store at least one executable instruction, where the executable instruction causes the processor to execute the steps of the input processing method as described in any one of the foregoing. In a fourth aspect, an embodiment of the present application discloses a readable storage medium, where a program or an instruction is stored, where the program or the instruction can implement the input processing method according to any one of the embodiments of the present application when executed by a processor