CN113655940A - Linux-compatible Android-compatible simulated double-finger scaling method and device - Google Patents
Linux-compatible Android-compatible simulated double-finger scaling method and device Download PDFInfo
- Publication number
- CN113655940A CN113655940A CN202110974511.3A CN202110974511A CN113655940A CN 113655940 A CN113655940 A CN 113655940A CN 202110974511 A CN202110974511 A CN 202110974511A CN 113655940 A CN113655940 A CN 113655940A
- Authority
- CN
- China
- Prior art keywords
- finger
- double
- event
- android
- mouse
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 36
- 230000009471 action Effects 0.000 claims abstract description 33
- 238000003825 pressing Methods 0.000 claims description 25
- 238000005096 rolling process Methods 0.000 claims description 20
- 238000004088 simulation Methods 0.000 claims description 16
- 230000006870 function Effects 0.000 description 10
- 239000011800 void material Substances 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 239000002904 solvent Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0484—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0484—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
- G06F3/0485—Scrolling or panning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0487—Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/542—Event management; Broadcasting; Multicasting; Notifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2203/00—Indexing scheme relating to G06F3/00 - G06F3/048
- G06F2203/048—Indexing scheme relating to G06F3/048
- G06F2203/04806—Zoom, i.e. interaction techniques or interactors for controlling the zooming operation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Software Systems (AREA)
- Multimedia (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The invention discloses a Linux-compatible Android-compatible simulated double-finger zooming method and device.A simulated double-finger zooming action is executed on an Android application window, whether a set simulated double-finger event rule is met or not is judged, if yes, a double-finger event is generated according to the rule, and data originally describing an input event are converted and packaged into double-finger touch event data; and sending the received double-finger touch event data to the currently active Android application, distributing the simulated motion track through an interface, and executing zooming after the Android application monitors the event. The mouse and keyboard can be used for simulating the function of zooming pictures, maps and the like by two fingers, and the ecological application of Linux compatible with Android is enriched.
Description
Technical Field
The invention relates to the field of computer operating systems, in particular to a Linux-compatible Android-compatible analog two-finger scaling method and device.
Background
When a user uses an Android application in an environment compatible with Android through Linux, the user usually views pictures, maps and the like, but the zooming function of the pictures and the maps used on a mobile phone cannot be normally used in the environment compatible with Android through Linux at present. Due to the fact that under the l inux desktop system, due to the limitation of hardware factors, touch is not supported, the zooming function inside the Android application is lost, and user experience is reduced.
Disclosure of Invention
In order to solve the problem that a mouse and a keyboard are used for simulating double fingers to zoom pictures, maps and the like in an Android application in a Linux-compatible Android environment, the invention provides a Linux-compatible Android-compatible simulated double-finger zooming method and a Linux-compatible Android-compatible simulated double-finger zooming device.
On one hand, the invention provides a Linux-Android-compatible simulated two-finger scaling method, which is applied to an operating environment compatible with Android operation on Linux, and comprises the following steps:
step S1: executing an action simulating the scaling of the two fingers on the Android application window, and detecting and analyzing a message simulating the action simulating the scaling of the two fingers by the Android application window; the actions include: pressing or releasing a keyboard key, pressing or releasing a left key and a right key of a mouse, moving the mouse and rolling a mouse roller;
step S2: the Android application window distributes a message simulating the action of scaling of the two fingers to equipment nodes under a dev/input directory of a Linux side through a socket;
step S3: a system input event reading component on the Android side reads data in a device node under a dev/input directory, and notifies a system input event processing component on the Android side of the read input event message;
step S4: the Android-side system input event processing component analyzes an input event, judges whether the input event meets a set simulation double-finger event rule, generates a double-finger event according to the rule if the input event meets the set simulation double-finger event rule, and converts and encapsulates data originally describing the input event into double-finger touch event data;
step S5: the Android side system input event processing component sends the converted and packaged double-finger touch event data to the Android side system input event distribution component; and the system input event distribution component on the Android side sends the received double-finger touch event data to the currently active Android application, distributes the simulated motion track through an interface, and executes zooming after the Android application monitors the event.
Further, before step S1, the method further includes:
and mounting the equipment under the Linux system/dev/input directory into the container, so that the Android system running in the container has the right to read the data of the equipment node under the Linux side/dev/input directory.
Further, the set simulation double-finger event rule in the method specifically includes:
when any key in the keyboard is pressed and the mouse is slid, the mouse slides rightwards to simulate the double-finger zooming-in operation, and the mouse slides leftwards to simulate the double-finger zooming-out operation; or the mouse slides rightwards to simulate the double-finger zooming-out operation, and the mouse slides leftwards to simulate the double-finger zooming-in operation;
when any key in the keyboard is pressed down and the roller of the mouse is rolled, the upward rolling of the roller of the mouse simulates the double-finger zooming-in operation, and the downward rolling of the roller of the mouse simulates the double-finger zooming-out operation; or the mouse roller rolls upwards to simulate the double-finger zooming-out operation, and the mouse roller rolls downwards to simulate the double-finger zooming-in operation.
Further, in the method, the data originally describing the input event is converted and encapsulated into the double-finger touch event data, and the double-finger touch event data includes:
the method comprises the steps of identifying a keyboard event, an event type identifier of a mouse event, an Android application active window number of current operation, an action type of pressing, releasing and sliding of a mouse, the occurrence time of the current event and the coordinates of a touch point on an Android application interface.
Further, the simulating double-finger scaling in the method specifically comprises:
simulating a key in a keyboard as a first finger of double fingers of a touch screen, and simulating a mouse as a second finger of the double fingers of the touch screen; or,
the method includes the steps of simulating a key in a keyboard as a first finger of double fingers of a touch screen, and simulating a mouse wheel as a second finger of the double fingers of the touch screen.
On the other hand, the invention provides a Linux-Android-compatible analog double-finger scaling device, which is applied to an operating environment compatible with Android running on Linux, and comprises the following components:
a memory for storing a program;
a processor for executing the program stored in the memory, the processor being configured to, when the program stored in the memory is executed:
executing an action simulating the scaling of the two fingers on the Android application window, and detecting and analyzing a message simulating the action simulating the scaling of the two fingers by the Android application window; the actions include: pressing or releasing a keyboard key, pressing or releasing a left key and a right key of a mouse, moving the mouse and rolling a mouse roller;
the Android application window distributes a message simulating the action of scaling of the two fingers to equipment nodes under a dev/input directory of a Linux side through a socket;
a system input event reading component on the Android side reads data in a device node under a dev/input directory, and notifies a system input event processing component on the Android side of the read input event message;
the Android-side system input event processing component analyzes an input event, judges whether the input event meets a set simulation double-finger event rule, generates a double-finger event according to the rule if the input event meets the set simulation double-finger event rule, and converts and encapsulates data originally describing the input event into double-finger touch event data;
the Android side system input event processing component sends the converted and packaged double-finger touch event data to the Android side system input event distribution component; and the system input event distribution component on the Android side sends the received double-finger touch event data to the currently active Android application, distributes the simulated motion track through an interface, and executes zooming after the Android application monitors the event.
Further, the processor is further configured to:
and mounting the equipment under the Linux system/dev/input directory into the container, so that the Android system running in the container has the right to read the data of the equipment node under the Linux side/dev/input directory.
Further, the simulation double-finger event rule set by the processor specifically includes:
when any key in the keyboard is pressed and the mouse is slid, the mouse slides rightwards to simulate the double-finger zooming-in operation, and the mouse slides leftwards to simulate the double-finger zooming-out operation; or the mouse slides rightwards to simulate the double-finger zooming-out operation, and the mouse slides leftwards to simulate the double-finger zooming-in operation;
when any key in the keyboard is pressed down and the roller of the mouse is rolled, the upward rolling of the roller of the mouse simulates the double-finger zooming-in operation, and the downward rolling of the roller of the mouse simulates the double-finger zooming-out operation; or the mouse roller rolls upwards to simulate the double-finger zooming-out operation, and the mouse roller rolls downwards to simulate the double-finger zooming-in operation.
Further, the two-finger touch event data comprises:
the method comprises the steps of identifying a keyboard event, an event type identifier of a mouse event, an Android application active window number of current operation, an action type of pressing, releasing and sliding of a mouse, the occurrence time of the current event and the coordinates of a touch point on an Android application interface.
Further, the simulating the scaling of the two fingers specifically includes:
simulating a key in a keyboard as a first finger of double fingers of a touch screen, and simulating a mouse as a second finger of the double fingers of the touch screen; or,
the method includes the steps of simulating a key in a keyboard as a first finger of double fingers of a touch screen, and simulating a mouse wheel as a second finger of the double fingers of the touch screen.
Compared with the prior art, the invention has the following advantages:
in the environment of Linux compatible with Android, the invention realizes the function of zooming pictures, maps and the like by using a mouse and a keyboard to simulate two fingers in Android application, and enriches the ecological application of Linux compatible with Android.
Drawings
Fig. 1 is a schematic diagram of a Linux-compatible Android scaling method;
fig. 2 is a schematic composition diagram of a Linux-compatible Android simulated two-finger scaling device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
For the operating environment compatible with Android running on the Linux operating system, the Android operating environment runs in a container.
Fig. 1 is a Linux-Android-compatible simulated two-finger scaling method provided in an embodiment of the present invention, which is applied in an operating environment where Android is compatible to run on Linux, and includes the following steps:
step S1: executing an action simulating the scaling of the two fingers on the Android application window, and detecting and analyzing a message simulating the action simulating the scaling of the two fingers by the Android application window; the actions include: pressing or releasing a keyboard key, pressing or releasing a left key and a right key of a mouse, moving the mouse and rolling a mouse roller;
for example, when an Android application window executes an action of simulating two-finger zooming, a crtl key of a keyboard can be pressed, and a mouse is dragged to move back and forth; or press the crtl button in the keyboard and scroll the mouse wheel up and down.
And pressing a crtl key on a keyboard under a certain Android application window. And the Android application window detects a pressing event of the crtl key. The Android application window is a window program realized through QT, and is mainly realized through QSinow class and QWidget class of QT.
For both the QWindow and QWidget classes, a key press event, i.e., void key press event (QKeyEvent) override, can be obtained by rewriting the keypress event function; the keyPresssevent function can acquire key press event messages of QBindow and QWidget, wherein the pressed key value can be read through event- > key (), so that whether the key is a ctrl key or not is judged.
For both the QSinow and QWidget classes, mouse press and release events can be captured by rewriting the mousePresEvent and mouseReleaseEvent functions, i.e., the mouse press and release events
void mousePressEvent(QKeyEvent*event)override;
void mouseReleaseEvent(QKeyEvent*event)override;
The mousedepressevent function can acquire mouse-down event messages of QWindow and QWidget, and the mouseReleaseevent function can acquire mouse-up event messages of QWindow and QWidget, wherein coordinate values of mouse-down or mouse-down can be read through event- > x () and event- > y ().
For both the QWindow and QWidget classes, mouse wheel scroll events can be obtained by rewriting the wheelEvent function, i.e., the
void wheelEvent(QWheelEvent*event)override;
The mousePressEvent function can acquire mouse wheel scroll event messages of QWindow and QWidget, wherein the vertical y coordinate distance of the mouse wheel scroll can be read through event- > delta (), the value of which is greater than 0 represents downward scroll, and the value of which is less than 0 represents upward scroll.
Step S2: the Android application window distributes a message simulating the action of scaling of the two fingers to equipment nodes under a dev/input directory of a Linux side through a socket;
step S3: a system input event reading component on the Android side reads data in a device node under a dev/input directory, and notifies a system input event processing component on the Android side of the read input event message;
the Android-side system input event reading component eventhb can continuously read data in the device nodes/dev/input/event 0,/dev/input/event 1,/dev/input/event 2, and can read keyboard key pressing events, mouse pressing and moving events and mouse wheel rolling events.
Step S4: the Android-side system input event processing component analyzes an input event, judges whether the input event meets a set simulation double-finger event rule, generates a double-finger event according to the rule if the input event meets the set simulation double-finger event rule, and converts and encapsulates data originally describing the input event into double-finger touch event data;
in particular, the amount of the solvent to be used,
the structure of the type of the original data read by the Android side input event reading component EventHub is as follows:
in the input _ event structure, a field type is a device type and comprises three types, namely a mouse, a keyboard and a touch;
the field code is an accessory attribute of type, a roller and a coordinate attribute exist in mouse operation, a key number attribute exists in a keyboard, and a coordinate attribute exists in touch;
the field value represents the value of the code attribute, which is added to the description below for three device data reports:
when the roller operates and reports, the value of the required attribute is obtained through input _ event- > code. input _ event- > code ═ REL _ WHEEL, which represents the roller attribute, at this time, input _ event- > value is to obtain the current roller direction, more than 0 represents downward scrolling, and less than 0 represents upward scrolling; if input _ event- > code is ═ ABS _ X, representing the X coordinate attribute, and at the moment, input _ event- > value is to obtain the X coordinate value; if input _ event- > code is equal to ABS _ Y, representing the Y coordinate attribute, and obtaining the Y coordinate value by input _ event- > value at the moment;
when a keyboard is operated, code is a corresponding key number, if input _ event- > code ═ 29 represents a ctrl key number, at this time, input _ event- > value can acquire a key pressing and lifting state, value ═ 1 represents pressing, and value ═ 0 represents lifting;
when there is a touch operation, if input _ event- > code is ═ ABS _ X, it represents an X coordinate attribute, and at this time, input _ event- > value is to obtain an X coordinate value; if input _ event- > code is equal to ABS _ Y, representing the Y coordinate attribute, at this time, input _ event- > value is to obtain the Y coordinate value.
The Android side input event processing component InputREADER converts and encapsulates original data into a MotionEvent data type of a touch event as follows:
in the MotionEvent data type, a field mdevice id represents a device identifier, mdevice id ═ 1 represents a keyboard event, mdevice id ═ 2 represents a mouse event, mdevice id ═ 3 represents a touch event, since a touch event is simulated, mdevice id should be equal to 3 in this case;
the field mDisplayId represents the active window number of the current operation;
the field mAction represents three actions of pressing, sliding and lifting;
the field mdown time indicates the time when the current event occurs;
the field mPointerCoords stores the x, y coordinates of a touch point, and Vector is a set type, indicating that a touch point may be multiple.
Step S5: the Android side system input event processing component sends the converted and packaged double-finger touch event data to the Android side system input event distribution component; and the system input event distribution component on the Android side sends the received double-finger touch event data to the currently active Android application, distributes the simulated motion track through an interface, and executes zooming after the Android application monitors the event.
Further, before step S1, the method further includes:
and mounting the equipment under the Linux system/dev/input directory into the container, so that the Android system running in the container has the right to read the data of the equipment node under the Linux side/dev/input directory.
When a docker container for operating the Android system is created (docker create instruction), a mouse (left and right keys, movement) input communication device node (/ dev/input/event0), a mouse wheel rolling input communication device node (/ dev/input/event1) and a keyboard key input communication device node (/ dev/input/event2) on the Linux system are mounted into the docker container through a parameter of-device ═/dev/input:/dev/input/: rwm, so that the Android system operating in the docker container has the right to read the socket message sent by the system through the device node.
docker is a container technology that effectively partitions resources of a single operating system into isolated groups to better balance conflicting resource usage requirements among the isolated groups. In the Linux-compatible Android environment, the Android system runs in a docker container of a Linux end. The docker create command can create a docker container through a docker image, and the docker create-device ═ dev/input:/: rwm parameter can mount the device under the Linux system/dev/input directory into the docker container, so that the Android system running in the docker container has the right to read data in all device nodes under the Linux terminal/dev/input directory. And communicating an instruction of the name of the docket start container on the Linux side, and operating the docker container, wherein the Android system in the docker container is also operated.
Further, the set simulation double-finger event rule in the method specifically includes:
when any key in the keyboard is pressed and the mouse is slid, the mouse slides rightwards to simulate the double-finger zooming-in operation, and the mouse slides leftwards to simulate the double-finger zooming-out operation; or the mouse slides rightwards to simulate the double-finger zooming-out operation, and the mouse slides leftwards to simulate the double-finger zooming-in operation;
when any key in the keyboard is pressed down and the roller of the mouse is rolled, the upward rolling of the roller of the mouse simulates the double-finger zooming-in operation, and the downward rolling of the roller of the mouse simulates the double-finger zooming-out operation; or the mouse roller rolls upwards to simulate the double-finger zooming-out operation, and the mouse roller rolls downwards to simulate the double-finger zooming-in operation.
Further, in the method, the data originally describing the input event is converted and encapsulated into the double-finger touch event data, and the double-finger touch event data includes:
the method comprises the steps of identifying a keyboard event, an event type identifier of a mouse event, an Android application active window number of current operation, an action type of pressing, releasing and sliding of a mouse, the occurrence time of the current event and the coordinates of a touch point on an Android application interface.
Further, the simulating double-finger scaling in the method specifically comprises:
simulating a key in a keyboard as a first finger of double fingers of a touch screen, and simulating a mouse as a second finger of the double fingers of the touch screen; or,
the method includes the steps of simulating a key in a keyboard as a first finger of double fingers of a touch screen, and simulating a mouse wheel as a second finger of the double fingers of the touch screen.
Fig. 2 is a Linux-Android-compatible simulated two-finger scaling device according to an embodiment of the present invention, where the Linux-Android-compatible simulated two-finger scaling device is applied in an operating environment where Linux is compatible with Android running, and the Linux-Android-compatible simulated two-finger scaling device includes:
a memory for storing a program;
a processor for executing the program stored in the memory, the processor being configured to, when the program stored in the memory is executed:
executing an action simulating the scaling of the two fingers on the Android application window, and detecting and analyzing a message simulating the action simulating the scaling of the two fingers by the Android application window; the actions include: pressing or releasing a keyboard key, pressing or releasing a left key and a right key of a mouse, moving the mouse and rolling a mouse roller;
the Android application window distributes a message simulating the action of scaling of the two fingers to equipment nodes under a dev/input directory of a Linux side through a socket;
a system input event reading component on the Android side reads data in a device node under a dev/input directory, and notifies a system input event processing component on the Android side of the read input event message;
the Android-side system input event processing component analyzes an input event, judges whether the input event meets a set simulation double-finger event rule, generates a double-finger event according to the rule if the input event meets the set simulation double-finger event rule, and converts and encapsulates data originally describing the input event into double-finger touch event data;
the Android side system input event processing component sends the converted and packaged double-finger touch event data to the Android side system input event distribution component; and the system input event distribution component on the Android side sends the received double-finger touch event data to the currently active Android application, distributes the simulated motion track through an interface, and executes zooming after the Android application monitors the event.
Further, the processor is further configured to:
and mounting the equipment under the Linux system/dev/input directory into the container, so that the Android system running in the container has the right to read the data of the equipment node under the Linux side/dev/input directory.
Further, the simulation double-finger event rule set by the processor specifically includes:
when any key in the keyboard is pressed and the mouse is slid, the mouse slides rightwards to simulate the double-finger zooming-in operation, and the mouse slides leftwards to simulate the double-finger zooming-out operation; or the mouse slides rightwards to simulate the double-finger zooming-out operation, and the mouse slides leftwards to simulate the double-finger zooming-in operation;
when any key in the keyboard is pressed down and the roller of the mouse is rolled, the upward rolling of the roller of the mouse simulates the double-finger zooming-in operation, and the downward rolling of the roller of the mouse simulates the double-finger zooming-out operation; or the mouse roller rolls upwards to simulate the double-finger zooming-out operation, and the mouse roller rolls downwards to simulate the double-finger zooming-in operation.
Further, the two-finger touch event data comprises:
the method comprises the steps of identifying a keyboard event, an event type identifier of a mouse event, an Android application active window number of current operation, an action type of pressing, releasing and sliding of a mouse, the occurrence time of the current event and the coordinates of a touch point on an Android application interface.
Further, the simulating the scaling of the two fingers specifically includes:
simulating a key in a keyboard as a first finger of double fingers of a touch screen, and simulating a mouse as a second finger of the double fingers of the touch screen; or,
the method includes the steps of simulating a key in a keyboard as a first finger of double fingers of a touch screen, and simulating a mouse wheel as a second finger of the double fingers of the touch screen.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that changes may be made in the embodiments and/or equivalents thereof without departing from the spirit and scope of the invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (10)
1. A Linux-compatible Android dual-finger scaling method is applied to an environment compatible with Android running on Linux, and comprises the following steps:
step S1: executing an action simulating the scaling of the two fingers on the Android application window, and detecting and analyzing a message simulating the action simulating the scaling of the two fingers by the Android application window; the actions include: pressing or releasing a keyboard key, pressing or releasing a left key and a right key of a mouse, moving the mouse and rolling a mouse roller;
step S2: the Android application window distributes a message simulating the action of scaling of the two fingers to equipment nodes under a dev/input directory of a Linux side through a socket;
step S3: a system input event reading component on the Android side reads data in a device node under a dev/input directory, and notifies a system input event processing component on the Android side of the read input event message;
step S4: the Android-side system input event processing component analyzes an input event, judges whether the input event meets a set simulation double-finger event rule, generates a double-finger event according to the rule if the input event meets the set simulation double-finger event rule, and converts and encapsulates data originally describing the input event into double-finger touch event data;
step S5: the Android side system input event processing component sends the converted and packaged double-finger touch event data to the Android side system input event distribution component; and the system input event distribution component on the Android side sends the received double-finger touch event data to the currently active Android application, distributes the simulated motion track through an interface, and executes zooming after the Android application monitors the event.
2. The Linux-compatible Android simulated two-finger scaling method of claim 1, further comprising, before step S1:
and mounting the equipment under the Linux system/dev/input directory into the container, so that the Android system running in the container has the right to read the data of the equipment node under the Linux side/dev/input directory.
3. The Linux-compatible Android simulated two-finger scaling method of claim 1, wherein the set simulated two-finger event rules in the method specifically include:
when any key in the keyboard is pressed and the mouse is slid, the mouse slides rightwards to simulate the double-finger zooming-in operation, and the mouse slides leftwards to simulate the double-finger zooming-out operation; or the mouse slides rightwards to simulate the double-finger zooming-out operation, and the mouse slides leftwards to simulate the double-finger zooming-in operation;
when any key in the keyboard is pressed down and the roller of the mouse is rolled, the upward rolling of the roller of the mouse simulates the double-finger zooming-in operation, and the downward rolling of the roller of the mouse simulates the double-finger zooming-out operation; or the mouse roller rolls upwards to simulate the double-finger zooming-out operation, and the mouse roller rolls downwards to simulate the double-finger zooming-in operation.
4. The Linux-compatible Android simulated two-finger scaling method of claim 1, wherein in the method, data originally describing an input event is converted and encapsulated into two-finger touch event data, and the two-finger touch event data includes:
the method comprises the steps of identifying a keyboard event, an event type identifier of a mouse event, an Android application active window number of current operation, an action type of pressing, releasing and sliding of a mouse, the occurrence time of the current event and the coordinates of a touch point on an Android application interface.
5. The Linux-compatible Android simulated two-finger scaling method of claim 1, wherein the simulated two-finger scaling in the method specifically comprises:
simulating a key in a keyboard as a first finger of double fingers of a touch screen, and simulating a mouse as a second finger of the double fingers of the touch screen; or,
the method includes the steps of simulating a key in a keyboard as a first finger of double fingers of a touch screen, and simulating a mouse wheel as a second finger of the double fingers of the touch screen.
6. A Linux-compatible Android-compatible analog two-finger zooming device is applied to an environment compatible with Android running on Linux, and comprises:
a memory for storing a program;
a processor for executing the program stored in the memory, the processor being configured to, when the program stored in the memory is executed:
executing an action simulating the scaling of the two fingers on the Android application window, and detecting and analyzing a message simulating the action simulating the scaling of the two fingers by the Android application window; the actions include: pressing or releasing a keyboard key, pressing or releasing a left key and a right key of a mouse, moving the mouse and rolling a mouse roller;
the Android application window distributes a message simulating the action of scaling of the two fingers to equipment nodes under a dev/input directory of a Linux side through a socket;
a system input event reading component on the Android side reads data in a device node under a dev/input directory, and notifies a system input event processing component on the Android side of the read input event message;
the Android-side system input event processing component analyzes an input event, judges whether the input event meets a set simulation double-finger event rule, generates a double-finger event according to the rule if the input event meets the set simulation double-finger event rule, and converts and encapsulates data originally describing the input event into double-finger touch event data;
the Android side system input event processing component sends the converted and packaged double-finger touch event data to the Android side system input event distribution component; and the system input event distribution component on the Android side sends the received double-finger touch event data to the currently active Android application, distributes the simulated motion track through an interface, and executes zooming after the Android application monitors the event.
7. The Linux-compatible Android simulated two-finger scaling apparatus of claim 6, wherein the processor is further configured to:
and mounting the equipment under the Linux system/dev/input directory into the container, so that the Android system running in the container has the right to read the data of the equipment node under the Linux side/dev/input directory.
8. The Linux-compatible Android simulated two-finger scaling device of claim 6, wherein the simulated two-finger event rule set by the processor specifically comprises:
when any key in the keyboard is pressed and the mouse is slid, the mouse slides rightwards to simulate the double-finger zooming-in operation, and the mouse slides leftwards to simulate the double-finger zooming-out operation; or the mouse slides rightwards to simulate the double-finger zooming-out operation, and the mouse slides leftwards to simulate the double-finger zooming-in operation;
when any key in the keyboard is pressed down and the roller of the mouse is rolled, the upward rolling of the roller of the mouse simulates the double-finger zooming-in operation, and the downward rolling of the roller of the mouse simulates the double-finger zooming-out operation; or the mouse roller rolls upwards to simulate the double-finger zooming-out operation, and the mouse roller rolls downwards to simulate the double-finger zooming-in operation.
9. The Linux-compatible Android simulated two-finger zoom device of claim 6, wherein the two-finger touch event data comprises:
the method comprises the steps of identifying a keyboard event, an event type identifier of a mouse event, an Android application active window number of current operation, an action type of pressing, releasing and sliding of a mouse, the occurrence time of the current event and the coordinates of a touch point on an Android application interface.
10. The Linux-compatible Android simulated two-finger scaling device of claim 6, wherein the simulated two-finger scaling specifically comprises:
simulating a key in a keyboard as a first finger of double fingers of a touch screen, and simulating a mouse as a second finger of the double fingers of the touch screen; or,
the method includes the steps of simulating a key in a keyboard as a first finger of double fingers of a touch screen, and simulating a mouse wheel as a second finger of the double fingers of the touch screen.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110974511.3A CN113655940A (en) | 2021-08-24 | 2021-08-24 | Linux-compatible Android-compatible simulated double-finger scaling method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110974511.3A CN113655940A (en) | 2021-08-24 | 2021-08-24 | Linux-compatible Android-compatible simulated double-finger scaling method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113655940A true CN113655940A (en) | 2021-11-16 |
Family
ID=78481783
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110974511.3A Pending CN113655940A (en) | 2021-08-24 | 2021-08-24 | Linux-compatible Android-compatible simulated double-finger scaling method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113655940A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113791875A (en) * | 2021-11-18 | 2021-12-14 | 北京鲸鲮信息系统技术有限公司 | Input device virtualization method and device, electronic device and storage medium |
CN116719468A (en) * | 2022-09-02 | 2023-09-08 | 荣耀终端有限公司 | Interactive event processing method and device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105630393A (en) * | 2015-12-31 | 2016-06-01 | 歌尔科技有限公司 | Control method and control device for working mode of touch screen |
CN112231017A (en) * | 2020-10-27 | 2021-01-15 | 北京技德系统技术有限公司 | Virtual keyboard and mouse method and device for compatible operation of Android operating system on Linux |
CN113157464A (en) * | 2021-04-27 | 2021-07-23 | 麒麟软件有限公司 | Method for sharing Linux end input event to Android |
CN113204307A (en) * | 2021-05-06 | 2021-08-03 | 技德技术研究所(武汉)有限公司 | File sending method and device compatible with Android system running on Linux |
-
2021
- 2021-08-24 CN CN202110974511.3A patent/CN113655940A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105630393A (en) * | 2015-12-31 | 2016-06-01 | 歌尔科技有限公司 | Control method and control device for working mode of touch screen |
CN112231017A (en) * | 2020-10-27 | 2021-01-15 | 北京技德系统技术有限公司 | Virtual keyboard and mouse method and device for compatible operation of Android operating system on Linux |
CN113157464A (en) * | 2021-04-27 | 2021-07-23 | 麒麟软件有限公司 | Method for sharing Linux end input event to Android |
CN113204307A (en) * | 2021-05-06 | 2021-08-03 | 技德技术研究所(武汉)有限公司 | File sending method and device compatible with Android system running on Linux |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113791875A (en) * | 2021-11-18 | 2021-12-14 | 北京鲸鲮信息系统技术有限公司 | Input device virtualization method and device, electronic device and storage medium |
CN116719468A (en) * | 2022-09-02 | 2023-09-08 | 荣耀终端有限公司 | Interactive event processing method and device |
WO2024046179A1 (en) * | 2022-09-02 | 2024-03-07 | 荣耀终端有限公司 | Interaction event processing method and apparatus |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109857303B (en) | Interaction control method and device | |
CN113655940A (en) | Linux-compatible Android-compatible simulated double-finger scaling method and device | |
JP4771431B2 (en) | Device and program for event processing function based on operating system | |
CN109656445B (en) | Content processing method, device, terminal and storage medium | |
CN112748843B (en) | Page switching method and device, computer equipment and storage medium | |
CN107608550B (en) | Touch operation response method and device | |
CN111273993B (en) | Icon arrangement method and electronic equipment | |
CN102520899A (en) | Universal cockpit display management system and method for developing corresponding display and control systems | |
CN102109959A (en) | Method for realizing rotation of JAVA application programming interface (API) with rotation of screen | |
CN110442267B (en) | Touch operation response method and device, mobile terminal and storage medium | |
US9880644B2 (en) | Computer input apparatus and method using smart terminal with electronic pen | |
CN113157464A (en) | Method for sharing Linux end input event to Android | |
CN106843794B (en) | Split screen display method and system based on android | |
US9383908B2 (en) | Independent hit testing | |
CN103076974A (en) | Unlocking method and device of touch screen and touch screen equipment | |
CN112347545A (en) | Building model processing method and device, computer equipment and storage medium | |
CN112269501A (en) | Icon moving method and device and electronic equipment | |
CN109521922B (en) | Display scale changing method, device and equipment of terminal | |
CN111324398B (en) | Method, device, terminal and storage medium for processing latest content | |
CN113407075B (en) | Icon sorting method and device and electronic equipment | |
CN106383705B (en) | Method and device for setting mouse display state in application thin client | |
EP3680769A1 (en) | Information display method, apparatus, and terminal | |
CN110245017B (en) | Resource identifier allocation method and equipment | |
Osawa et al. | An Interactive Toolkit Library for 3D Applications: it3d. | |
CN114089885A (en) | Application icon management method and device, electronic equipment and readable storage medium |
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 |