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

Hans Petter Selasky hselasky at c2i.net
Sat May 16 19:55:50 UTC 2009


On Saturday 16 May 2009, Christoph Langguth wrote:
> Hi Hans Petter,
>
> 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...

Fixed.

>
> 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).

Fixed.

>
> 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)

I was just taking your example. I assume that Apple make the keyboards alike. 
If not we will have to adjust. I did not look too close at the HID 
descriptor. I just assume that when the special HID item is present, which 
indicates the EJECT, then it is an Apple keyboard and that it works like an 
Apple keyboard.

>
> 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?

Can you find the bit or byte that is changing in the report which corresponds 
to the CAPS lock key? Also don't forget to print the first byte which is the 
ID byte.

--HPS


More information about the freebsd-usb mailing list