Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to simulate pressing an arrow key in linux bash

Tags:

linux

bash

shell

I've worked with powershell before but I'm new to linux bash scripts. Say I wanted to write a script that just presses a key (left arrow) in regular intervals (0.05s). How could I go about doing this?

like image 921
mysticalstick Avatar asked Dec 01 '16 20:12

mysticalstick


1 Answers

Use Xdotool. Its usage is:

xdotool key SPECIFY_KEY

and replace SPECIFY_KEY with the required keystroke,
or in your case:

xdotool key Up/Down/etc.
like image 106
T. Kropalis Avatar answered Oct 11 '22 14:10

T. Kropalis