diff options
author | Bastien Nocera <hadess@hadess.net> | 2013-01-26 00:13:11 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2013-01-26 00:13:11 +0100 |
commit | cbf2d17cdc535fe6c2cdb4e64fadbfae756e4b67 (patch) | |
tree | 1fea4e47ded9277b18c4e991b77097f4734c1e1e /tests | |
parent | 7760c8ed6b70fdeeae7f1b72abfd94bd065541d3 (diff) | |
download | gnome-settings-daemon-cbf2d17cdc535fe6c2cdb4e64fadbfae756e4b67.tar.gz |
tests: Correct use of XTestFakeKeyEvent()
It expects a keycode, not a keysym.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/shiftkey.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/shiftkey.c b/tests/shiftkey.c index f02fc93b..a0e76aae 100644 --- a/tests/shiftkey.c +++ b/tests/shiftkey.c @@ -34,6 +34,7 @@ main() { Display *display = NULL; int event_base, error_base, major_version, minor_version; + KeyCode keycode; display = XOpenDisplay (NULL); @@ -48,8 +49,9 @@ main() } /* send a left shift key; first press, then release */ - XTestFakeKeyEvent (display, XK_Shift_L, True, 0); - XTestFakeKeyEvent (display, XK_Shift_L, False, 0); + keycode = XKeysymToKeycode (display, XK_Shift_L); + XTestFakeKeyEvent (display, keycode, True, 0); + XTestFakeKeyEvent (display, keycode, False, 0); XCloseDisplay (display); return 0; |