Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

synthetic keys stopped working (Debian jessie/sid and others) #52

Closed
vrs opened this issue Nov 20, 2014 · 5 comments · Fixed by #104
Closed

synthetic keys stopped working (Debian jessie/sid and others) #52

vrs opened this issue Nov 20, 2014 · 5 comments · Fixed by #104

Comments

@vrs
Copy link

vrs commented Nov 20, 2014

I pulled an older version and it worked as intended.
What happens with older versions:

$ xdotool getwindowfocus key --clearmodifiers ctrl+v ctrl+v Return
^V

xev reports:

$ xdotool key --window 0x2e00001 --clearmodifiers ctrl+v
KeyPress event, serial 198, synthetic YES, window 0x2e00001,
    root 0x0, 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 198, synthetic YES, window 0x2e00001,
    root 0x0, subw 0x0, time 0, (1,1), root:(1,1),
    state 0x4, keycode 55 (keysym 0x76, v), same_screen YES,
    XLookupString gives 1 bytes: (16) ""
    XmbLookupString gives 1 bytes: (16) ""
    XFilterEvent returns: False

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

KeyRelease event, serial 198, synthetic YES, window 0x2e00001,
    root 0x6b66b540, subw 0x0, time 0, (1,1), root:(1,1),
    state 0x0, keycode 55 (keysym 0x76, v), same_screen YES,
    XLookupString gives 1 bytes: (76) "v"
    XFilterEvent returns: False

Newer versions:

$ /usr/bin/xdotool getwindowfocus key --clearmodifiers ctrl+v ctrl+v Return
vv

xev reports:

$ /usr/bin/xdotool key --window 0x2e00001 --clearmodifiers ctrl+v
KeyPress event, serial 198, synthetic YES, window 0x2e00001,
    root 0xae8de07, 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 198, synthetic YES, window 0x2e00001,
    root 0xae8de07, subw 0x0, time 0, (1,1), root:(1,1),
    state 0x0, keycode 55 (keysym 0x76, v), same_screen YES,
    XLookupString gives 1 bytes: (76) "v"
    XmbLookupString gives 1 bytes: (76) "v"
    XFilterEvent returns: False

KeyRelease event, serial 198, synthetic YES, window 0x2e00001,
    root 0xa6dccf4, 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 198, synthetic YES, window 0x2e00001,
    root 0xa6dccf4, subw 0x0, time 0, (1,1), root:(1,1),
    state 0x0, keycode 55 (keysym 0x76, v), same_screen YES,
    XLookupString gives 1 bytes: (76) "v"
    XFilterEvent returns: False

The last version that exhibits the correct behaviour seems to be edbbb7a.

@xmw
Copy link

xmw commented Nov 20, 2014

I can confirm this report with Gentoo and vanilla sources. Hopefully this gets fixed before the Debian jessy release

@vrs vrs changed the title synthetic keys stopped working synthetic keys stopped working (Debian jessie/sid and others) Nov 20, 2014
@xmw
Copy link

xmw commented Nov 21, 2014

@daver1691
Copy link

Any progress on this? Is this a problem with xdotool source or something specific to Debian's implementation? I've just installed Debian 8.2 (released Sep 2015) and discovered this problem. The last comment on that Debian bug report was in Nov 2014.

@vrs
Copy link
Author

vrs commented Oct 24, 2015

I had this problem with HEAD as well, so it's not debian only.

@jwilk
Copy link
Contributor

jwilk commented Jan 31, 2016

The first bad commit is bbf0e70.
@kealthou, could you have a look at this bug?

jwilk added a commit to jwilk-archive/y-u-no-validate that referenced this issue Jan 31, 2016
Instead of sending keys directly to a specific window, activate the
window, then send the keys to the active window.

This is work-around for an xdotool bug[0], which broke sending synthetic
keys, such as Ctrl+F, to a specific window.

The downside of this approach is that the user could break the test if
they switched to another window while the test is running. This is not a
big deal, because one should run automated tests in an isolated
environment (for example, under Xvfb) anyway.

This commit should be reverted once the xdotool bug is fixed.

[0] jordansissel/xdotool#52
kealthou added a commit to kealthou/xdotool that referenced this issue Feb 14, 2016
kealthou added a commit to kealthou/xdotool that referenced this issue Mar 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants