Based on this :


set -x
exec &>/tmp/log

    xinput list |
        awk '/Dell USB Keyboard/{print gensub(/.*id=([0-9]+).*/, "\\1", "1")}'
xdotool mousedown $1
while IFS= read -r event; do
    if [[ $event == *release* ]]; then
        xdotool mouseup $1
done < <(xinput test $id)

This works very well under Debian9 and Cinnamon 3.2.7, but not under Archlinux X86_64 + xfce 4.12.

My tests

The log when I press F1 key to drag & drop the border of a GUI application :

press :

+xinput list
+awk '/Dell USB Keyboard/{print gensub(/.*id=([0-9]+).*/, "\\1", "1")}'
+xdotool mousedown 1   # executed, but no action !
+read -r event
+xinput test 10

release key :

+[[ key release 67  == *release* ]]
+xdotool mouseup 1

The code is ran from xfce4 keyboard shortcuts configuration panel.

What is wrong ?

If I remove code and keep only

xdotool mousedown 1

I can drag & drop ! (but can't release it)

Any idea what's going bad?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.