Jesus Climent <[EMAIL PROTECTED]> writes:
> On Thu, Nov 11, 2004 at 12:05:39AM +0100, Jose A. Ortega Ruiz wrote:
>> 
>> hi. i've just installed sid on a new ibook G4 12''. i wanted to use
>> ctrl:nocaps in my XFree86 config, but the caps_lock key reports a
>> 'release key' event immediately after pressing it (without actually
>> releasing it) and, well, it doesn't work... is there any
>> workaround?
>
> You can use the following patch:


Thanks, it works for me, once I had it 2.6.9-friendly, like this:

--- adbhid.c.orig       2004-11-18 15:35:39.404768904 +0100
+++ adbhid.c    2004-11-18 15:40:10.367576296 +0100
@@ -286,16 +286,43 @@
        struct adbhid *ahid = adbhid[id];
        int up_flag;
 
+#if 1
+       static int caps_lock_down = 0;
+#endif
+
+#if 1
+       if (1) {
+               switch (keycode) {
+               case 0x39:
+                       caps_lock_down = 1;
+                       break;
+               case 0xff:
+                       if (caps_lock_down) {
+                               caps_lock_down = 0;
+                               keycode = 0xb9;
+                       } else {
+                               keycode = 0x39;
+                       }
+                       break;
+               }
+       }
+#endif
+
        up_flag = (keycode & 0x80);
        keycode &= 0x7f;
 
        switch (keycode) {
        case ADB_KEY_CAPSLOCK: /* Generate down/up events for CapsLock 
everytime. */
+         if (0) {
                input_regs(&ahid->input, regs);
                input_report_key(&ahid->input, KEY_CAPSLOCK, 1);
                input_report_key(&ahid->input, KEY_CAPSLOCK, 0);
                input_sync(&ahid->input);
                return;
+         } else {
+               break;
+         }
+         
 #ifdef CONFIG_PPC_PMAC
        case ADB_KEY_POWER_OLD: /* Power key on PBook 3400 needs remapping */
                switch(pmac_call_feature(PMAC_FTR_GET_MB_INFO,


ciao,
-- 
  intrigeri <[EMAIL PROTECTED]>
  gnupg key 0xCA80A0D2 @ keys.indymedia.org
  [ Who wants a world in which the guarantee that we shall not ]
  [  die of starvation entails the risk of dying of boredom ?  ]

Reply via email to