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.hutte...@who-t.net>
---
 tools/xsetwacom.c | 8 ++++++++
 1 file changed, 8 insertions(+)

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)
-- 
1.8.1.4


------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to