diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2013-04-29 14:46:18 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2013-05-02 09:53:04 +1000 |
commit | e50725269dd76c4a3c92c84dd4413034a8937df0 (patch) | |
tree | 2540e5053aac3fc357dc6b4c307757e163ab7172 | |
parent | 915a64589f34a0593fe55afa82de30c4415c3020 (diff) |
xsetwacom: if we fail to map a string, try as special key or warn
If a string comes back with a KeySym of 0, try again as a special key. And
if that fails too, print a warning.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Ping Cheng <pinglinux@gmail.com>
-rw-r--r-- | tools/xsetwacom.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c index d475947..69b5486 100644 --- a/tools/xsetwacom.c +++ b/tools/xsetwacom.c @@ -1078,7 +1078,15 @@ static int special_map_keystrokes(Display *dpy, int argc, char **argv, unsigned } else need_press = need_release = 1; + ks = XStringToKeysym(key); + if (ks == 0) { + key = convert_specialkey(key); + ks = XStringToKeysym(key); + if (ks == 0) + fprintf(stderr, "Warning: unable to map '%s' to a keycode.\n", key); + } + kc = keysym_to_keycode(dpy, ks); if (need_press) |