diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-12-06 13:24:29 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-12-06 13:24:29 +0000 |
commit | 158c5489e7371855683fd2f19f722316882627a7 (patch) | |
tree | fcd72c5f0b0efeed0c433612c6ab67177f8ec6a8 | |
parent | 7586b1379149e9596c78b0595362c7e6499e9de8 (diff) |
merge XFree86 4.3.99.901 (RC1) from vendor branchXORG-RELEASE-1-BASEXEVIE-MERGEXEVIE-BASEXINERAMA_2XEVIE
-rw-r--r-- | exec.c | 20 |
1 files changed, 16 insertions, 4 deletions
@@ -1,3 +1,4 @@ +/* $XdotOrg: exec.c,v 1.4 2001/02/09 02:05:56 xorgcvs Exp $ */ /* $Xorg: exec.c,v 1.4 2001/02/09 02:05:56 xorgcvs Exp $ */ /* @@ -56,7 +57,7 @@ from The Open Group. * Author: Jim Fulton, MIT X Consortium; derived from parts of the * original xmodmap, written by David Rosenthal, of Sun Microsystems. */ -/* $XFree86: xc/programs/xmodmap/exec.c,v 1.5 2001/12/14 20:02:13 dawes Exp $ */ +/* $XFree86: xc/programs/xmodmap/exec.c,v 1.6 2003/12/02 13:13:57 pascal Exp $ */ #include <X11/Xos.h> #include <X11/Xlib.h> @@ -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]); |