ydotool icon indicating copy to clipboard operation
ydotool copied to clipboard

Separate mouse down and release

Open Microwave-WYB opened this issue 3 years ago • 3 comments

Is it possible to instead of simulating a "click", we can simulate pressing down and releasing separately? So we can do things like: ydotool mousedown 0XC0; ydotool mousemove -- 100 100; ydotool mouserelease 0XC0 to simulate a drag and drop.

Microwave-WYB avatar May 25 '22 10:05 Microwave-WYB

https://github.com/ReimuNotMoe/ydotool/blob/master/manpage/ydotool.1.scd

according to this manpage, you can send --up or --down!

still haven't tested it, but I will soon!

MotherOfClamperl avatar Aug 15 '22 13:08 MotherOfClamperl

As a happy ydotool user, I've succesfully mapped this to the keyboard through a gnome extension: https://extensions.gnome.org/extension/1336/run-or-raise/ . Now, I control the drag-and-drop via numpad keys.

<Super>KP_Add,bash -c "sleep 0.2 && ydotool click 0x40" # drag has to start with sleep since non-released keys would interfere otherwise causing no file being dragged while still entering the drag-mode (nothing works until Esc or mouse up, neither click works)
<Super>KP_Subtract,ydotool click 0x80 # drop cannot be a layered shortcut since basic keys seem disabled by system when dragging

e3rd avatar Sep 26 '23 14:09 e3rd