Subject: Re: More keyboard/X problems...
To: Gordon W. Ross <gwr@mc.com>
From: Krister Walfridsson <cato@df.lth.se>
List: port-sparc
Date: 11/02/1997 01:25:20
There are still some problems with my (type 4) keyboard:

1. The LEDs are acting strange when running X. This is due to the data
   sent to KIOCSLED ioctl being of type int *, but my X server seems to
   think it should be char *. This is solved by

bash$ diff -u kbd.c.bak kbd.c
--- kbd.c.bak   Wed Oct 29 13:40:42 1997
+++ kbd.c       Sat Nov  1 23:34:15 1997
@@ -382,7 +382,7 @@
 static int kbd_iockeymap __P((struct kbd_state *ks,
        u_long cmd, struct kiockeymap *kio));
 
-static int kbd_iocsled(struct kbd_softc *k, int *data);
+static int kbd_iocsled(struct kbd_softc *k, char *data);
 
 #ifdef KIOCGETKEY
 static int kbd_oldkeymap __P((struct kbd_state *ks,
@@ -446,7 +446,7 @@
                break;
 
        case KIOCSLED:
-               error = kbd_iocsled(k, (int *)data);
+               error = kbd_iocsled(k, (char *)data);
                break;
 
        case KIOCGLED:
@@ -624,7 +624,7 @@
 static int
 kbd_iocsled(k, data)
        struct kbd_softc *k;
-       int *data;
+       char *data;
 {
        int leds, error, s;



2. On my keyboard I have a key next to the "left shift" key which gives
   the code 124. It is labelled with the characters '<',  '>' (shifted)
   and '|' (Alt Graph), but I'm having a Swedish keyboard, so it may
   be used for something other on English keyboards.

3. "Ctrl" and "Caps Lock" have switched places.

4. "Alt Graph" and "Compose" have switched places.

   These problems are solved by something like


bash$ diff -u kbd_tables.c.bak kbd_tables.c
--- kbd_tables.c.bak	Wed Oct 29 13:40:43 1997
+++ kbd_tables.c	Sat Nov  1 23:45:48 1997
@@ -61,7 +61,7 @@
     /*  10: F4          */	KEYSYM_NOP,
     /*  11: F12         */	KEYSYM_NOP,
     /*  12: F5          */	KEYSYM_NOP,
-    /*  13: AltGraph    */	KEYSYM_CLRMOD | KBMOD_ALTGRAPH,
+    /*  13: Compose     */	KEYSYM_NOP,
     /*  14: F6          */	KEYSYM_NOP,
     /*  15:             */	KEYSYM_HOLE,
     /*  16: F7          */	KEYSYM_NOP,
@@ -115,7 +115,7 @@
     /*  64: [           */	KEYSYM_NOP,
     /*  65: ]           */	KEYSYM_NOP,
     /*  66: Delete      */	KEYSYM_NOP,
-    /*  67: Compose     */	KEYSYM_NOP,
+    /*  67: AltGraph    */	KEYSYM_CLRMOD | KBMOD_ALTGRAPH,
     /*  68: R7/Home     */	KEYSYM_NOP,
     /*  69: R8/Up       */	KEYSYM_NOP,
     /*  70: R9/PgUp     */	KEYSYM_NOP,
@@ -124,7 +124,7 @@
     /*  73: L8/Paste    */	KEYSYM_NOP,
     /*  74:             */	KEYSYM_HOLE,
     /*  75:             */	KEYSYM_HOLE,
-    /*  76: Ctrl_L      */	KEYSYM_CLRMOD | KBMOD_CTRL_L,
+    /*  76: CapsLock    */	KEYSYM_NOP,
     /*  77: A           */	KEYSYM_NOP,
     /*  78: S           */	KEYSYM_NOP,
     /*  79: D           */	KEYSYM_NOP,
@@ -167,12 +167,12 @@
     /* 116:             */	KEYSYM_HOLE,
     /* 117:             */	KEYSYM_HOLE,
     /* 118: L16/Help    */	KEYSYM_NOP,
-    /* 119: CapsLock    */	KEYSYM_NOP,
+    /* 119: Ctrl_L      */	KEYSYM_CLRMOD | KBMOD_CTRL_L,
     /* 120: Meta_L      */	KEYSYM_CLRMOD | KBMOD_META_L,
     /* 121: SpaceBar    */	KEYSYM_NOP,
     /* 122: Meta_R      */	KEYSYM_CLRMOD | KBMOD_META_R,
     /* 123:             */	KEYSYM_HOLE,
-    /* 124:             */	KEYSYM_HOLE,
+    /* 124:             */	KEYSYM_NOP,
     /* 125: KP_Add      */	KEYSYM_NOP,
     /* 126:             */	KEYSYM_LAYOUT,	/* layout next */
     /* 127:             */	KEYSYM_RESET,	/* kbd ID next */
@@ -197,7 +197,7 @@
     /*  10: F4          */	KEYSYM_NOP,
     /*  11: F12         */	KEYSYM_NOP,
     /*  12: F5          */	KEYSYM_NOP,
-    /*  13: AltGraph    */	KEYSYM_SETMOD | KBMOD_ALTGRAPH,
+    /*  13: Compose     */	KEYSYM_COMPOSE,
     /*  14: F6          */	KEYSYM_NOP,
     /*  15:             */	KEYSYM_HOLE,
     /*  16: F7          */	KEYSYM_NOP,
@@ -251,7 +251,7 @@
     /*  64: [           */	CTL('['),
     /*  65: ]           */	CTL(']'),
     /*  66: Delete      */	0x7f,
-    /*  67: Compose     */	KEYSYM_COMPOSE,
+    /*  67: AltGraph    */	KEYSYM_SETMOD | KBMOD_ALTGRAPH,
     /*  68: R7/Home     */	CTL('A'),	/* emacs */
     /*  69: R8/Up       */	CTL('P'),	/* emacs */
     /*  70: R9/PgUp     */	0x80|'v',	/* emacs */
@@ -260,7 +260,7 @@
     /*  73: L8/Paste    */	KEYSYM_NOP,
     /*  74:             */	KEYSYM_HOLE,
     /*  75:             */	KEYSYM_HOLE,
-    /*  76: Ctrl_L      */	KEYSYM_SETMOD | KBMOD_CTRL_L,
+    /*  76: CapsLock    */	KEYSYM_INVMOD | KBMOD_CAPSLOCK,
     /*  77: A           */	CTL('A'),
     /*  78: S           */	CTL('S'),
     /*  79: D           */	CTL('D'),
@@ -303,12 +303,12 @@
     /* 116:             */	KEYSYM_HOLE,
     /* 117:             */	KEYSYM_HOLE,
     /* 118: L16/Help    */	KEYSYM_NOP,
-    /* 119: CapsLock    */	KEYSYM_INVMOD | KBMOD_CAPSLOCK,
+    /* 119: Ctrl_L      */	KEYSYM_SETMOD | KBMOD_CTRL_L,
     /* 120: Meta_L      */	KEYSYM_SETMOD | KBMOD_META_L,
     /* 121: SpaceBar    */	CTL(' '),
     /* 122: Meta_R      */	KEYSYM_SETMOD | KBMOD_META_R,
     /* 123:             */	KEYSYM_HOLE,
-    /* 124:             */	KEYSYM_HOLE,
+    /* 124:             */	KEYSYM_NOP,
     /* 125: KP_Add      */	KEYSYM_NOP,
     /* 126:             */	KEYSYM_HW_ERR,
     /* 127:             */	KEYSYM_ALL_UP,
@@ -604,7 +604,7 @@
     /*  10: F4          */	KEYSYM_FUNC_F(4),
     /*  11: F12         */	KEYSYM_FUNC_F(12),
     /*  12: F5          */	KEYSYM_FUNC_F(5),
-    /*  13: AltGraph    */	KEYSYM_SETMOD | KBMOD_ALTGRAPH,
+    /*  13: Compose     */	KEYSYM_COMPOSE,
     /*  14: F6          */	KEYSYM_FUNC_F(6),
     /*  15:             */	KEYSYM_HOLE,
     /*  16: F7          */	KEYSYM_FUNC_F(7),
@@ -658,7 +658,7 @@
     /*  64: [           */	'[',
     /*  65: ]           */	']',
     /*  66: Delete      */	0x7f,
-    /*  67: Compose     */	KEYSYM_COMPOSE,
+    /*  13: AltGraph    */	KEYSYM_SETMOD | KBMOD_ALTGRAPH,
     /*  68: R7/Home     */	KEYSYM_FUNC_R(7),
     /*  69: R8/Up       */	KEYSYM_FUNC_R(8),
     /*  70: R9/PgUp     */	KEYSYM_FUNC_R(9),
@@ -667,7 +667,7 @@
     /*  73: L8/Paste    */	KEYSYM_FUNC_L(8),
     /*  74:             */	KEYSYM_HOLE,
     /*  75:             */	KEYSYM_HOLE,
-    /*  76: Ctrl_L      */	KEYSYM_SETMOD | KBMOD_CTRL_L,
+    /*  76: CapsLock    */	KEYSYM_INVMOD | KBMOD_CAPSLOCK,
     /*  77: A           */	'a',
     /*  78: S           */	's',
     /*  79: D           */	'd',
@@ -710,12 +710,12 @@
     /* 116:             */	KEYSYM_HOLE,
     /* 117:             */	KEYSYM_HOLE,
     /* 118: L16/Help    */	KEYSYM_FUNC_L(16),
-    /* 119: CapsLock    */	KEYSYM_INVMOD | KBMOD_CAPSLOCK,
+    /* 119: Ctrl_L      */	KEYSYM_SETMOD | KBMOD_CTRL_L,
     /* 120: Meta_L      */	KEYSYM_SETMOD | KBMOD_META_L,
     /* 121: SpaceBar    */	' ',
     /* 122: Meta_R      */	KEYSYM_SETMOD | KBMOD_META_R,
     /* 123:             */	KEYSYM_HOLE,
-    /* 124:             */	KEYSYM_HOLE,
+    /* 124:             */	'<',
     /* 125: KP_Add      */	KEYSYM_FUNC_N(14),
     /* 126:             */	KEYSYM_HW_ERR,
     /* 127:             */	KEYSYM_ALL_UP,
@@ -736,7 +736,7 @@
     /*  10: F4          */	KEYSYM_FUNC_F(4),
     /*  11: F12         */	KEYSYM_FUNC_F(12),
     /*  12: F5          */	KEYSYM_FUNC_F(5),
-    /*  13: AltGraph    */	KEYSYM_SETMOD | KBMOD_ALTGRAPH,
+    /*  13: Compose     */	KEYSYM_COMPOSE,
     /*  14: F6          */	KEYSYM_FUNC_F(6),
     /*  15:             */	KEYSYM_HOLE,
     /*  16: F7          */	KEYSYM_FUNC_F(7),
@@ -790,7 +790,7 @@
     /*  64: [           */	'{',
     /*  65: ]           */	'}',
     /*  66: Delete      */	0x7f,
-    /*  67: Compose     */	KEYSYM_COMPOSE,
+    /*  67: AltGraph    */	KEYSYM_SETMOD | KBMOD_ALTGRAPH,
     /*  68: R7/Home     */	KEYSYM_FUNC_R(7),
     /*  69: R8/Up       */	KEYSYM_FUNC_R(8),
     /*  70: R9/PgUp     */	KEYSYM_FUNC_R(9),
@@ -799,7 +799,7 @@
     /*  73: L8/Paste    */	KEYSYM_FUNC_L(8),
     /*  74:             */	KEYSYM_HOLE,
     /*  75:             */	KEYSYM_HOLE,
-    /*  76: Ctrl_L      */	KEYSYM_SETMOD | KBMOD_CTRL_L,
+    /*  76: CapsLock    */	KEYSYM_INVMOD | KBMOD_CAPSLOCK,
     /*  77: A           */	'A',
     /*  78: S           */	'S',
     /*  79: D           */	'D',
@@ -842,12 +842,12 @@
     /* 116:             */	KEYSYM_HOLE,
     /* 117:             */	KEYSYM_HOLE,
     /* 118: L16/Help    */	KEYSYM_FUNC_L(16),
-    /* 119: CapsLock    */	KEYSYM_INVMOD | KBMOD_CAPSLOCK,
+    /* 119: Ctrl_L      */	KEYSYM_SETMOD | KBMOD_CTRL_L,
     /* 120: Meta_L      */	KEYSYM_SETMOD | KBMOD_META_L,
     /* 121: SpaceBar    */	' ',
     /* 122: Meta_R      */	KEYSYM_SETMOD | KBMOD_META_R,
     /* 123:             */	KEYSYM_HOLE,
-    /* 124:             */	KEYSYM_HOLE,
+    /* 124:             */	'>',
     /* 125: KP_Add      */	KEYSYM_FUNC_N(14),
     /* 126:             */	KEYSYM_HW_ERR,
     /* 127:             */	KEYSYM_ALL_UP,
  

   /Krister