CN118320410A - Input control method, device and equipment based on android simulator - Google Patents

Input control method, device and equipment based on android simulator Download PDF

Info

Publication number
CN118320410A
CN118320410A CN202410276957.2A CN202410276957A CN118320410A CN 118320410 A CN118320410 A CN 118320410A CN 202410276957 A CN202410276957 A CN 202410276957A CN 118320410 A CN118320410 A CN 118320410A
Authority
CN
China
Prior art keywords
input
target
input data
external 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.)
Pending
Application number
CN202410276957.2A
Other languages
Chinese (zh)
Inventor
叶志强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202410276957.2A priority Critical patent/CN118320410A/en
Publication of CN118320410A publication Critical patent/CN118320410A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application discloses an input control method, device and equipment based on an android simulator, wherein the method comprises the following steps: the shell process obtains a first input event of the target external device, and determines first input data corresponding to the first input event according to the first input event and a preset rule; the shell process sends the first input data to an application back-end process; the application back-end process receives first input data and generates second input data according to the first input data, wherein the second input data is used for triggering target virtual external equipment corresponding to a target application so as to generate a second input event corresponding to the first input event in the target application; and the application back-end process sends the second input data to the target virtual external device. According to the method and the device, the user can use the external equipment to control the target application through the virtual external equipment, so that simple, smooth and accurate operation experience is brought to the user.

Description

