Is there a setting to enable wine to accept keypresses from xdotool when it is not active? Or am I on the wrong track? Has anyone managed to do this successfully with wine? It seems possible in the past, but now most programs don't seem to accept key presses when not focused.But sending keystrokes to a specific window uses a different API than simply typing to the active window, and many applications just ignore them.
My workaround which I haven't done yet is to flick focus to it, press the key and flick back. But that will make my screen flicker if I'm in a full screen app, or over mediamonkey, so not ideal.
This is my code at the moment for what it's worth, with a special key on my silly keyboard assigned to each option:
Code: Select all
#!/bin/sh
case $1 in
"play")
key="Control_L+P"
;;
"next")
key='Control_L+N'
;;
"prev")
key='Control_L+B'
;;
"rand")
key='Control_L+Shift_L+L'
;;
*)
echo "Usage: $0 play|next|prev|rand"
exit 1
;;
esac
xdotool key --window $(xdotool search --name "MediaMonkey"|head -n1) $key
exit 0