You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. The program will endlessly run the script if run times is set to `0`
@@ -125,50 +113,47 @@ Run specific script with extension `MyExtension`
125
113
126
114
8. Due to the limitation of execution speed, the running speed cannot be set too high.
127
115
128
-
In some system environment, there may be circumstances that the mouse events cannot be fully recorded. To settle this, you can run this program as administrator/root.
116
+
9.In some system environment, there may be circumstances that the mouse events cannot be fully recorded. To settle this, you can run this program as administrator/root.
129
117
130
-
For mac users, make sure that application must be white listed under Enable access for assistive devices. You may also need to whitelist terminal application if running from terminal. If the app crashes, you may try to give write permission for directory `~/.qt_material`.
118
+
10.For mac users, make sure that application must be white listed under Enable access for assistive devices. You may also need to whitelist terminal application if running from terminal. If the app crashes, you may try to give write permission for directory `~/.qt_material`.
131
119
```bash
132
120
chmod -R 770 ~/.qt_material
133
121
```
134
122
123
+
11. For Linux/Mac users, if you have problems recording or executing event after running this program as root, you may refer to [documentation of pynput](https://pynput.readthedocs.io/en/latest/limitations.html)
124
+
135
125
## Grammar of scripts
136
126
> Assume that the resolution of screen is `1920 * 1080`
137
127
128
+
The script is saved in `json5` format, in which each line represents an event
129
+
```json5
130
+
{
131
+
scripts: [
132
+
// Press mouse right button at the relative coordinates `(0.05208, 0.1852)`(i.e. absolute coordinates `(100,200)`) after 3000ms
133
+
{type:"event", event_type:"EM", delay:3000, action_type:"mouse right down", action: ["0.05208%", "0.1852%"]},
134
+
// Release mouse right button at the coordinates after 50ms
135
+
// The mouse event will execute on the position that the cursor is currently in when the coordinate is set to [-1, -1]
136
+
{type:"event", event_type:"EM", delay:50, action_type:"mouse right up", action: [-1, -1]},
[3000, "EM", "mouse right down", ["0.05208%", "0.1852%"]], // Press mouse right button at the relative coordinates `(0.05208, 0.1852)`(i.e. absolute coordinates `(100,200)`) after 3000ms
141
-
[50, "EM", "mouse right up", ["0.05208%", "0.1852%"]], // Release mouse right button at the coordinates after 50ms
[100, "EM", "mouse left down", ["0.2604%", "0.4630%"]], // Press mouse left button at the relative coordinates `(0.2604, 0.4630)`(i.e. absolute coordinates `(500,500)`) after 100ms
145
-
[100, "EM", "mouse move", ["0.2604%", "0.5556%"]], // Move mouse to the relative coordinates `(0.2604, 0.4630)`(i.e. absolute coordinates `(500,500)`) after 100ms
146
-
[100, "EM", "mouse left up", ["0.3125%", "0.5556%"]], // Release mouse left button at the relative coordinates `(0.3125, 0.5556)`(i.e. absolute coordinates `(600,600)`) after 100ms
147
-
[100, "EX", "input", "Hello world"], // Input 'Hello world' at current coordinate after 100ms
148
-
]
149
-
```
150
-
151
-
The script is saved in `json` format, in which each line represents a operation
152
-
+ The first element of each line is time interval(ms), indicating the interval to previous operation
153
-
+ The second element of each line is operation type. `EM` represents mouse, `EK` represents keyboard, `EX` represents extended operation
154
-
+ The third element of each line is detailed operation type, including
155
-
+`mouse left down`:press mouse left button `mouse left up` release mouse left button
156
-
+`mouse right down` press mouse right button`mouse right up` release mouse right button
+`mouse wheel up` mouse wheel slide up `mouse wheel down` mouse wheel slide down
159
-
+`key down` press key `key up` release key
160
-
+`mouse move` move mouse to `input` input text
161
-
+ The fourth element of each line is action type
162
-
+ If operation type is `EM`, it is consisted of coordinates of mouse.(Both relative coordinates and absolute coordinates are supported)
163
-
+ If operation type is `EK`, it is consisted of coordinates of (key number, key name, extension flag)
164
-
+ If detailed operation type is `Input`, it is the text to input
165
-
+ In each line, comment can be added after `//`
166
152
+ It is recommended to back up script before editing. And make sure to follow the format while editing, otherwise it may result in failure of execution.
167
-
+ The mouse event will execute on the position that the cursor is currently in when the coordinate is set to [-1, -1]
168
153
169
-
## Extensions
154
+
## Advanced Operations
170
155
171
-
The usage of exetensions is illustrated in [wiki](https://github.com/taojy123/KeymouseGo/wiki/Document#extension)
0 commit comments