summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérémie Courrèges-Anglas <jca@wxcvbn.org>2014-02-20 02:12:23 +0100
committerJérémie Courrèges-Anglas <jca@wxcvbn.org>2014-02-20 02:12:23 +0100
commit7e51d7eb7799cb3d5c4c2458725d84a7318ba293 (patch)
tree2a717f445a80c9e5072c85a3346c551d0ada7808
parentb6543c169cc3dd1b0f7263bd3d70f70c7d67d1bb (diff)
downloadratpoison-7e51d7eb7799cb3d5c4c2458725d84a7318ba293.zip
Stop using XKeycodeToKeysym (deprecated).
* Use XkbKeycodeToKeysym instead. Not sure if this is a good change, but publish it at least so that people can test and report.
-rw-r--r--src/input.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/input.c b/src/input.c
index 22398e8..1f840ac 100644
--- a/src/input.c
+++ b/src/input.c
@@ -26,6 +26,7 @@
#include <X11/Xlib.h>
#include <X11/keysym.h>
#include <X11/Xutil.h>
+#include <X11/XKBlib.h>
#include "ratpoison.h"
@@ -251,8 +252,8 @@ keysym_to_keycode_mod (KeySym keysym, KeyCode *code, unsigned int *mod)
*mod = 0;
*code = XKeysymToKeycode (dpy, keysym);
- lower = XKeycodeToKeysym (dpy, *code, 0);
- upper = XKeycodeToKeysym (dpy, *code, 1);
+ lower = XkbKeycodeToKeysym (dpy, *code, 0, 0);
+ upper = XkbKeycodeToKeysym (dpy, *code, 0, 1);
/* If you need to press shift to get the keysym, add the shift
mask. */
if (upper == keysym && lower != keysym)
@@ -362,8 +363,8 @@ cook_keycode (XKeyEvent *ev, KeySym *keysym, unsigned int *mod, char *keysym_nam
/* Find out if XLookupString gobbled the shift modifier */
if (ev->state & ShiftMask)
{
- lower = XKeycodeToKeysym (dpy, ev->keycode, 0);
- upper = XKeycodeToKeysym (dpy, ev->keycode, 1);
+ lower = XkbKeycodeToKeysym (dpy, ev->keycode, 0, 0);
+ upper = XkbKeycodeToKeysym (dpy, ev->keycode, 0, 1);
/* If the keysym isn't affected by the shift key, then keep the
shift modifier. */
if (lower == upper)