1YDOTOOL(1) General Commands Manual YDOTOOL(1)
2
3
4
6 ydotool - command-line /dev/uinput automation tool
7
9 ydotool cmd args
10
11 ydotool cmd --help
12
14 ydotool lets you programmatically (or manually) simulate keyboard input
15 and mouse activity, etc. The ydotoold(8) daemon must be running.
16
17 Currently implemented command(s):
18
19 type
20 Type a string
21 key
22 Press keys
23 mousemove
24 Move mouse pointer to absolute position
25 click
26 Click on mouse buttons
27
29 key [-d,--key-delay <ms>] [<KEYCODE:PRESSED> ...]
30
31 Type a given keycode.
32
33 e.g. 28:1 28:0 means pressing on the Enter button on a standard US
34 keyboard.
35
36 42:1 38:1 38:0 24:1 24:0 38:1 38:0 42:0 - "LOL"
37
38 Non-interpretable values, such as 0, aaa, l0l, will only cause a
39 delay.
40
41 See `/usr/include/linux/input-event-codes.h' for available key
42 codes (KEY_*).
43
44 Options: -d,--key-delay <ms>
45 Delay time between keystrokes. Default 12ms.
46
47 type [-D,--next-delay <ms>] [-d,--key-delay <ms>] [-f,--file
48 <filepath>] "text"
49
50 Types text as if you had typed it on the keyboard.
51
52 Options:
53
54 -d,--key-delay <ms>
55 Delay time between key events (up/down each). Default 12ms.
56
57 -D,--next-delay <ms>
58 Delay between strings. Default 0ms.
59
60 -f,--file <filepath>
61 Specify a file, the contents of which will be typed as if
62 passed as an argument. The filepath may also be '-' to read
63 from stdin.
64
65 Example: to type 'Hello world!' you would do:
66 ydotool type 'Hello world!'
67
69 mousemove [-a,--absolute] <x> <y>
70 Move the mouse to the relative X and Y coordinates on the screen.
71
72 Options: --absolute
73 Use absolute position
74
75 Example: to move the cursor to absolute coordinates (100,100):
76 ydotool mousemove --absolute 100 100
77
78 click [-d,--next-delay <ms>] [-r,--repeat N ] [button ...]
79 Send a click.
80
81 Options: -d,--next-delay <ms>
82 Delay between input events (up/down, a compete click means dou‐
83 bled time). Default 25ms.
84
85 -r,--repeat N
86 Repeat entire sequence N times
87
88 all mouse buttons are represented using hexadecimal numeric values,
89 with an optional bit mask to specify if mouse up/down needs to be
90 omitted.
91
92 • 0x00 - LEFT
93 • 0x01 - RIGHT
94 • 0x02 - MIDDLE
95 • 0x03 - SIDE
96 • 0x04 - EXTR
97 • 0x05 - FORWARD
98 • 0x06 - BACK
99 • 0x07 - TASK
100 • 0x40 - Mouse down
101 • 0x80 - Mouse up
102
103
104 Examples:
105
106 • 0x00: chooses left button, but does nothing (you can use this
107 to implement extra sleeps)
108 • 0xC0: left button click (down then up)
109 • 0x41: right button down
110 • 0x82: middle button up
111
112
113 The '0x' prefix can be omitted if you want.
114
116 The socket to write to for ydotoold(8) can be changed by the environ‐
117 ment variable YDOTOOL_SOCKET.
118
120 ydotool was written by ReimuNotMoe.
121
122 This manpage was written by bob.hepple@gmail.com but updated since.
123
125 AGPLv3
126
128 ydotoold(8)
129
130 Project site: <https://github.com/ReimuNotMoe/ydotool>
131
132
133
134 2023-01-12 YDOTOOL(1)