1YDOTOOL(1)                  General Commands Manual                 YDOTOOL(1)
2
3
4

NAME

6       ydotool - command-line /dev/uinput automation tool
7

SYNOPSIS

9       ydotool cmd args
10
11       ydotool cmd --help
12

DESCRIPTION

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       Currently implemented command(s):
19
20       type
21           Type a string
22       key
23           Press keys
24       mousemove
25           Move mouse pointer to absolute position
26       click
27           Click on mouse buttons
28

KEYBOARD COMMANDS

30       key [-d,--key-delay <ms>] [<KEYCODE:PRESSED> ...]
31
32           Type a given keycode.
33
34           e.g. 28:1 28:0 means pressing on the Enter button on a standard US
35           keyboard.
36
37           42:1 38:1 38:0 24:1 24:0 38:1 38:0 42:0 - "LOL"
38
39           Non-interpretable values, such as 0, aaa, l0l, will only cause a
40           delay.
41
42           See `/usr/include/linux/input-event-codes.h' for available key
43           codes (KEY_*).
44
45           Options: -d,--key-delay <ms>
46               Delay time between keystrokes. Default 12ms.
47
48       type [-D,--next-delay <ms>] [-d,--key-delay <ms>] [-f,--file
49       <filepath>] "text"
50
51           Types text as if you had typed it on the keyboard.
52
53           Options:
54
55           -d,--key-delay <ms>
56               Delay time between key events (up/down each). Default 12ms.
57
58           -D,--next-delay <ms>
59               Delay between strings. Default 0ms.
60
61           -f,--file <filepath>
62               Specify a file, the contents of which will be typed as if
63               passed as an argument. The filepath may also be '-' to read
64               from stdin.
65
66           Example: to type 'Hello world!' you would do:
67               ydotool type 'Hello world!'
68

MOUSE COMMANDS

70       mousemove [-a,--absolute] <x> <y>
71           Move the mouse to the relative X and Y coordinates on the screen.
72
73           Options: --absolute
74               Use absolute position
75
76           Example: to move the cursor to absolute coordinates (100,100):
77               ydotool mousemove --absolute 100 100
78
79       click [-d,--next-delay <ms>] [-r,--repeat N ] [button ...]
80           Send a click.
81
82           Options: -d,--next-delay <ms>
83               Delay between input events (up/down, a compete click means dou‐
84               bled time). Default 25ms.
85
86           -r,--repeat N
87               Repeat entire sequence N times
88
89           all mouse buttons are represented using hexadecimal numeric values,
90           with an optional bit mask to specify if mouse up/down needs to be
91           omitted.
92
93           •   0x00 - LEFT
94           •   0x01 - RIGHT
95           •   0x02 - MIDDLE
96           •   0x03 - SIDE
97           •   0x04 - EXTR
98           •   0x05 - FORWARD
99           •   0x06 - BACK
100           •   0x07 - TASK
101           •   0x40 - Mouse down
102           •   0x80 - Mouse up
103
104
105       Examples:
106
107           •   0x00: chooses left button, but does nothing (you can use this
108               to implement extra sleeps)
109           •   0xC0: left button click (down then up)
110           •   0x41: right button down
111           •   0x82: middle button up
112
113
114           The '0x' prefix can be omitted if you want.
115

AUTHOR

117       ydotool was written by ReimuNotMoe.
118
119       This man page by bob.hepple@gmail.com
120

BUGS

122       When ydotool(1) runs and creates a virtual input device, it will take
123       some time for your graphical environment (eg X11/Wayland) to recognize
124       and enable the virtual input device. (Usually done by udev)
125
126       If the delay is too short, the virtual input device may not be recog‐
127       nized & enabled by the graphical environment in time.
128
129       In order to solve this problem, there is a persistent background ser‐
130       vice, ydotoold(1), to hold a persistent virtual device, and accept in‐
131       put from ydotool(1). When ydotoold(1) is unavailable, ydotool(1) will
132       work without it.
133

LICENCE

135       AGPLv3
136

SEE ALSO

138       ydotoold(8)
139
140       Project site: <https://github.com/ReimuNotMoe/ydotool>
141
142
143
144                                  2022-03-21                        YDOTOOL(1)
Impressum