jordansissel / xdotool

fake keyboard/mouse input, window management, and more
Other
3.17k stars 316 forks source link

Cannot send modifier keys #174

Open rjekker opened 7 years ago

rjekker commented 7 years ago

I'm on Ubuntu 16.04 and I tried the default ubuntu version (an older version from 2015 I believe) installed by apt-get, and later I built the latest version from scratch (3.20160805.1). In both cases I have the same problem. I use i3wm by the way - don't know if that matters.

Whenever sending a ctrl or alt key combination like this xdotool key --window 0x3c00001 Ctrl+x

the receiving application seems to completely ignore the fact that a ctrl was pressed. The same is true for combinations with alt. Strangely key combinations with Super seem to work.

The following is the output from xev when I send Ctrl+x:

KeyPress event, serial 33, synthetic YES, window 0x3c00001,
    root 0xf72acffb, subw 0x0, time 0, (1,1), root:(1,1),
    state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 33, synthetic YES, window 0x3c00001,
    root 0xf72acffb, subw 0x0, time 0, (1,1), root:(1,1),
    state 0x0, keycode 53 (keysym 0x78, x), same_screen YES,
    XLookupString gives 1 bytes: (78) "x"
    XmbLookupString gives 1 bytes: (78) "x"
    XFilterEvent returns: False

KeyRelease event, serial 33, synthetic YES, window 0x3c00001,
    root 0xf72acffb, subw 0x0, time 0, (1,1), root:(1,1),
    state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 33, synthetic YES, window 0x3c00001,
    root 0xf72acffb, subw 0x0, time 0, (1,1), root:(1,1),
    state 0x0, keycode 53 (keysym 0x78, x), same_screen YES,
    XLookupString gives 1 bytes: (78) "x"
    XFilterEvent returns: False

Compare this with the output when I type it myself:

KeyPress event, serial 33, synthetic NO, window 0x3c00001,
    root 0xfa, subw 0x0, time 79049987, (1249,261), root:(5093,1367),
    state 0x10, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 33, synthetic NO, window 0x3c00001,
    root 0xfa, subw 0x0, time 79051195, (1249,261), root:(5093,1367),
    state 0x14, keycode 53 (keysym 0x78, x), same_screen YES,
    XLookupString gives 1 bytes: (18) ""
    XmbLookupString gives 1 bytes: (18) ""
    XFilterEvent returns: False

KeyRelease event, serial 33, synthetic NO, window 0x3c00001,
    root 0xfa, subw 0x0, time 79051371, (1249,261), root:(5093,1367),
    state 0x14, keycode 53 (keysym 0x78, x), same_screen YES,
    XLookupString gives 1 bytes: (18) ""
    XFilterEvent returns: False

KeyRelease event, serial 33, synthetic NO, window 0x3c00001,
    root 0xfa, subw 0x0, time 79051627, (1249,261), root:(5093,1367),
    state 0x14, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False
leftaroundabout commented 7 years ago

I have the same issue; a script that used to work with Ubuntu-14.04's version of xdotool now fails to accomplish the needed ctrlmodifiers. It appears as if xdotool just completely ignores these modifiers now.

Does anybody have an idea what changed between these versions?

leftaroundabout commented 7 years ago

...never mind: for me, installing the newest HEAD version of xdotool solved the problem.

JustCodin commented 6 years ago

I had this issue, too, and just installed newest HEAD version of xdotool (to /usr/local/bin/xdotool), but now when i run it from there, I see "Your windowmanager claims not to support _NET_ACTIVE_WINDOW, so the attempt to activate the window was aborted."

Any idea how to resolve this?