ydotool.1 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. .\" Generated by scdoc 1.11.1
  2. .\" Complete documentation for this program is not available as a GNU info page
  3. .ie \n(.g .ds Aq \(aq
  4. .el .ds Aq '
  5. .nh
  6. .ad l
  7. .\" Begin generated content:
  8. .TH "YDOTOOL" "1" "2022-02-01"
  9. .P
  10. .SH NAME
  11. .P
  12. ydotool - command-line \fI/dev/uinput\fR automation tool
  13. .P
  14. .SH SYNOPSIS
  15. .P
  16. \fBydotool\fR \fBcmd\fR \fIargs.\&.\&.\&\fR
  17. .P
  18. \fBydotool\fR \fBcmd\fR --help
  19. .P
  20. .SH DESCRIPTION
  21. .P
  22. \fBydotool\fR lets you programmatically (or manually) simulate keyboard input and mouse activity, etc.\& It does this by writing directly to \fI/dev/uinput\fR so it generally needs to run as root.\&
  23. .P
  24. Currently implemented command(s):
  25. .P
  26. \fBtype\fR
  27. .RS 4
  28. Type a string
  29. .RE
  30. \fBkey\fR
  31. .RS 4
  32. Press keys
  33. .RE
  34. \fBmousemove\fR
  35. .RS 4
  36. Move mouse pointer to absolute position
  37. .RE
  38. \fBmousemove_relative\fR
  39. .RS 4
  40. Move mouse pointer to relative position
  41. .RE
  42. \fBclick\fR
  43. .RS 4
  44. Click on mouse buttons
  45. .RE
  46. \fBrecorder\fR
  47. .RS 4
  48. Record/replay input events
  49. .RE
  50. \fBmouseup\fR
  51. .RS 4
  52. Send a mouse up event.\&
  53. .RE
  54. \fBmousedown\fR
  55. .RS 4
  56. Send a mouse down event.\&
  57. .P
  58. .RE
  59. .SH KEYBOARD COMMANDS
  60. \fBkey\fR [\fB--up\fR] [\fB--down\fR] [\fB--delay\fR \fI<ms>\fR] [\fB--key-delay\fR \fI<ms>\fR] [\fB--repeat\fR \fI<times>\fR] [\fB--repeat-delay <ms>\fR] [\fB--persist-delay <ms>\fR] \fI<key sequence>\fR
  61. .P
  62. .RS 4
  63. Type a given keystroke.\& Examples being "alt+r", "ctrl+J",
  64. "ctrl+alt+n", "backspace".\&
  65. .P
  66. Options:
  67. .P
  68. \fB--up\fR
  69. .RS 4
  70. Only keyup
  71. .P
  72. .RE
  73. \fB--down\fR
  74. .RS 4
  75. Only keydown
  76. .P
  77. .RE
  78. \fB--delay\fR \fI<ms>\fR
  79. .RS 4
  80. Delay before starting to output keystrokes.\& Default 100ms.\&
  81. .P
  82. .RE
  83. \fB--key-delay\fR \fI<ms>\fR
  84. .RS 4
  85. Delay time between keystrokes.\& Default 12ms.\&
  86. .P
  87. .RE
  88. \fB--repeat\fR \fI<times>\fR
  89. .RS 4
  90. Times to repeat the key sequence.\&
  91. .P
  92. .RE
  93. \fB--repeat-delay\fR \fI<ms>\fR
  94. .RS 4
  95. Delay time between repetitions.\& Default 0ms.\&
  96. .P
  97. .RE
  98. \fB--persist-delay\fR \fI<ms>\fR
  99. .RS 4
  100. Keep virtual device alive for \fI<ms>\fR ms.\& Should be used in conjunction with \fB--down\fR or \fB--up\fR
  101. .P
  102. .RE
  103. Generally, any valid name from \fI/usr/include/linux/input-event-codes.\&h\fR will work.\& Multiple keys are separated by '+'.\&
  104. .P
  105. Each key sequence can be any number of modifiers and keys, separated by plus (+)
  106. For example: alt+r Alt+F4 CTRL+alt+f3 aLT+1+2+3 ctrl+Backspace
  107. .P
  108. Since we are emulating keyboard input, combinations like Shift+# is invalid because typing a `#' involves pressing Shift and 3.\&
  109. .P
  110. Example: Switch to tty1:
  111. .RS 4
  112. ydotool key ctrl+alt+f1
  113. .P
  114. .RE
  115. Example: Close a window in graphical environment:
  116. .RS 4
  117. ydotool key Alt+F4
  118. .P
  119. .RE
  120. .RE
  121. \fBtype\fR [\fB--delay\fR \fI<ms>\fR] [\fB--key-delay\fR \fI<ms>\fR] [\fB--args\fR \fI<N>\fR] [\fB--file\fR \fI<filepath>\fR] "\fIsomething to type\fR"
  122. .P
  123. .RS 4
  124. Types text as if you had typed it on the keyboard.\&
  125. .P
  126. Options:
  127. .P
  128. \fB--delay\fR \fI<ms>\fR
  129. .RS 4
  130. Delay before starting typing.\& Default 100ms.\&
  131. .P
  132. .RE
  133. \fB--key-delay\fR \fI<ms>\fR
  134. .RS 4
  135. Delay time between keystrokes.\& Default 12ms.\&
  136. .P
  137. .RE
  138. \fB--args\fR \fI<N>\fR
  139. .RS 4
  140. ?\&?\&?\&?\&
  141. .P
  142. .RE
  143. \fB--file\fR \fI<filepath>\fR
  144. .RS 4
  145. Specify a file, the contents of which will be typed as if passed as an argument.\& The filepath may also be '-' to read from stdin.\&
  146. .P
  147. .RE
  148. Example: to type 'Hello world!\&' you would do:
  149. .RS 4
  150. ydotool type 'Hello world!\&'
  151. .P
  152. .RE
  153. .RE
  154. .SH MOUSE COMMANDS
  155. .P
  156. \fBmousemove\fR [\fB--delay\fR \fI<ms>\fR] \fI<x> <y>\fR
  157. .RS 4
  158. Move the mouse to the specific X and Y coordinates on the screen.\&
  159. .P
  160. Options:
  161. \fB--delay\fR \fI<ms>\fR
  162. .RS 4
  163. Delay before starting move.\& Default 100ms.\&
  164. .P
  165. .RE
  166. Example: to move the cursor to absolute coordinates (100,100):
  167. .RS 4
  168. ydotool mousemove 100 100
  169. .P
  170. .RE
  171. .RE
  172. \fBmousemove_relative\fR [\fB--delay\fR \fI<ms>\fR] \fI<x>\fR \fI<y>\fR
  173. .RS 4
  174. Move the mouse x,y pixels relative to the current position of the mouse cursor.\&
  175. .P
  176. Options:
  177. \fB--delay\fR \fI<ms>\fR
  178. .RS 4
  179. Delay before starting move.\& Default 100ms.\&
  180. .P
  181. .RE
  182. Example: Relatively move mouse pointer to -100,100:
  183. .RS 4
  184. ydotool mousemove_relative -- -100 100
  185. .P
  186. .RE
  187. .RE
  188. \fBclick\fR [\fB--delay\fR \fI<ms>\fR] \fIbutton\fR
  189. .RS 4
  190. Send a click.\& Buttons are: 1=left 2=right 3=middle
  191. .P
  192. Options:
  193. .P
  194. \fB--delay\fR \fI<ms>\fR
  195. .RS 4
  196. Delay before click.\& Default 100ms.\&
  197. .P
  198. .RE
  199. Example: Mouse right click:
  200. .RS 4
  201. ydotool click 2
  202. .P
  203. .RE
  204. .RE
  205. \fBrecorder\fR [\fB--delay\fR \fI<ms>\fR] [\fB--record\fR \fI<devices>\fR] [\fB--replay\fR \fI<input files>\fR] [\fB--display\fR] [\fB--duration\fR \fI<ms>\fR]
  206. .P
  207. .RS 4
  208. Options:
  209. .P
  210. \fB--delay\fR \fI<ms>\fR
  211. .RS 4
  212. Delay time before start recording/replaying.\& Default 5000ms.\&
  213. .P
  214. .RE
  215. \fB--record\fR \fI<devices>\fR
  216. .RS 4
  217. Devices to record from.\& Default is all, including non-keyboard devices.\&
  218. .P
  219. .RE
  220. \fB--replay\fR \fI<input files>\fR
  221. .RS 4
  222. The record file can't be replayed on an architecture with different endianness.\&
  223. .P
  224. .RE
  225. \fB--display\fR
  226. .RS 4
  227. ?\&?\&?\&?\&
  228. .P
  229. .RE
  230. \fB--duration\fR \fI<ms>\fR
  231. .RS 4
  232. Record duration.\& Otherwise use SIGINT to stop recording.\&
  233. .P
  234. .RE
  235. .RE
  236. \fBmouseup\fR [\fB--delay\fR \fI<ms>\fR] \fIbutton\fR
  237. .RS 4
  238. Send a mouse up event.\& Buttons are: 1=left 2=right 3=middle
  239. .P
  240. Options:
  241. .P
  242. \fB--delay\fR \fI<ms>\fR
  243. .RS 4
  244. Delay before click.\& Default 100ms.\&
  245. .P
  246. .RE
  247. Example: Mouse right click:
  248. .RS 4
  249. ydotool click 2
  250. .P
  251. .RE
  252. .RE
  253. \fBmousedown\fR [\fB--delay\fR \fI<ms>\fR] \fIbutton\fR
  254. .RS 4
  255. Send a mouse down event.\& Buttons are: 1=left 2=right 3=middle
  256. .P
  257. Options:
  258. .P
  259. \fB--delay\fR \fI<ms>\fR
  260. .RS 4
  261. Delay before click.\& Default 100ms.\&
  262. .P
  263. .RE
  264. Example: Mouse right click:
  265. .RS 4
  266. ydotool click 2
  267. .P
  268. .RE
  269. .RE
  270. .SH AUTHOR
  271. .P
  272. ydotool was written by ReimuNotMoe.\&
  273. .P
  274. This man page by bob.\&hepple@gmail.\&com
  275. .P
  276. .SH BUGS
  277. .P
  278. When \fBydotool\fR(1) runs and creates a virtual input device, it will take some time for your graphical environment (eg X11/Wayland) to recognize and enable the virtual input device.\& (Usually done by udev)
  279. .P
  280. If the delay is too short, the virtual input device may not be recognized & enabled by the graphical environment in time.\&
  281. .P
  282. In order to solve this problem, there is a persistent background service, \fBydotoold\fR(1), to hold a persistent virtual device, and accept input from \fBydotool\fR(1).\& When \fBydotoold\fR(1) is unavailable, \fBydotool\fR(1) will work without it.\&
  283. .P
  284. .SH COPYRIGHT
  285. MIT License
  286. .P
  287. .SH SEE ALSO
  288. .P
  289. \fBydotoold\fR(8)
  290. .P
  291. Project site: <https://github.\&com/ReimuNotMoe/ydotool>