Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

key+mouse click simultaneous (xdotool)

Tags:

linux

xdotool

Is it possible to simulate a keystroke ("N") and a mouse click simultaneous in linux?

I use xdotool on fedora linux distro

I didn't find nothing related to this possibility

Later Edit :

I found the following workaround. I post it as someone might have a similar problem.

Even if the key is not pressed simultaneous with the click you can have it already pressed using :

<pseudocode>
keydown [options] keystroke  - it will keep the key pressed.
Mouse click here.
keyup keystroke              - it will release the key
like image 469
Laurentiu B Avatar asked Aug 30 '26 07:08

Laurentiu B


1 Answers

In new versions you can do

xdotool keydown N click 1 keyup N

In older versions you can do as you edited:

xdotool keydown N
xdotool click 1
xdotool keyup N
like image 107
kvantour Avatar answered Aug 31 '26 20:08

kvantour



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!