diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2010-10-27 11:16:56 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-05-20 14:28:58 +1000 |
commit | ecb2f343183be6db666373f3f57937edf307469f (patch) | |
tree | 66c1ae671f85ecb51874681501ece904b2fbb1b5 | |
parent | 0cb538838c68c8b7e7e24bf784a49ff8fa09d3bc (diff) | |
download | xf86-input-wacom-ecb2f343183be6db666373f3f57937edf307469f.tar.gz |
xsetwacom: for button mappings with keycodes, print the keysyms
This isn't really accurate as it relies on the current keymap, but then
again, that's what you get for having keysym handling in the driver...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit da364f528bf42a80a9bb45e27beaf1632265c21c)
-rw-r--r-- | tools/xsetwacom.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c index bfa2bb6..3f0466d 100644 --- a/tools/xsetwacom.c +++ b/tools/xsetwacom.c @@ -2034,6 +2034,7 @@ static int get_special_button_map(Display *dpy, XDevice *dev, int detail; int is_press = -1; char str[10] = {0}; + char press_str = ' '; current_type = action & AC_TYPE; detail = action & AC_CODE; @@ -2045,6 +2046,7 @@ static int get_special_button_map(Display *dpy, XDevice *dev, if (last_type != current_type) strcat(buff, "key "); is_press = !!(action & AC_KEYBTNPRESS); + detail = XKeycodeToKeysym(dpy, detail, 0); break; case AC_BUTTON: if (last_type != current_type) @@ -2062,8 +2064,12 @@ static int get_special_button_map(Display *dpy, XDevice *dev, continue; } - sprintf(str, "%s%d ", - (is_press == -1) ? "" : ((is_press) ? "+" : "-"), detail); + press_str = (is_press == -1) ? ' ' : ((is_press) ? '+' : '-'); + if (current_type == AC_KEY) + sprintf(str, "%c%s ", press_str, + XKeysymToString(detail)); + else + sprintf(str, "%c%d ", press_str, detail); strcat(buff, str); last_type = current_type; last_press = is_press; |