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

Re: switch from ADB to linux keycodes ...




Richard Clamp wrote:

Don't just tease, please post a patch, and we'll love you forever :)

Below is my attempt to implement the Cap Lock fix. It seems to work on
my TiBook (but then again I have only been using my modified kernel
for about 5 minutes...).

Hope this is usefull.

Gregory P. Keeney
Mad Computer Scientist

--- adbhid.c    Tue Aug 28 11:46:26 2001
+++ adbhid.c.gpk    Tue Aug 28 13:45:12 2001
@@ -52,6 +52,9 @@
#define KEYB_LEDREG    2    /* register # for leds on ADB keyboard */
#define MOUSE_DATAREG 0 /* reg# for movement/button codes from mouse */

+/* Gregory's Caps Lock hack */
+static int caps_lock_down = 0;
+
static int adb_message_handler(struct notifier_block *, unsigned long, void *);
static struct notifier_block adbhid_adb_notifier = {
   notifier_call:    adb_message_handler,
@@ -143,9 +146,16 @@
   keycode &= 0x7f;

   switch (keycode) {
-    case 0x39: /* Generate down/up events for CapsLock everytime. */
-        input_report_key(&adbhid[id]->input, KEY_CAPSLOCK, 1);
-        input_report_key(&adbhid[id]->input, KEY_CAPSLOCK, 0);
+   /* Gregory's Caps Lock hack */
+    case 0x39:
+   case 0x7f: //Need to find Special Event...
+      if (caps_lock_down) {
+         input_report_key(&adbhid[id]->input, KEY_CAPSLOCK, 0);
+         caps_lock_down = 0;
+      } else {
+         input_report_key(&adbhid[id]->input, KEY_CAPSLOCK, 1);
+         caps_lock_down = 1;
+      }
       return;
   case 0x3f: /* ignore Powerbook Fn key */
       return;



Reply to: