How to add support for Macbook Pro (USB) keyboard?

Christoph Langguth christoph at rosenkeller.org
Sat May 16 19:12:55 UTC 2009


Hi Hans Petter,

wow!! I don't know what kind of voodoo you actually did there, but it 
works perfectly! :-D Thanks!

Just two final little comments and two questions:
line 463 in ukbd.c should actually read

case 0x28: return 0x49; /* RETURN -> INSERT */

instead of

case 0x2c: return 0x49; /* SPACE -> INSERT */

I just realized after writing it that all other OS's (MacOS, Windows, 
Linux) map Fn+Enter to INS, so I guess it would be best to stick with 
that convention and not to introduce new idiosyncrasies...

and: in ukbd_apple_swap() the comments are misleading (Well actually the 
parameter name may have been misleading in the first place, since I 
guess it's scancodes, not keycodes, at that level, right? Anyway, it's 
not the "5" and "d" keys that are being swapped, but the one just left 
of the "1" (^ and ° on a german keyboard, ~ on the US one if i'm 
correct), and the one between the left shift and the Y/Z key (< and > on 
german kbd, not sure about US).

Finally, for curiosity, since I didn't really get how the code works: 
how do you know reliably whether to toggle the APPLE_SWAP flag? Does the 
HID descriptor give you information about that "anomaly"? (I'm just 
wondering whether it wouldn't mistakenly swap the keys on unaffected 
Apple keyboards)

And... one final issue here, which is low-priority for me but would be 
the topping on the cake: CAPS lock is functioning normally, but the LED 
does not light up when engaged. Is there any way to fix this?

Thanks a lot & cheers!
Chris

Hans Petter Selasky schrieb:
> Hi Christoph,
> 
> Download the two patched files from P4, ukbd.c and usbhid.h, and put them 
> under sys/dev/usb/input and sys/dev/usb/ respectivly.
> 
> Then recompile the ukbd module and/or kernel.
> 
> The attach failure was due to a bug in the previous patch where I had 
> forgotten to update N_TRANSFER.
> 
> http://perforce.freebsd.org/chv.cgi?CH=162165
> 
> I've tried to make your patch more formal so that we don't have to list the 
> VID+PID for every Apple Keyboard around.
> 
> --HPS
> 



More information about the freebsd-usb mailing list