summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-04-29 14:47:06 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-05-02 09:53:04 +1000
commitd0dbb34e524ebb58bb9a5a623d2fa96a1470516f (patch)
tree81d454b7f40229a6917ac0f5ff5c33531f625633
parente50725269dd76c4a3c92c84dd4413034a8937df0 (diff)
xsetwacom: map a bunch of special symbols
Punctuation marks and others map to XK_* keysyms but only in their named form, not in their single-character symbol form. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Ping Cheng <pinglinux@gmail.com>
-rw-r--r--tools/xsetwacom.c61
1 files changed, 58 insertions, 3 deletions
diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c
index 69b5486..d8ece68 100644
--- a/tools/xsetwacom.c
+++ b/tools/xsetwacom.c
@@ -573,6 +573,40 @@ static struct modifier specialkeys[] = {
{"del", "Delete"}, {"home", "Home"},
{"end", "End"},
+ {"`", "quoteleft"},
+ {"-", "minus"},
+ {"=", "equal"},
+ {"[", "bracketleft"},
+ {"]", "bracketright"},
+ {"\\", "backslash"},
+ {";", "semicolon"},
+ {"'", "apostrophe"},
+ {",", "comma"},
+ {".", "period"},
+ {"/", "slash"},
+
+ {"~", "asciitilde"},
+ {"!", "exclam"},
+ {"@", "at"},
+ {"#", "numbersign"},
+ {"$", "dollar"},
+ {"%", "percent"},
+ {"^", "asciicircum"},
+ {"&", "ampersand"},
+ {"*", "asterisk"},
+ {"(", "parenleft"},
+ {")", "parenright"},
+ {"_", "underscore"},
+ {"+", "plus"},
+ {"{", "braceleft"},
+ {"}", "braceright"},
+ {"|", "bar"},
+ {":", "colon"},
+ {"\"", "quotedbl"},
+ {"<", "less"},
+ {">", "greater"},
+ {"?", "question"},
+
{ NULL, NULL }
};
@@ -2687,15 +2721,36 @@ static void test_convert_specialkey(void)
char buff[5];
struct modifier *m;
- /* make sure at least the default keys (ascii 33 - 126) aren't
- * specialkeys */
- for (i = '!'; i <= '~'; i++)
+ /* make sure a-zA-Z aren't specialkeys */
+ for (i = 'a'; i <= 'z'; i++)
+ {
+ sprintf(buff, "%c", i);
+ converted = convert_specialkey(buff);
+ assert(strcmp(converted, buff) == 0);
+ }
+
+ for (i = 'A'; i <= 'Z'; i++)
{
sprintf(buff, "%c", i);
converted = convert_specialkey(buff);
assert(strcmp(converted, buff) == 0);
}
+ /* punctuation are specialkeys */
+ for (i = '!'; i <= '/'; i++)
+ {
+ sprintf(buff, "%c", i);
+ converted = convert_specialkey(buff);
+ assert(strcmp(converted, buff) != 0);
+ }
+ for (i = ':'; i <= '?'; i++)
+ {
+ sprintf(buff, "%c", i);
+ converted = convert_specialkey(buff);
+ assert(strcmp(converted, buff) != 0);
+ }
+
+
for (m = specialkeys; m->name; m++)
{
converted = convert_specialkey(m->name);