*** drivers/macintosh/adbhid.c.orig Thu Sep 25 23:17:35 2003 --- drivers/macintosh/adbhid.c Thu Sep 25 23:19:43 2003 *************** *** 149,163 **** --- 149,190 ---- adbhid_input_keycode(int id, int keycode, int repeat) { int up_flag; + static int caps_lock_down = 0; + + /* Hack to fix caps-lock on TiBook keyboard. */ + 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; + } 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; + #endif case 0x3f: /* ignore Powerbook Fn key */ return; #ifdef CONFIG_ALL_PPC