From c014496ab841a19c3954be2d7eb573aa09363b69 Mon Sep 17 00:00:00 2001 From: Alexander Gottwald Date: Wed, 17 Mar 2004 20:33:17 +0000 Subject: merge with XORG-RELEASE-1 (tag XORG-CYGWIN-LAST-MERGE) --- exec.c | 18 +++++++++++++++--- handle.c | 2 +- wq.h | 2 +- xmodmap.c | 2 +- xmodmap.h | 2 +- xmodmap.man | 2 +- 6 files changed, 20 insertions(+), 8 deletions(-) diff --git a/exec.c b/exec.c index d23bf49..ab2e067 100644 --- a/exec.c +++ b/exec.c @@ -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]); diff --git a/handle.c b/handle.c index 9d91d55..09f40cb 100644 --- a/handle.c +++ b/handle.c @@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/xmodmap/handle.c,v 3.7 2001/12/14 20:02:13 dawes Exp $ */ +/* $XFree86: xc/programs/xmodmap/handle.c,v 3.6 2001/07/25 15:05:27 dawes Exp $ */ #include #include diff --git a/wq.h b/wq.h index 5caa8a1..3aab10f 100644 --- a/wq.h +++ b/wq.h @@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/xmodmap/wq.h,v 1.5 2001/12/14 20:02:13 dawes Exp $ */ +/* $XFree86: xc/programs/xmodmap/wq.h,v 1.4 2001/01/17 23:46:21 dawes Exp $ */ #ifndef _WQ_H #define _WQ_H diff --git a/xmodmap.c b/xmodmap.c index 6cdb7f1..a67493f 100644 --- a/xmodmap.c +++ b/xmodmap.c @@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/xmodmap/xmodmap.c,v 1.9 2003/05/27 22:27:08 tsi Exp $ */ +/* $XFree86: xc/programs/xmodmap/xmodmap.c,v 1.8tsi Exp $ */ #include #include diff --git a/xmodmap.h b/xmodmap.h index 1a9a91c..0d2f779 100644 --- a/xmodmap.h +++ b/xmodmap.h @@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/xmodmap/xmodmap.h,v 1.5 2001/12/14 20:02:13 dawes Exp $ */ +/* $XFree86: xc/programs/xmodmap/xmodmap.h,v 1.4 2001/01/17 23:46:21 dawes Exp $ */ extern char *ProgramName; extern Display *dpy; diff --git a/xmodmap.man b/xmodmap.man index 2597184..34a19e3 100644 --- a/xmodmap.man +++ b/xmodmap.man @@ -24,7 +24,7 @@ .\" other dealings in this Software without prior written authorization .\" from The Open Group. .\" -.\" $XFree86: xc/programs/xmodmap/xmodmap.man,v 1.13 2003/06/26 10:19:49 eich Exp $ +.\" $XFree86: xc/programs/xmodmap/xmodmap.man,v 1.11 2002/10/12 16:06:48 herrb Exp $ .\" .de EX \"Begin example .ne 5 -- cgit v1.2.3