Subject: Re: LK401 support?
To: Bob Lantz <lantz@Stanford.EDU>
From: Simon Burge <simonb@netbsd.org>
List: port-pmax
Date: 08/27/1999 14:09:13
Bob Lantz wrote:

> Is anyone using an LK401 keyboard? Mine can't seem to generate the
> following keys/codes (following is from xkeycaps:)
> 
> 	Left Alt 	(0xAC)
> 	Right Alt	(0xB2)
> 	Right compose	(0xAD)
> 
> It seems that there is some support for the lk401 in the source; I
> tried adding in entries for the missing keys into lk201.c, but that
> didn't quite do the trick. Perhaps there is an easier way?

I can't test this easily (and don't even know if it's right!).  Can
you give it a go and let me know what happens?

First, you'll need to rebuilt a kernel with the following:

Index: arch/pmax/dev/lk201.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/pmax/dev/lk201.c,v
retrieving revision 1.14
diff -p -u -r1.14 lk201.c
--- lk201.c	1999/04/24 08:01:04	1.14
+++ lk201.c	1999/08/27 03:36:12
@@ -55,7 +55,7 @@ static unsigned char unshiftedAscii[] = 
 /* 64 */ KBD_F6,	KBD_F7,		KBD_F8,		KBD_F9,
 /* 68 */ KBD_F10,	KBD_NOKEY,	KBD_NOKEY,	KBD_NOKEY,
 /* 6c */ KBD_NOKEY,	KBD_NOKEY,	KBD_NOKEY,	KBD_NOKEY,
-/* 70 */ KBD_NOKEY,	'\033',		KBD_F12,	KBD_F13,
+/* 70 */ KBD_NOKEY,	'\033',		KBD_F12,	KBD_F13,	/* XXX 71 == F11 */
 /* 74 */ KBD_F14,	KBD_NOKEY,	KBD_NOKEY,	KBD_NOKEY,
 /* 78 */ KBD_NOKEY,	KBD_NOKEY,	KBD_NOKEY,	KBD_NOKEY,
 /* 7c */ KBD_HELP,	KBD_DO,		KBD_NOKEY,	KBD_NOKEY,
@@ -69,9 +69,9 @@ static unsigned char unshiftedAscii[] = 
 /* 9c */ ',',		'7',		'8',		'9',
 /* a0 */ '-',		KBD_KP_F1,	KBD_KP_F2,	KBD_KP_F3,
 /* a4 */ KBD_KP_F4,	KBD_NOKEY,	KBD_NOK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Y,	KBD_NOKEY,	KBD_NOKEY,
 /* bc */ KBD_DEL,	KBD_RET,	KBD_TAB,	'~',
Index: dev/dec/lk201.h
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/dec/lk201.h,v
retrieving revision 1.7
diff -p -u -r1.7 lk201.h
--- lk201.h	1999/03/19 18:34:01	1.7
+++ lk201.h	1999/08/27 03:36:12
@@ -54,9 +54,15 @@
 #define KBD_UP		235
 
 #define KBD_CONTROL	236
-#define KBD_SHIFT	237
-#define KBD_CAPSLOCK	238
-#define KBD_ALTERNATE	239
+#define KBD_CAPSLOCK	237
+#define KBD_L_SHIFT	238
+#define KBD_SHIFT	KBD_L_SHIFT
+#define KBD_R_SHIFT	239
+#define KBD_L_COMPOSE	240
+#define KBD_COMPOSE	KBD_L_COMPOSE
+#define KBD_R_COMPOSE	241
+#define KBD_L_ALT	242
+#define KBD_R_ALT	243
 
 
 
@@ -70,6 +76,8 @@
 #define KEY_SHIFT	0xae
 #define KEY_CONTROL	0xaf
 #define KEY_CAPSLOCK	0xb0
+#define KEY_L_ALT	0xac
+#define KEY_R_COMPOSE	0xad
 #define KEY_R_ALT	0xb2
 #define KEY_UP		0xb3
 #define KEY_REPEAT	0xb4

And then rebuild the Xserver with the following:

Index: lk201.c
===================================================================
RCS file: /cvsroot/xsrc/xc/programs/Xserver/hw/netbsd/pmax/lk201.c,v
retrieving revision 1.2
diff -p -u -r1.2 lk201.c
--- lk201.c	1999/05/04 22:42:59	1.2
+++ lk201.c	1999/08/27 03:59:53
@@ -322,7 +322,10 @@ GetLK201Mappings(pKeySyms, pModMap)
     map[INDEX(KEY_CTRL)] = XK_Control_L;
     map[INDEX(KEY_LOCK)] = XK_Caps_Lock;
     map[INDEX(KEY_COMPOSE)] = XK_Multi_key;
+    map[INDEX(KEY_R_COMPOSE)] = XK_Multi_key;
     map[INDEX(KEY_COMPOSE)+1] = XK_Meta_L;
+    map[INDEX(KEY_L_ALT)] = XK_Alt_L;
+    map[INDEX(KEY_R_ALT)] = XK_Alt_R;
     map[INDEX(KEY_DELETE)] = XK_Delete;
     map[INDEX(KEY_RETURN)] = XK_Return;
     map[INDEX(KEY_TAB)] = XK_Tab;

I've got no idea how Meta_L is handled, and how Meta_R (with R_COMPOSE)
would be handled...

Simon.