1YDOTOOL(1) General Commands Manual YDOTOOL(1)
2
3
4
6 ydotool - command-line /dev/uinput automation tool
7
9 ydotool cmd args [ , cmd args ... ]
10
11 ydotool cmd --help
12
14 ydotool lets you programmatically (or manually) simulate keyboard input
15 and mouse activity, etc. It does this by writing directly to /dev/uin‐
16 put so it generally needs to run as root.
17
18 It's possible to chain multiple commands together, separated by a comma
19 between two spaces.
20
21 Currently implemented command(s):
22
23 type
24 Type a string
25 key
26 Press keys
27 mousemove
28 Move mouse pointer to absolute position
29 click
30 Click on mouse buttons
31 recorder
32 Record/replay input events
33 sleep
34 sleep for a while
35
37 key [--up] [--down] [--next-delay <ms>] [--key-delay <ms>] [--repeat
38 <times>] [--repeat-delay <ms>] <key sequence>
39
40 Type a given keystroke. Examples being "alt+r", "ctrl+J",
41 "ctrl+alt+n", "backspace".
42
43 Options:
44
45 --up
46 Only keyup
47
48 --down
49 Only keydown
50
51 --delay <ms>
52 Delay before starting to output keystrokes. Default 100ms.
53
54 --key-delay <ms>
55 Delay time between keystrokes. Default 12ms.
56
57 --repeat <times>
58 Times to repeat the key sequence.
59
60 --repeat-delay <ms>
61 Delay time between repetitions. Default 0ms.
62
63 Generally, any valid name from /usr/include/linux/input-event-
64 codes.h will work. Multiple keys are separated by '+'.
65
66 Each key sequence can be any number of modifiers and keys, sepa‐
67 rated by plus (+)
68
69 For example: alt+r Alt+F4 CTRL+alt+f3 aLT+1+2+3 ctrl+Backspace
70
71 Since we are emulating keyboard input, combinations like Shift+# is
72 invalid because typing a `#' involves pressing Shift and 3.
73
74 Example: Switch to tty1:
75 ydotool key ctrl+alt+f1
76
77 Example: Close a window in graphical environment:
78 ydotool key Alt+F4
79
80 type [--next-delay <ms>] [--key-delay <ms>] [--texts arg] [--file
81 <filepath>] "texts"
82
83 Types text as if you had typed it on the keyboard.
84
85 Options:
86
87 --next-delay <ms>
88 Delay before starting typing. Default 100ms.
89
90 --key-delay <ms>
91 Delay time between keystrokes. Default 12ms.
92
93 --texts arg
94 Texts to type
95
96 --file <filepath>
97 Specify a file, the contents of which will be typed as if
98 passed as an argument. The filepath may also be '-' to read
99 from stdin.
100
101 Example: to type 'Hello world!' you would do:
102 ydotool type 'Hello world!'
103
105 mousemove <x> <y>
106 Move the mouse to the specific relative X and Y coordinates on the
107 screen.
108
109 Options: --absolute
110 Use absolute position
111
112 Example: to move the cursor to absolute coordinates (100,100):
113 ydotool mousemove --absolute 100 100
114
115 click [--next-delay <ms>] button
116 Send a click. Buttons are: left, right or middle
117
118 Options:
119
120 --next-delay <ms>
121 Delay before click. Default 100ms.
122
123 --up
124 Only mouseup
125
126 --down
127 Only mousedown
128
129 --buttons <arg>
130 Buttons to press (left, right, middle)
131
132 Example: Mouse middle click:
133 ydotool click middle
134
135 recorder [--record <devices>] [--replay <input files>] [--display]
136 [--duration <ms>] [--devices <path>] [--file <path>]
137
138 Options:
139
140 --record <devices>
141 Devices to record from. Default is all, including non-keyboard
142 devices.
143
144 --replay <input files>
145 The record file can't be replayed on an architecture with dif‐
146 ferent endianness.
147
148 --display
149 Display
150
151 --duration <ms>
152 Record duration. Otherwise use SIGINT to stop recording.
153
154 --devices <path>
155 Devices, separated by comma, to record from. Default is all
156 devices (default: "")
157
158 --file <path>
159 File to record to / replay from
160
162 ydotool was written by ReimuNotMoe.
163
164 This man page by bob.hepple@gmail.com
165
167 When ydotool(1) runs and creates a virtual input device, it will take
168 some time for your graphical environment (eg X11/Wayland) to recognize
169 and enable the virtual input device. (Usually done by udev)
170
171 If the delay is too short, the virtual input device may not be recog‐
172 nized & enabled by the graphical environment in time.
173
174 In order to solve this problem, there is a persistent background ser‐
175 vice, ydotoold(1), to hold a persistent virtual device, and accept
176 input from ydotool(1). When ydotoold(1) is unavailable, ydotool(1) will
177 work without it.
178
180 AGPLv3
181
183 ydotoold(8)
184
185 Project site: <https://github.com/ReimuNotMoe/ydotool>
186
187
188
189 2021-03-02 YDOTOOL(1)