Input control method, device and equipment based on android simulator
Technical Field
The application relates to the technical field of computers, in particular to an input control method and device based on an android simulator, electronic equipment and a computer readable storage medium.
Background
With the rapid development of Android (Android) application game markets, an Android simulator capable of running on computer equipment and simulating an Android system has been developed. The user can run and experience android games and applications on the computer through the android simulator.
In the related art, an android simulator generally needs to configure a key-touch event mapping scheme, and a mapping relationship is established between physical keys of external devices (such as a mouse, a keyboard, a handle, etc.) of a computer device and touch events in an android application running on the android simulator, so as to realize control of the android application through the external devices of the computer device.
However, in order to provide a more comprehensive handling experience, android simulators are often required to provide a large number of key options. Such a design, while helping to meet various handling requirements, also presents additional memory and operational burden to the user, reducing the overall user experience.
Disclosure of Invention
The application provides an input control method, device and equipment based on an android simulator, and aims to solve the problem that in the prior art, the android simulator runs and controls the experience poorly.
In a first aspect, an embodiment of the present application provides an input control method based on an android simulator, which is applied to an android simulator running on a terminal device, where the android simulator includes a shell process and an application back-end process, and the application back-end process is currently running a target application, and the method includes:
The shell process obtains a first input event of the target external device, determines first input data corresponding to the first input event according to the first input event and a preset rule, wherein the first input event is generated by triggering operation on the target external device connected with the terminal device, and the preset rule is used for constructing the input data according to the input event;
the shell process sends the first input data to the application back-end process;
The application back-end process receives the first input data, generates second input data according to the first input data, and the second input data is used for triggering a target virtual external device corresponding to the target application so as to generate a second input event corresponding to the first input event in the target application, wherein the target virtual external device is associated with the target external device;
and the application back-end process sends the second input data to the target virtual external device.
In a second aspect, an embodiment of the present application provides an input control device based on an android simulator, applied to an android simulator running on a terminal device, where the android simulator includes a shell process and an application back-end process, and the application back-end process is currently running a target application, where the device includes:
The acquisition module is used for acquiring a first input event of the target external equipment by the shell process, determining first input data corresponding to the first input event according to the first input event and a preset rule, wherein the first input event is generated by triggering operation on the target external equipment connected with the terminal equipment, and the preset rule is used for constructing the input data according to the input event;
the first sending module is used for sending the first input data to the application back-end process by the shell process;
The processing module is used for receiving the first input data by the application back-end process, generating second input data according to the first input data, wherein the second input data is used for triggering a target virtual external device corresponding to the target application so as to generate a second input event corresponding to the first input event in the target application, and the target virtual external device is associated with the target external device;
And the second sending module is used for sending the second input data to the target virtual external device by the application back-end process.
In a third aspect, an embodiment of the present application provides an electronic device, including:
A memory and a processor, the memory and the processor coupled;
The memory is used for storing one or more computer instructions;
The processor is configured to execute the one or more computer instructions to implement the android simulator-based input control method according to any one of the first aspect.
In a fourth aspect, an embodiment of the present application provides a computer readable storage medium having one or more computer instructions stored thereon, where the instructions are executed by a processor to implement the input control method based on an android simulator according to any one of the first aspect above.
In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, where the computer program when executed by a processor implements the input control method based on an android simulator according to any one of the first aspect.
Compared with the prior art, the application has the following advantages:
According to the input control method based on the android simulator, a shell process obtains a first input event of a target external device, and determines first input data corresponding to the first input event according to the first input event and a preset rule, wherein the first input event is generated by triggering operation on the target external device connected with terminal equipment, and the preset rule is used for constructing the input data according to the input event; the shell process sends the first input data to an application back-end process; the application back-end process receives first input data and generates second input data according to the first input data, the second input data is used for triggering target virtual external equipment corresponding to a target application so as to generate a second input event corresponding to the first input event in the target application, and the target virtual external equipment is associated with the target external equipment; and the application back-end process sends the second input data to the target virtual external device.
According to the method, the virtual external device (such as a virtual keyboard, a virtual mouse, a virtual handle and the like) is built in the android simulator, so that the android simulator can accurately simulate the input and output behaviors of the external device, input events of the external device can be accurately processed by the android simulator, and the received input events are transmitted to an application program running in the android simulator. And acquiring a first input event of an external device connected with the terminal device in a shell process of the android simulator, and converting the first input event into first input data. And then, the shell process sends the first input data to the application back-end process, and the application back-end process converts the first input data into second input data after receiving the first input data, wherein the second input data is used for triggering the target virtual external device corresponding to the target application so as to generate a second input event corresponding to the first input event in the target application. Therefore, a user can use the external device to perform touch operation, and the android application running in the android simulator is controlled through the virtual external device, so that smooth and accurate operation experience with high PC reduction degree is brought to the user, and various defects caused by the adoption of a configuration key-touch event mapping scheme are avoided.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
fig. 1 is a flow chart of an input control method based on an android simulator according to an embodiment of the present application;
FIG. 2 is a schematic diagram illustrating a process for generating a handle input event according to an embodiment of the present application;
FIG. 3 is a schematic flow chart of a handle input control based on an android simulator according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an input control device based on an android simulator according to an embodiment of the present application;
fig. 5 is a schematic hardware structure of an electronic device according to an embodiment of the application.
Specific embodiments of the present application have been shown by way of the above drawings and will be described in more detail below. The drawings and the written description are not intended to limit the scope of the inventive concepts in any way, but rather to illustrate the inventive concepts to those skilled in the art by reference to the specific embodiments.
Detailed Description
The application will be described more fully hereinafter with reference to the accompanying drawings, in which embodiments of the application are shown. In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. The described embodiments are intended to be some, but not all, of the many other embodiments that a person of ordinary skill in the art would obtain without inventive faculty are within the scope of the application.
It should be noted that in the description of the present application, the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying any particular order or sequence. The specific meaning of the above terms in the present application will be understood in specific cases by those of ordinary skill in the art. Furthermore, in the description of the present application, the term "plurality" means two or more, unless otherwise indicated. The term "and/or" describes an association relationship of associated objects, meaning that there may be three relationships, e.g., a and/or B, which may represent: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship. The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus.
In order to facilitate understanding of the technical solution of the present application, related concepts related to the present application will be described first.
The android simulator is a simulator which can run on computer equipment and simulate an android system, and can install, use and uninstall android application software. Even if the user does not have mobile phone hardware equipment, the user can run the android application program through the android simulator in the computer equipment, so that the android running environment can be simulated on the computer equipment, and the user can experience the android game and application on the computer equipment.
The android simulator ROM refers to an android system image file running in the android simulator. The ROM of the android simulator can be regarded as a virtual android device, and comprises an android operating system, built-in application programs, data and the like. When a user starts the android simulator, the android simulator ROM is loaded by the android simulator, so that a complete android system environment is simulated. The user can install other android applications, etc. in the android simulator just like on a real android mobile device. When a user starts an android application program through the android simulator, the android simulator firstly loads a corresponding simulator ROM, an application back-end process of the android application program is started in the simulator ROM, and then the application back-end process of the android application program keeps running continuously until the android application program is closed or the android simulator is stopped.
The prior art and problems of the prior art according to the present application will be described below:
In the related art, an android simulator generally needs to configure a key-touch event mapping scheme, and a mapping relationship is established between physical keys of external devices (such as a mouse, a keyboard, a handle, etc.) of a PC computer and touch events in the android application, so as to realize control of the android application running on the android simulator through the external devices of the computer device. Further, in order to meet the operation demands of different users, the android simulator provides various key-touch event mapping schemes for the android application, so that the user control experience is improved as much as possible.
However, regardless of the key-touch event mapping scheme configured, at least four drawbacks of key-touch event mapping by the android simulator to the touch-type android application are always unavoidable:
Defect one, providing a large number of keys: to provide a more comprehensive manipulation experience, android simulators are often required to provide a large number of key options. Such a design, while helping to meet various handling requirements, also presents additional memory and operational burden to the user, reducing the overall user experience.
Defect two, display disorder of key: because of the large number of keys, android simulator manufacturers often display keys on an interface for viewing and operation by the user in order to provide a better user experience. However, since there are many keys, there are many keys displayed on the screen, which may be messy, interfere with the user's vision, and lack operation guidance. This is mainly because displaying too many keys in a limited screen space can result in crowding of the interface, which can be confusing to the user.
Defect three, operation pressure and maintenance cost are great: to meet the requirements of different resolutions and different android game applications, android simulator vendors need to configure a large number of key-touch event mapping schemes. The user interface layout and manner of operation may be different for each android game, so an adapted key-touch event mapping scheme needs to be formulated for each of the android Zhuo Youhu. Once the user interface of the android game changes, the android simulator vendor needs to reconfigure the key-touch event mapping scheme. This increases operating pressure and maintenance costs.
Defect four, limitation in performance: key-touch event mapping can only achieve complex functions such as character walking, perspective movement, skill set, etc. through a series of event simulations. In an android simulator, the input of an external device (such as a mouse, keyboard, handle) needs to be mapped into touch events, which are then transferred to the android system simulated in the android simulator. This process involves the capture, processing and delivery of external device input events, and interactions between the android simulator and its simulated running android system. These operations may cause long response times, large errors and delays, thereby affecting the smoothness and accuracy of the operation.
It should be noted that, the above exemplary scenario of running the android game application through the android simulator is only one example of many scenarios to which the input control method based on the android simulator provided by the present application may be applied, and the exemplary scenario is not limited. In practical applications, the input control method based on the android simulator can also be used for processing other android applications (social media applications, shopping applications, media applications and the like) besides the android game applications.
Based on the problems of the related art, in order to improve the control experience brought to the user by the android application control of the android simulator, the application provides an input control method based on the android simulator, an input control device corresponding to the method and an electronic device and a computer readable storage medium capable of implementing the input control method based on the android simulator. The following provides detailed descriptions of the above methods, apparatuses, electronic devices, and computer-readable storage media.
In order to make the purpose and the technical scheme of the application clearer and more intuitive, the method provided by the embodiment of the application is described in detail below with reference to the attached drawings and the embodiment. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application. It is to be understood that the following embodiments may exist alone and that the embodiments and features of the embodiments described below may be combined with each other without conflict between the embodiments provided by the present application, and for the same or similar matters, descriptions in different embodiments are not repeated. In addition, the timing of steps in the method embodiments described below is merely an example and is not strictly limited, and in some cases, steps shown or described may be performed in an order different from that.
The application provides an input control method and device based on an android simulator, electronic equipment and a computer readable storage medium. Specifically, the input control method based on the android simulator according to one embodiment of the present application may be executed by a computer device, where the computer device may be a device such as a terminal or a server. The terminal can be terminal equipment such as a notebook, a desktop computer, a vehicle-mounted computer, an intelligent television, an intelligent home and the like. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, basic cloud computing services such as big data and artificial intelligence platforms, and the like.
Next, referring to fig. 1, an input control method based on an android simulator according to an embodiment of the present application is described, and fig. 1 is a flow chart of an input control method based on an android simulator according to an embodiment of the present application.
As shown in fig. 1, the input control method based on the android simulator includes steps S10-S20:
S10, the shell process acquires a first input event of the target external device, determines first input data corresponding to the first input event according to the first input event and a preset rule, wherein the first input event is generated by triggering operation on the target external device connected with the terminal device, and the preset rule is used for constructing the input data according to the input event.
The input control method based on the android simulator provided by the embodiment of the application is applied to the android simulator running on the terminal equipment, and the android simulator comprises a shell process (namely a simulator shell process) and an application back-end process. Wherein the application backend process is running the target application (i.e., the target android application program).
The operating system of the terminal device may be Windows, linux, mac, etc., which is merely an example, and the embodiment of the present application is not limited in this respect. For example, taking the operating system of the terminal device as Windows as an example, the android simulator product class needs to run an android application program on the terminal device whose operating system is Windows. For another example, taking Linux as an operating system of a terminal device as an example, a product class of the android simulator needs to run an android application program on the terminal device whose operating system is Linux.
As mentioned above, android simulators typically involve two key processes: shell processes and application backend processes. Among other things, the shell process (also referred to as the front-end process) is the portion visible to the user, which is responsible for providing the user interface and user interactions. The shell process of the android simulator runs on the terminal device, typically a windowed application program, which can display the android simulator interface and receive input events of the external device. The application back-end process is the underlying engine of the android simulator, which is responsible for simulating the hardware and software environment of the android device. The application backend process runs in the background of the terminal device, usually continuously in the form of a service. The target application that the application backend process is running is an android application program, for example, may be an android Zhuo Youhu application, an android music application, an android multimedia application, etc., which is only an example, and the embodiment of the present application is not limited in any way.
The terminal device is in a connection state with at least one external device, and the external device comprises one or more of the following: keyboard, mouse, handle, etc., by way of example only, and the application is not limited in any way. The input event of the external device refers to an input event generated by various triggering operations performed by a user on the external device (such as a keyboard, a mouse, a handle, etc.) connected with the terminal device. Taking a keyboard as an example, input events include a target key press event, a target key release event, etc., by way of example only. The target key may be any one or more keys on the keyboard, that is, the user may trigger one or more keys at the same time. Taking a mouse as an example, input events include a mouse movement, a mouse click (left, center, right) event, a mouse double click event, a mouse wheel scroll event, a mouse drag event, etc., just to name a few. Taking the handle as an example, the input events include a rocker input event, a direction key (up, down, left, right) input event, a button input event (e.g., A, B, X, Y buttons on the handle, trigger buttons (L1, L2, R1, R2), menu buttons, etc.), a trigger input event, etc., just to name a few.
In the embodiment of the application, a shell process acquires a first input event of a target external device. The first input event is generated by executing trigger operation on a target external device connected with the terminal device. For example, the external device to which the terminal device is currently connected has a mouse and a keyboard, and when the user presses a P key on the keyboard, the shell process obtains a pressing event (i.e., a first input event) of the P key of the keyboard (i.e., the target external device).
On the terminal device, input information of an external device connected with the terminal device can be obtained through an associated framework application programming interface (Application Programming Interface, API) and an API provided by a Windows operating system. Specifically, the Windows operating system of the terminal device provides some API interfaces, such as GETASYNCKEYSTATE, GETKEYBOARDSTATE, etc., which can be used to obtain key states of the keyboard and input events, such as positions of the mouse and click events. By calling the APIs, the shell process can acquire the input event of the external device and perform corresponding operation and processing. In addition, programming frameworks and libraries of some third parties, such as DirectX, openGL, unity, qt, etc., also provide a similar API interface that can be used to obtain input events to external devices and perform other operations.
In the embodiment of the application, the shell process determines the first input data corresponding to the first input event according to the first input event and the preset rule. The preset rule is used for constructing first input data according to the first input event.
Illustratively, the preset rules for the key press event and the key release event of the keyboard are illustrated. For example, the preset rule for constructing the input data of the event according to the key press event of the keyboard may be represented in a data format, such as KBDPR: key code: 1. the preset rules for constructing the input data of the event according to the key release event of the keyboard can be represented in a data format, such as KBDPL: key code: 0. wherein the key code is the identification of the key. For example, key codes of M, N, L, K keys on the keyboard are 1, 5, 7 and 17, respectively. If the external process obtains that the first input event of the keyboard is a pressing event of the K key, according to the preset rule (i.e. the data format), the input data (i.e. the first input data) corresponding to the pressing event of the K key (i.e. the first input event) is KBDPR:17:1. if the external process obtains that the first input event of the keyboard is a release event of the L key, according to the preset rule (i.e. data format), input data (i.e. first input data) corresponding to the release event of the L key (i.e. first input event) is KBDPL:7:0.
The foregoing is only illustrative of the preset rule, and the specific preset rule defines the data format of the input event, which may be set according to the actual requirement, which is not limited in the embodiment of the present application.
S20, the shell process sends the first input data to the application back-end process.
In the embodiment of the application, the shell process sends the first input data to the application back-end process through the communication channel. Wherein the communication channel may be a TCP communication link, an Http communication link, etc., by way of example only, and the embodiments of the present application are not limited in any way. For example, the target application currently being run by the application back-end process is an a game application, and the shell process sends the first input data to the application back-end process, so that the subsequent application back-end process can correspondingly control the a game application according to the first input data.
S30, the application back-end process receives the first input data, generates second input data according to the first input data, and the second input data is used for triggering the target virtual external device corresponding to the target application so as to generate a second input event corresponding to the first input event in the target application, wherein the target virtual external device is associated with the target external device.
In an embodiment of the application, an application backend process receives first input data from a shell process.
In a real android device (such as an android mobile phone), external devices such as a mouse, a keyboard, a handle and the like can be generally connected with the android device through a physical interface (such as a USB port) on the android device, then the external devices and the android device can directly perform physical interaction, and interaction between the external devices and android applications running on the android system is realized through a driver provided by the android system. The android simulator is a software program running on a computer and has no actual physical interface, so that external equipment cannot be directly connected. In order to enable the android simulator to simulate the behavior of the external device, a driver is built to realize virtual external device (such as a virtual keyboard, a virtual mouse, a virtual handle and the like), and the android simulator is enabled to simulate the input and output behavior of the external device correctly, so that the android simulator can process the input event of the external device correctly and transmit the received input event to an application program running in the android simulator. Thus, the user can use the external device in the android simulator, and the use experience similar to that of the real device is obtained.
The target virtual external device is a virtual external device created by the application back-end process for the external device connected with the terminal device. For example, the external devices connected with the terminal device include a keyboard, a mouse and a handle, and then the application back-end process creates virtual keyboards corresponding to the external devices for the external devices, which are respectively a virtual keyboard, a virtual mouse and a virtual handle. The target virtual external device is related to the target external device, namely the target virtual external device and the target external device refer to the external devices of the same type, and if the target external device is a mouse, the target virtual external device related to the target external device is a virtual mouse; if the target external device is a keyboard, the target virtual external device associated with the target external device is a virtual keyboard.
And generating second input data according to the first input data, that is, generating second input data of the target virtual external device according to the first input data of the target external device, wherein the second input data is used for triggering the target virtual external device corresponding to the target application by the application back-end process so as to generate a second input event corresponding to the first input event in the target application. Therefore, the user can generate second input data corresponding to triggering the target virtual external device in the application back-end process by triggering the target external device connected with the terminal device.
In the embodiment of the present application, generating the second input data according to the first input data is essentially to convert a first input event corresponding to the first input data into a second input event corresponding to the second input data. For example, the first input event corresponding to the first input data is a pressing event of a K key in the keyboard, and the second input event corresponding to the second input data is a pressing event of a K key in the virtual keyboard. Therefore, the second input data is generated according to the first input data, specifically, the data structure of the input data is constructed according to the virtual external device, and the first input data reflecting the first input event is converted into the second input data reflecting the second input event. For example, first input data representing a K key release event in a real keyboard is converted into second input data representing a K key release event in a virtual keyboard.
And S40, the application back-end process sends the second input data to the target virtual external device.
In the embodiment of the application, the application back-end process reports the second input data to the target virtual external device. For example, the first input data is used for representing a K key release event in the keyboard, the second input data is used for representing a K key release event in the virtual keyboard, and the application back-end process sends the second input data representing the K key release event in the virtual keyboard to the virtual keyboard so as to simulate triggering of a target virtual keyboard corresponding to the target application, so as to generate the virtual keyboard K key release event in the target application.
According to the input control method based on the android simulator, a shell process obtains a first input event of a target external device, first input data corresponding to the first input event is determined according to the first input event and a preset rule, the first input event is generated by triggering operation on the target external device connected with a terminal device, and the preset rule is used for constructing the input data according to the input event. The shell process sends the first input data to the application backend process. The application back-end process receives the first input data, generates second input data according to the first input data, and the second input data is used for triggering the target virtual external device corresponding to the target application so as to generate a second input event corresponding to the first input event in the target application, wherein the target virtual external device is associated with the target external device. And the application back-end process sends the second input data to the target virtual external device.
Compared with the prior art, the method and the device have the advantages that the virtual external device (such as a virtual keyboard, a virtual mouse, a virtual handle and the like) is built in the android simulator, so that the android simulator can accurately simulate the input and output behaviors of the external device, the android simulator can accurately process the input event of the external device, and the received input event is transmitted to an application program running in the android simulator. And acquiring a first input event of an external device connected with the terminal device in a shell process of the android simulator, and converting the first input event into first input data. And then, the shell process sends the first input data to the application back-end process, and the application back-end process converts the first input data into second input data after receiving the first input data, wherein the second input data is used for triggering the target virtual external device corresponding to the target application so as to generate a second input event corresponding to the first input event in the target application. Therefore, a user can control the android application running in the android simulator through the virtual external device by using the external device to perform touch operation, so that smooth and accurate operation experience with high PC reduction degree is brought to the user, and various defects caused by the adoption of a configuration key-touch event mapping scheme are avoided.
On the basis of the above embodiment, the input control method based on the android simulator provided by the embodiment of the application is further described below.
An optional implementation manner, before the application back-end process receives the first input data, the input control method based on the android simulator provided by the embodiment of the application further includes step S50:
s50, the application back-end process establishes virtual external devices corresponding to the external devices aiming at the external devices connected with the terminal device so as to control the target application through the virtual external devices.
In the embodiment of the application, the android simulator is essentially a lightweight Linux kernel running on a Windows system. uinput is a Linux kernel module that allows a user space program to create a virtual external device and interact with android applications running on the android simulator through the virtual external device. In particular, uinput may create virtual external devices, such as virtual keyboards, virtual mice, virtual handles, virtual touch screens, and the like. After creating the virtual external device, the application backend process may send input events to the user space and kernel space through uinput.
Specifically, step one writes and opens/dev/uinput file at the application back-end process, which is an interface to communicate with uinput subsystem. And secondly, configuring event types supported by the virtual external device, such as a keyboard key event, a mouse movement event, a handle rocker event, a touch screen event and the like, by the application back-end process, wherein the event types define the input behaviors which can be simulated by the virtual external device. And thirdly, creating the virtual external equipment and configuring the virtual external equipment to support the appointed event type, so that the virtual external equipment is created in the kernel space. And step four, the application back-end process can inject a specific type of event by writing the input data of the virtual external device. For example, keyboard key press operations may be simulated by writing input data corresponding to a keyboard key press event, or mouse movement and click operations may be simulated by writing mouse event data. These events will be passed to the user space and kernel users so that they can be received and processed by other applications or system services. Through the steps, the application back-end process can use uinput to inject input events of specified types into the virtual external device, so that various input behaviors can be simulated. This allows applications running on the android simulation to handle these events just as they do the input events of a real external device.
In the embodiment of the application, the application back-end process of the android simulator can be checked by opening the Windows task manager of the terminal equipment.
An alternative implementation manner of "generating the second input data from the first input data" in step S40 includes step S60:
s60, generating second input data according to the first input data and the target corresponding relation, wherein the target corresponding relation is used for indicating the conversion relation between the first input data of the target external device and the second input data of the target virtual external device.
The target corresponding relation is used for indicating the conversion relation between the first input data of the target external equipment and the second input data of the target virtual external equipment.
Taking a target external device as an example of a keyboard, the shell process sends input data (i.e., first input data) corresponding to a keyboard K key pressing event to an application back-end process, and the application back-end process obtains second input data for triggering the target virtual external device according to the first input data and the target corresponding relationship. The target correspondence (see table 1) is exemplarily described by taking an external device as an example of a keyboard and a mouse.
TABLE 1
As shown in table 1, in the case where the first input event is a pressing event of one of a keyboard key and a mouse key, the data format of the first input data is KBDPR: key code: 1, the target correspondence relationship shown in table 1 indicates that the data format of the second input data corresponding to the first input data is ev_key: key code: 1, a step of;
In the case that the first input event is a release event of one of the keyboard key and the mouse key, the data format of the first input data is KBDPL: key code: 0, the target correspondence relationship shown in table 1 indicates that the data format of the second input data corresponding to the first input data is ev_key: key code: 0;
In the case that the first input event is a mouse movement event, the data format of the first input data is mousemove_rel: the target correspondence relationship shown in table 1 indicates that the data format of the second input data corresponding to the first input data is ev_rel: position information;
In the case that the first input event is a mouse WHEEL event, the data format of the first input data is where: scroll information, the target correspondence relationship shown in table 1 indicates that the data format of the second input data corresponding to the first input data is ev_rel: rel_whiel: scrolling information;
In the case that the first input event is a handle key press event, the data format of the first input data is GPDBUTTON: key code: 1, the target correspondence relationship shown in table 1 indicates that the data format of the second input data corresponding to the first input data is ev_key: key code: 1, a step of;
In the case that the first input event is a handle key release event, the data format of the first input data is GPDBUTTON: key code: 0, the target correspondence relationship shown in table 1 indicates that the data format of the second input data corresponding to the first input data is ev_key: key code: 0;
In the case that the first input event is a handle left rocker event, the data format of the first input data is LSTICKAXIS: x-axis movement data: y-axis movement data, the target correspondence relationship shown in table 1 indicates that the data format of the second input data corresponding to the first input data is ev_abs: abs_x: x-axis movement data, ev_abs: abs_y: y-axis movement data;
in the case that the first input event is a handle right rocker event, the data format of the first input data is RSTICKAXIS: z-axis movement data: the RZ axis movement data, the target correspondence relationship shown in table 1 indicates that the data format of the second input data corresponding to the first input data is ev_abs: abs_z: z-axis movement data, EV_ABS: abs_rz: RZ axis movement data.
For example, the key code of the G key on the keyboard is 18. Then, if the external process obtains that the first input event of the keyboard is a pressing event of the G key, input data (i.e., first input data) corresponding to the pressing event of the G key (i.e., first input event) is KBDPR:18:1. according to the target correspondence shown in table 1, the obtained second input data is ev_key:18:1.
In an optional implementation manner, before "generating the second input data according to the correspondence between the first input data and the target" in step S60, the input control method based on the android simulator provided by the embodiment of the present application further includes steps S701-702:
s701, determining the target external device according to the first input data.
S702, determining a target corresponding relation according to the target external equipment and the plurality of first corresponding relations.
In the embodiment of the application, the first input data further comprises identification information of the target external device, the identification of the external device can be obtained from the first input data, and the target external device generating the first input data corresponding to the first input event can be determined according to the identification. For example, the Mouse identifier, mouse01, may determine that the target external device is a Mouse if the first data corresponding to the first input event includes Mouse 01.
In the embodiment of the application, the terminal equipment is in a connection state with a plurality of different external devices at present, and each external device and the corresponding virtual external device have a first corresponding relation on input data. For example, taking a mouse, a keyboard and a handle as examples, a corresponding relationship (i.e. a first corresponding relationship) exists between the mouse and the virtual mouse on input data; the keyboard and the virtual keyboard have a corresponding relation (namely a first corresponding relation) on input data; the handles and the virtual handles have a corresponding relationship (i.e., a first corresponding relationship) on the input data. For example, when it is determined that the target external device is a mouse, the correspondence between the mouse and the virtual mouse is determined as the target correspondence.
In an alternative embodiment, the device type of the external device to which the terminal device is currently connected includes one or more of the first type and the second type, and the terminal device does not need to additionally construct a driver, such as a mouse and a keyboard, for obtaining the connection state information of the external device of the first type. The terminal device needs to additionally construct a driver, such as a handle, to obtain the connection status information of the external device of the second type.
In the case that the target external device belongs to the second type, before the shell process obtains the first input event of the target external device, the input control method based on the android simulator provided by the embodiment of the application further comprises steps S801-S804:
S801, a target driving program is constructed, and connection state information of the target external device is obtained.
S802, acquiring input state information of the target external device, and storing and determining the input state information as target input state information.
S803, acquiring current input state information of the target external device every preset time.
S804, under the condition that the target input state information is inconsistent with the current input state information, updating the target input state information into the current input state information, and generating a first input event aiming at the target external equipment according to the current state information.
Next, steps S801 to S804 will be described in detail.
In the embodiments of the present application, the developer typically does not need excessive processing, considering that in most cases the operating system of the terminal device has already well supported and mapped the mouse and keyboard (i.e. the first type of terminal device). The input information of the mouse and the keyboard is directly transmitted to the operating system, and the operating system forwards the input information to the running program, including the target application running by the android simulator. Thus, the target application running by the android simulator can directly receive and process input information from the mouse and keyboard without additional "pass through" operations. It should be noted that, the meaning of "penetrating" herein means that according to an input event generated by a touch operation of a user on an external device, a corresponding input event is also generated in the android simulator, which is equivalent to that an android application running in the android simulator is actually connected to an external device. For example, the user presses the W key on the external device keyboard of the terminal device, and the application back-end process may monitor the pressing event of the W key of the keyboard, and then the application back-end process creates the W key pressing event of the virtual keyboard. For another example, the user may shake the left rocker on the external device handle of the terminal device, and the application back-end process may monitor for a left rocker shake event on the handle, and then create a left rocker shake event for the virtual handle using the back-end process. Thus, the user can directly perform interactive operation on the target application running on the android simulator through the external device without additional setting or key-event mapping.
In the embodiment of the application, the terminal equipment and the second type of external equipment need to be obtained, and the target driving program is additionally constructed in advance to obtain the connection state information of the target external equipment. After the target driver is successfully built for the target external device belonging to the second type, the input state information of the target external device can be acquired, and the input state information is stored and determined as target input state information. And acquiring current input state information of the target external device every preset time. And under the condition that the target input state information is inconsistent with the current input state information, updating the target input state information into the current input state information, and generating a first input event aiming at the target external equipment according to the current state information.
In an alternative embodiment, the second type of external device configuration input criteria includes a first input criteria and a second input criteria. One possible implementation manner of "obtaining the input status information of the target external device" in step S801 includes step S8011:
s8011, based on a target input standard, determining input state information of the target external device, wherein the target input standard is a first input standard or a second input standard.
In the embodiment of the present application, taking the external device belonging to the second type as the handle as an example, there are two main input standards (xinput (i.e., the first input standard) and directinput (i.e., the second input standard) for the external device such as the handle at present. Thus, respective drivers are created for the two different input criteria, which have different connection query, status acquisition modes.
Illustratively, the input state information of the target external device under the input standard xinput is obtained as shown in the following procedure for creating the target driver for the external device-handle with the input standard xinput.
XINPUT_ STATE STATE; a variable of type XINPUT_STATE is declared
ZeroMemory (& STATE), sizeof (XINPUT_STATE)); function call for clearing memory
dwResult=XInputGetState(i,&state);
As with the target driver described above, the return value of XInputGetState may be used to determine whether the terminal device has connected a handle, while the parameter XINPUT_STATE structure in the function call is utilized to obtain the current handle STATE.
Also illustratively, the input state information of the target external device under the input standard directinput is obtained by creating a target driver for the external device-handle with the input standard directinput as shown in the following program.
DirectInput8Create; construction DirectInput
IDirectInput8: enumDevices; external device enumeration/DirectInput
Through the above two steps, directInput devices available for all connections can be obtained.
Then, creating a device instance for the external device obtained by enumeration:
IDirectInput8 CreateDevice; the external device is/is accessed
IDirectInputDevice8: acquire; obtaining/obtaining external device state
IDirectInputDevice8::GetDeviceState;
Wherein IDirectInput8: enumDevices is a function in DirectX for device enumeration (DeviceEnumeration) which serves to enumerate and obtain information about external devices. Specifically, IDirectInput8: enumDevices functions may be used to obtain a list of devices associated with an external device (e.g., keyboard, mouse, gamepad, etc.). By calling this function, detailed information of all input devices connected to the terminal device, such as device type, device name, device identifier, etc., can be acquired. Device enumeration is very common in the field of game development and the like, which can help applications determine available input devices and provide a better interactive experience for users. By enumerating the devices, the application may detect the type of input device used by the user and perform corresponding processing according to the different device types. For example, in a game, the application may set a corresponding control mode or key map according to the type of gamepad used by the player. IDirectInput8 EnumDevices functions require an incoming callback function that is called to provide device information when enumerating to each device. In this way, the application may obtain information for each device in the list of devices in turn and process or store the information accordingly.
One possible implementation manner of "generating and constructing the first input event for the target external device according to the current state information" in step S804 includes step S8041:
S8041, generating a first input event aiming at the target external device according to the target input standard and the current state information.
In the embodiment of the present application, the target input standard is a first input standard or a second input standard. Under the condition that the target input standard is determined to be the first input standard, generating a first input event aiming at the target external equipment according to the first input standard and the current state information; and under the condition that the target input standard is determined to be the second input standard, generating a first input event aiming at the target external equipment according to the second input standard and the current state information.
Illustratively, taking an external device-handle of the second type as an example, the target input standard is xinput (i.e., the first input standard) or directinput (i.e., the second input standard). Under the condition that the target input standard is xinput, generating a first input event aiming at the target external equipment according to xinput and the current state information of the handle; in the event that the target input criteria is directinput, a first input event is generated for the target external device according to directinput and current state information of the handle.
Next, with reference to fig. 2, taking the external device belonging to the second type as a handle as an example, the above-mentioned alternative implementation is exemplarily described, and fig. 2 is a schematic flow chart for generating a handle input event according to an embodiment of the present application.
As shown in fig. 2, a handle connected to the terminal device is acquired, and connection information of the handle is acquired. And acquiring state information of the handle every expected time. Acquiring and recording handle state information based on xinput input standard under the condition that the target input standard is xinput; in the case where the target input standard is directinput, handle state information based on the directinput input standard is acquired and recorded. And acquiring the last acquired handle state information, and judging whether the handle state information is changed according to the last handle state and the current handle state. And under the condition that the handle is determined to be changed, updating the recorded handle state information, and generating a handle input event according to the current handle state information. Specifically, in the case where the target input criterion is xinput, a handle input event is generated based on xinput; in the case of target input criteria directinput, a handle input event is generated based on directinput. And finally, converting the handle input event into an Android handle input event in the Android specification.
An optional implementation manner, the input control method based on the android simulator provided by the embodiment of the application further includes step S90:
And S90, setting initial device data for the virtual external device corresponding to the target external device by applying the back-end process aiming at the target external device belonging to the second type.
In the embodiment of the application, aiming at the target external equipment belonging to the second type, the application back-end process sets initial equipment data for the virtual external equipment corresponding to the target external equipment. In this way, when the terminal equipment is connected with the handle, the handle information queried by the target application running by the application back-end process is constructed based on the actual physical handle; when the terminal device is not connected with the handle, the handle information queried by the target application running by the application back-end process is a default value set for the virtual handle in advance, namely initial device data (namely initial handle information).
Next, with reference to fig. 3, the foregoing optional implementation manner is illustrated, and fig. 3 is a schematic flow chart of a handle input control based on an android simulator according to an embodiment of the present application.
As shown in fig. 3, the android simulator includes a shell process and an application back-end process, and the application back-end process is running a target application, such as an android game application. The terminal equipment is connected with a handle, and the shell process monitors the plugging state of the handle. After the driver finds the access handle, the handle information and the first input event corresponding to the handle are acquired, and first input data of the handle are created according to the first input event. The shell process then sends the first input data of the handle to the application backend process over a communication link (e.g., http communication link, TCP communication link, etc., by way of example only). And the application back-end process monitors the data sent by the shell process in real time. The application back-end process receives first input data of the handle sent by the shell process, generates second input data according to the first input data, sends the second input data to the target virtual handle, and stores the first input data. The application back-end process sends a request for inquiring handle information to the shell process, the shell process sends the handle information to the application back-end process, and then the application back-end process builds an application inquiring result based on the stored handle information.
Aiming at the prior art, when mapping the input operation of a user on the external equipment connected with the terminal equipment into the key-touch event mapping, the user cannot obtain the operation experience most suitable for the terminal equipment due to inflexible operation mode, and lacks operation prompt, so that the user has higher learning cost.
Compared with the prior art, the input control method based on the android simulator has the following advantages: the input event of the external device is not processed into key mapping by a user, but is directly sent to the shell process of the android simulator, the corresponding virtual external device is built in the android simulator, the external input event conforming to the android specification is generated, and therefore the target application running on the android simulator can identify the external device (such as a keyboard, a mouse and a handle) and is used as the external device to carry out input processing. Therefore, when the user uses the external equipment, the input event of the external equipment is generated, and correspondingly, the input event of the virtual external equipment is generated on the android simulator synchronously, so that the operation is very smooth, and the delay or the blocking feeling is avoided. And after the input operation of the user on the external device is transferred to the android simulator, the input operation can be accurately identified and executed and is consistent with the expectation of the user. For example, when a user uses a real mouse, virtual mouse cursor movement in an android application running on an android simulator can be very accurate, and clicking operation can be accurately performed, so that the user can feel smooth and accurate operation experience with high restoration degree of terminal equipment.
The input control device based on the android simulator provided by the application is described below, and the input control device based on the android simulator described below and the input control method based on the android simulator described above can be referred to correspondingly.
Fig. 4 is a schematic structural diagram of an input control device based on an android simulator according to an embodiment of the present application, where the device is applied to an android simulator running on a terminal device, and the android simulator includes a shell process and an application back-end process, and the application back-end process is currently running a target application. As shown in fig. 4, the input control device 400 based on the android simulator includes: an acquisition module 401, a first sending module 402, a processing module 403, and a second sending module 404.
The acquisition module is used for acquiring a first input event of the target external equipment by the shell process, determining first input data corresponding to the first input event according to the first input event and a preset rule, wherein the first input event is generated by triggering operation on the target external equipment connected with the terminal equipment, and the preset rule is used for constructing the input data according to the input event;
the first sending module is used for sending the first input data to the application back-end process by the shell process;
The processing module is used for receiving the first input data by the application back-end process, generating second input data according to the first input data, wherein the second input data is used for triggering a target virtual external device corresponding to the target application so as to generate a second input event corresponding to the first input event in the target application, and the target virtual external device is associated with the target external device;
And the second sending module is used for sending the second input data to the target virtual external device by the application back-end process.
Optionally, the device further comprises a creation module, wherein the creation module is specifically configured to:
And the application back-end process creates virtual external devices corresponding to the external devices aiming at the external devices connected with the terminal device so as to control the target application through the virtual external devices.
Optionally, the processing module is specifically configured to:
And generating second input data according to the first input data and the target corresponding relation, wherein the target corresponding relation is used for indicating the conversion relation between the first input data of the target external equipment and the second input data of the target virtual external equipment.
Optionally, the terminal device is in a connection state with a plurality of different external devices at present, and each external device and the corresponding virtual external device have a first corresponding relationship on input data; before the second input data is generated according to the corresponding relation between the first input data and the target, the processing module is further configured to:
determining a target external device according to the first input data;
And determining a target corresponding relation according to the target external equipment and the plurality of first corresponding relations.
Optionally, the device type of the external device currently connected to the terminal device includes one or more of a first type and a second type, the terminal device does not need to additionally construct a driver when acquiring the connection state information of the external device of the first type, and the terminal device does not need to additionally construct a driver when acquiring the connection state information of the external device of the second type;
in the case that the target external device belongs to the second type, before the shell process obtains the first input event of the target external device, the apparatus further includes a determining module, where the determining module is specifically configured to:
Constructing a target driving program and acquiring connection state information of the target external equipment;
Acquiring input state information of the target external equipment, and storing and determining the input state information as target input state information;
acquiring current input state information of the target external equipment every time a preset time length is set;
And under the condition that the target input state information is inconsistent with the current input state information, updating the target input state information into the current input state information, and generating a first input event aiming at the target external equipment according to the current state information.
Optionally, the second type of external device configuration input standard includes a first input standard and a second input standard; the determining module is specifically configured to:
determining input state information of the target external equipment based on a target input standard, wherein the target input standard is a first input standard or a second input standard;
Generating a first input event for the target external device according to the current state information, including:
And generating a first input event aiming at the target external equipment according to the target input standard and the current state information.
Optionally, the creating module is further configured to:
and setting initial device data for the virtual external device corresponding to the target external device by the application back-end process aiming at the target external device belonging to the second type.
The input control device based on the android simulator provided in this embodiment may be used to execute the technical scheme of the input control method embodiment based on the android simulator, and its implementation principle and technical effect are similar, and this embodiment is not repeated here.
Fig. 5 is a schematic hardware structure of an electronic device according to an embodiment of the present application, as shown in fig. 5, an electronic device 500 of the present embodiment includes: a processor 501 and a memory 502; wherein the method comprises the steps of
A memory 502 for storing computer-executable instructions;
The processor 501 is configured to execute computer-executable instructions stored in the memory, so as to implement the steps executed by the input control method based on the android simulator in the above embodiment. Reference may be made in particular to the relevant description of the embodiments of the method described above.
Alternatively, the memory 502 may be separate or integrated with the processor 501.
When the memory 502 is provided separately, the electronic device further comprises a bus 503 for connecting said memory 502 and the processor 501.
An embodiment of the present application further provides a computer readable storage medium, where computer execution instructions are stored, and when a processor executes the computer execution instructions, the technical scheme corresponding to the input control method based on the android simulator in any one of the above embodiments executed by the electronic device is implemented.
One embodiment of the present application also provides a computer program product comprising: and the computer program is stored in the readable storage medium, and the at least one processor of the electronic device can read the computer program from the readable storage medium, and the at least one processor executes the computer program to enable the electronic device to execute the technical scheme corresponding to the input control method based on the android simulator in any embodiment.
While the application has been described in terms of preferred embodiments, it is not intended to be limiting, but rather, it will be apparent to those skilled in the art that various changes and modifications can be made herein without departing from the spirit and scope of the application as defined by the appended claims.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be additional divisions when actually implemented, for example, multiple modules 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 modules, which may be in electrical, mechanical, or other forms.
The integrated modules, which are implemented in the form of software functional modules, may be stored in a computer readable storage medium. The software functional module is stored in a storage medium, and includes several instructions for causing an electronic device (which may be a personal computer, a server, or a network device, etc.) or a processor (english: processor) to perform some of the steps of the methods according to the embodiments of the application.
It should be understood that the above Processor may be a central processing module (english: central Processing Unit, abbreviated as CPU), or may be other general purpose processors, a digital signal Processor (english: DIGITAL SIGNAL Processor, abbreviated as DSP), an Application-specific integrated Circuit (english: application SPECIFIC INTEGRATED Circuit, abbreviated as ASIC), or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in a processor for execution.
The memory may comprise a high-speed RAM memory, and may further comprise a non-volatile memory NVM, such as at least one magnetic disk memory, and may also be a U-disk, a removable hard disk, a read-only memory, a magnetic disk or optical disk, etc.
The bus may be an industry standard architecture (Industry Standard Architecture, ISA) bus, an external device interconnect (PERIPHERAL COMPONENT, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, the buses in the drawings of the present application are not limited to only one bus or to one type of bus.
The storage medium may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the method embodiments described above may be performed by hardware associated with program instructions. The foregoing program may be stored in a computer readable storage medium. The program, when executed, performs steps including the method embodiments described above; and the aforementioned storage medium includes: various media that can store program code, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the application.

Claims (10)

1. An input control method based on an android simulator is characterized by being applied to the android simulator running on a terminal device, wherein the android simulator comprises a shell process and an application back-end process, and the application back-end process is currently running a target application, and the method comprises the following steps:
The shell process obtains a first input event of the target external device, determines first input data corresponding to the first input event according to the first input event and a preset rule, wherein the first input event is generated by triggering operation on the target external device connected with the terminal device, and the preset rule is used for constructing the input data according to the input event;
the shell process sends the first input data to the application back-end process;
The application back-end process receives the first input data, generates second input data according to the first input data, and the second input data is used for triggering a target virtual external device corresponding to the target application so as to generate a second input event corresponding to the first input event in the target application, wherein the target virtual external device is associated with the target external device;
and the application back-end process sends the second input data to the target virtual external device.
2. The method of claim 1, wherein prior to the application back-end process receiving the first input data, the method further comprises:
And the application back-end process creates virtual external devices corresponding to the external devices aiming at the external devices connected with the terminal device so as to control the target application through the virtual external devices.
3. The method of claim 1, wherein the generating second input data from the first input data comprises:
And generating second input data according to the first input data and the target corresponding relation, wherein the target corresponding relation is used for indicating the conversion relation between the first input data of the target external equipment and the second input data of the target virtual external equipment.
4. The method of claim 3, wherein the terminal device is currently connected to a plurality of different external devices, and each of the external devices has a first correspondence with a corresponding virtual external device on input data; before generating the second input data according to the corresponding relation between the first input data and the target, the method further comprises:
determining a target external device according to the first input data;
And determining a target corresponding relation according to the target external equipment and the plurality of first corresponding relations.
5. The method of claim 1, wherein the device type of the external device to which the terminal device is currently connected includes one or more of a first type and a second type, the terminal device does not need to additionally construct a driver to obtain connection state information of the external device of the first type, and the terminal device does not need to additionally construct a driver to obtain connection state information of the external device of the second type;
in the case that the target external device is of the second type, before the shell process obtains the first input event of the target external device, the method further includes:
Constructing a target driving program and acquiring connection state information of the target external equipment;
Acquiring input state information of the target external equipment, and storing and determining the input state information as target input state information;
acquiring current input state information of the target external equipment every time a preset time length is set;
And under the condition that the target input state information is inconsistent with the current input state information, updating the target input state information into the current input state information, and generating a first input event aiming at the target external equipment according to the current state information.
6. The method of claim 5, wherein the second type of external device configuration input criteria comprises a first input criteria and a second input criteria;
the obtaining the input state information of the target external device includes:
determining input state information of the target external equipment based on a target input standard, wherein the target input standard is a first input standard or a second input standard;
Generating a first input event for the target external device according to the current state information, including:
And generating a first input event aiming at the target external equipment according to the target input standard and the current state information.
7. The method of claim 5, wherein the method further comprises:
and setting initial device data for the virtual external device corresponding to the target external device by the application back-end process aiming at the target external device belonging to the second type.
8. An input control device based on an android simulator, which is applied to the android simulator running on a terminal device, wherein the android simulator comprises a shell process and an application back-end process, and the application back-end process is currently running a target application, and the device comprises:
The acquisition module is used for acquiring a first input event of the target external equipment by the shell process, determining first input data corresponding to the first input event according to the first input event and a preset rule, wherein the first input event is generated by triggering operation on the target external equipment connected with the terminal equipment, and the preset rule is used for constructing the input data according to the input event;
the first sending module is used for sending the first input data to the application back-end process by the shell process;
The processing module is used for receiving the first input data by the application back-end process, generating second input data according to the first input data, wherein the second input data is used for triggering a target virtual external device corresponding to the target application so as to generate a second input event corresponding to the first input event in the target application, and the target virtual external device is associated with the target external device;
And the second sending module is used for sending the second input data to the target virtual external device by the application back-end process.
9. An electronic device, the electronic device comprising:
A processor; and
A memory for storing an input control program based on an android simulator, the electronic device executing the input control method based on the android simulator according to any one of claims 1 to 7 after being powered on and running the program by the processor.
10. A computer-readable storage medium, in which an input control program based on an android simulator is stored, the program being executed by a processor to perform the input control method based on an android simulator according to any one of claims 1 to 7.
CN202410276957.2A 2024-03-11 2024-03-11 Input control method, device and equipment based on android simulator Pending CN118320410A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410276957.2A CN118320410A (en) 2024-03-11 2024-03-11 Input control method, device and equipment based on android simulator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410276957.2A CN118320410A (en) 2024-03-11 2024-03-11 Input control method, device and equipment based on android simulator

Publications (1)

Publication Number Publication Date
CN118320410A true CN118320410A (en) 2024-07-12

Family

ID=91768472

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410276957.2A Pending CN118320410A (en) 2024-03-11 2024-03-11 Input control method, device and equipment based on android simulator

Country Status (1)

Country Link
CN (1) CN118320410A (en)

Similar Documents

Publication Publication Date Title
US7757207B2 (en) Form skin and design time WYSIWYG for .net compact framework
CN109544663B (en) Virtual scene recognition and interaction key position matching method and device of application program
CA2925015C (en) System and method for testing data representation for different mobile devices
US7398474B2 (en) Method and system for a digital device menu editor
KR102108583B1 (en) Instantiable gesture objects
US8601449B2 (en) Cross-platform application framework
US20030131148A1 (en) Cross-platform software development with a software development peripheral
US20040014526A1 (en) Interface arbitrator for allowing multiple devices to share physical input/output interfaces and other resources
US20120323950A1 (en) Embedded query formulation service
EP2872983B1 (en) Implementing previously rendered frame buffer information in a customized gui display
CN107391119B (en) Method and device for realizing horizontal and vertical screens
CN112783761A (en) Method, device and system for testing cold start duration of application program
US20050050556A1 (en) Dynamic layout method for an application program module
US9892022B2 (en) Apparatus for minimally intrusive debugging of production user interface software
US9058759B2 (en) Virtual display device drivers compatible with windows display driver model
CN114028801A (en) User input method, device, equipment and storage medium based on cloud
CN116028356A (en) Bluetooth-based terminal software testing method and device
CN118320410A (en) Input control method, device and equipment based on android simulator
CN110879711A (en) Personal cloud system and related localization method thereof
CN113680051A (en) Game control method, device, equipment and storage medium
KR102567773B1 (en) Log information extraction device and method in combat system system
CN114513736B (en) Acoustic testing method, equipment, terminal and storage medium for earphone
JP2001256072A (en) System emulator
CN113204494A (en) Terminal remote test platform and method, electronic equipment and readable medium
CN118295977A (en) Data processing method and device, storage medium and electronic equipment

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