Simply parse through the existing modifier list.

Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
---
 tools/xsetwacom.c |   22 +++++-----------------
 1 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c
index 10bde88..436598e 100644
--- a/tools/xsetwacom.c
+++ b/tools/xsetwacom.c
@@ -952,23 +952,11 @@ static char *convert_specialkey(const char *modifier)
 
 static int is_modifier(const char* modifier)
 {
-       const char *modifiers[] = {
-               "Control_L",
-               "Control_R",
-               "Alt_L",
-               "Alt_R",
-               "Shift_L",
-               "Shift_R",
-               "Meta_L",
-               "Meta_R",
-               NULL,
-       };
-
-       const char **m = modifiers;
+       struct modifier *m = modifiers;
 
-       while(*m)
+       while(m->name)
        {
-               if (strcmp(modifier, *m) == 0)
+               if (strcmp(modifier, m->converted) == 0)
                        return 1;
                m++;
        }
-- 
1.7.3.5


------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to