diff options
author | Dan Nicholson <dbn.lists@gmail.com> | 2009-01-16 07:28:30 -0800 |
---|---|---|
committer | Dan Nicholson <dbn.lists@gmail.com> | 2009-03-19 11:51:09 -0700 |
commit | d0a4291e74663508ab6549c59d2f6a57425580ff (patch) | |
tree | 36db74a16c7a2ad058221b38fc9b6492f15ff470 /src | |
parent | fa6a3d122d57b3ae89076741ec90ec8c1b78ce6b (diff) |
makekeys: Handle XF86XK_ keysyms in addition to XK_ keysyms
Diffstat (limited to 'src')
-rw-r--r-- | src/makekeys.c | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/src/makekeys.c b/src/makekeys.c index b563ff9..ed964e7 100644 --- a/src/makekeys.c +++ b/src/makekeys.c @@ -74,11 +74,42 @@ main(int argc, char *argv[]) while (fgets(buf, sizeof(buf), stdin)) { + int handled = 0; + + /* Manage keysyms from keysymdef.h */ i = sscanf(buf, "#define XK_%127s 0x%lx", key, &info[ksnum].val); - if (i != 2) { + if (i == 2) { + handled = 1; + } else { i = sscanf(buf, "#define XK_%127s XK_%127s", key, alias); - if (i != 2) - continue; + if (i == 2) { + for (i = ksnum - 1; i >= 0; i--) { + if (strcmp(info[i].name, alias) == 0) { + info[ksnum].val = info[i].val; + handled = 1; + break; + } + } + if (i < 0) { /* Didn't find a match */ + fprintf(stderr, + "can't find matching definition %s for keysym %s\n", + alias, key); + continue; + } + } + } + + /* Manage keysyms from XF86keysym.h */ + if (!handled) + i = sscanf(buf, "#define XF86XK_%127s 0x%lx", key, &info[ksnum].val); + if (!handled && i != 2) { + /* Try to handle both XF86XK and XK aliases */ + i = sscanf(buf, "#define XF86XK_%127s XF86XK_%127s", key, alias); + if (i != 2) { + i = sscanf(buf, "#define XF86XK_%127s XK_%127s", key, alias); + if (i != 2) + continue; + } for (i = ksnum - 1; i >= 0; i--) { if (strcmp(info[i].name, alias) == 0) { info[ksnum].val = info[i].val; @@ -92,6 +123,7 @@ main(int argc, char *argv[]) continue; } } + if (info[ksnum].val == XK_VoidSymbol) info[ksnum].val = 0; if (info[ksnum].val > 0x1fffffff) { |