[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

capslock fix for powerbooks



There are several messages in the archive about this fix -- is anyone
using it successfully?  I'm trying it out with 2.4.19-presomething,
and it doesn't seem to do the trick.  Is this the most up to date
version of said hack (below)?  I'm using a Lombard, btw.

Just thought I'd ask before trying to fix it myself...

--- drivers/macintosh/adbhid.c.orig	Mon Aug 27 21:28:19 2001
+++ drivers/macintosh/adbhid.c	Tue Aug 28 22:05:33 2001
@@ -139,14 +139,46 @@
 {
 	int up_flag;
 
+#if 1
+	static int caps_lock_down = 0;
+#endif
+
+#if 1
+	if (1) {
+		/* HACK to fix caps-lock on Powerbook(?) keyboards */
+		switch (keycode) {
+		case 0x39:
+			caps_lock_down = 1;
+			break;
+		case 0xff:
+			if (caps_lock_down) {
+				/* 'caps-lock' is down, must be
+				 * 'caps-lock' being released
+				 */
+				caps_lock_down = 0;
+				keycode = 0xb9;
+			} else {
+				/* must be 'caps-lock' being pressed
+				 */
+				keycode = 0x39;
+			}
+			break;
+		}
+	}
+#endif
+
 	up_flag = (keycode & 0x80);
 	keycode &= 0x7f;
 
 	switch (keycode) {
 	case 0x39: /* Generate down/up events for CapsLock everytime. */
+if (0) {
 		input_report_key(&adbhid[id]->input, KEY_CAPSLOCK, 1);
 		input_report_key(&adbhid[id]->input, KEY_CAPSLOCK, 0);
 		return;
+} else {
+		break;
+}
 	case 0x3f: /* ignore Powerbook Fn key */
 		return;
 	}

-- 
Josh Huber                                   | huber@debian.org |


-- 
To UNSUBSCRIBE, email to debian-powerpc-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: