diff options
author | Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> | 2004-03-17 20:33:17 +0000 |
---|---|---|
committer | Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> | 2004-03-17 20:33:17 +0000 |
commit | c014496ab841a19c3954be2d7eb573aa09363b69 (patch) | |
tree | 2bc7b5fce62e2747e18f6ef6af1d57798b48c42a /exec.c | |
parent | 7586b1379149e9596c78b0595362c7e6499e9de8 (diff) |
merge with XORG-RELEASE-1 (tag XORG-CYGWIN-LAST-MERGE)CYGWIN-RELEASE-1-MERGE
Diffstat (limited to 'exec.c')
-rw-r--r-- | exec.c | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -1,3 +1,4 @@ +/* $XdotOrg: xc/programs/xmodmap/exec.c,v 1.1.4.2.4.1 2004/03/04 17:49:16 eich Exp $ */ /* $Xorg: exec.c,v 1.4 2001/02/09 02:05:56 xorgcvs Exp $ */ /* @@ -212,8 +213,13 @@ void PrintModifierMapping(XModifierKeymap *map, FILE *fp) { int i, k = 0; + int min_keycode, max_keycode, keysyms_per_keycode = 0; - fprintf (fp, + XDisplayKeycodes (dpy, &min_keycode, &max_keycode); + XGetKeyboardMapping (dpy, min_keycode, (max_keycode - min_keycode + 1), + &keysyms_per_keycode); + + fprintf (fp, "%s: up to %d keys per modifier, (keycodes in parentheses):\n\n", ProgramName, map->max_keypermod); for (i = 0; i < 8; i++) { @@ -222,8 +228,14 @@ PrintModifierMapping(XModifierKeymap *map, FILE *fp) fprintf(fp, "%-10s", modifier_table[i].name); for (j = 0; j < map->max_keypermod; j++) { if (map->modifiermap[k]) { - KeySym ks = XKeycodeToKeysym(dpy, map->modifiermap[k], 0); - char *nm = XKeysymToString(ks); + KeySym ks; + int index = 0; + char *nm; + do { + ks = XKeycodeToKeysym(dpy, map->modifiermap[k], index); + index++; + } while ( !ks && index < keysyms_per_keycode); + nm = XKeysymToString(ks); fprintf (fp, "%s %s (0x%0x)", (j > 0 ? "," : ""), (nm ? nm : "BadKey"), map->modifiermap[k]); |