Subject: Re: modifier key remap can be improved?
To: None <port-macppc@netbsd.org>
From: Magnus Henoch <mange@freemail.hu>
List: port-macppc
Date: 05/16/2005 11:48:26
Magnus Henoch <mange@freemail.hu> writes:

> This doesn't work perfectly.  Sometimes the control key gets stuck, so
> the next C you type comes out as Ctrl+C, which might cause accidents.
> Hitting caps lock again unsticks it (but there is no indication before
> the fact).  I had the same problem with uControl under Mac OS X.
>
> But if Tiger can do this properly, so can NetBSD.  I have been meaning
> to debug this option, but I haven't gotten around to do it...

I've started by printing debug output from
src/sys/arch/macppc/dev/akbd.c.  I'm looking for a reliable way to
reproduce this problem, but I haven't found one yet.

I offer the following patch to anyone who wants to help finding the
cause of this bug.  It should apply to both -current and 2.0.  You can
read the copious information it produces with tail -f
/var/log/messages.

Magnus

--- akbd.c	02 Feb 2005 04:03:49 +0100	1.32
+++ akbd.c	16 May 2005 11:29:39 +0200	
@@ -549,8 +549,10 @@
 	 * press:   up(127)  [255]
 	 * release: up(57)   [185] (LED turns off)
 	 */
-	if ((key == 57) || (key == 185))
+	if ((key == 57) || (key == 185)) {
+		printf("akbd: key was %3d, now %3d, setting shift to 0\n", key,key);
 		shift = 0;
+	}
 	
 	if (key == 255) {
 		if (shift == 0) {
@@ -560,6 +562,7 @@
 			key = 57;
 			shift = 0;
 		}
+		printf("akbd: key was 255, now %3d, setting shift to %d\n", key, shift);
 	}
 #endif