On Sun, Aug 31, 2003 at 08:04:12PM +0200, Guido Guenther wrote: > Hi, > while trying to map caps lock as ctrl on my 12" powerbook I noticed that > the keypress and release events don't seem to work as expected. While > e.g. alt generates the "KeyPress-Event" when pushing down the key and > the KeyRelease-Event when letting it go "caps lock" seems to generate > the events differently: > - it generates KeyPress+KeyRelease when pushing down the key and the LED was > off > - it generates KeyPress+KeyRelease when releasing the key and the LED was on > Using showkey on the console confirms this behaviour. This seems to > caused by > /* > * adb kludge!! Imitate pc caps lock behaviour by > * generating an up/down event for each time caps > * is pressed/released. Also, makes sure that the > * LED are handled. [EMAIL PROTECTED] > */ > case 0x39: > handle_scancode(0x39, 1); > handle_scancode(0x39, 0); > tasklet_schedule(&keyboard_tasklet); > return; > in mac_keyb.c. What exactly is the reason for not generating a keyup on > release and keydown on press?
Brokenness of ADB keyboards. The keyboard driver only reports events when the keyboard reports that a key has been pressed or released. But the ADB keyboard itslef keeps the state of the the key and reports one one half the key events (key-down, nothing on key-up, nothing on key-down, key-up). Forget about using Caps-Lock as Control, unless Segher finally finds a way to modify the PMU99 code to remove this oddity. (It has to be optional to work with MacOS). Regards, Gabriel