tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Enhancing ukbd for Apple notebooks


I'm trying to improve support for Apple's notebook USB keyboards, which have
a few quirks:

1. The FN key is not handled internally, but has to be evaluated by ukbd. It
can be found in the report descriptor by page=0xff, usage=3.

2. From the hardware point of view there are three different keyboard types:
ANSI, ISO and JIS. The ISO keyboard has the keycodes 0x35 and 0x64 swapped
(that's right of shift and left of '1'), and the key left of return
generates code 0x31 instead of 0x32.

3. There is no AltGr, which is a real problem with non-US keymaps.

My current solution is to add Apple ISO keyboards with the new quirk-flag
UQ_APPLE_ISO to usb_quirks.c. ukbd.c will then fix the keycodes when it
sees this flag. It will also automatically detect an Apple FN-key and
translate all keycodes to keypad-keycodes, when it is pressed.

Additionally I would like to add a new keymap-variant, called "apple" to
wsksymdef.h and ukbdmap.c. Theoretically it could be extended to have the
same keymap as under OSX, but for the moment it will at least generate a
NumLock event for FN-F6 and turn the right Apple/Command key into AltGr.

This part is already working fine here. Are there any objections before I
commit the code, or even better ideas?

The diff with all changes can be downloaded from

Next I would like to add some support for the other function keys, when
pressed together with FN. They are used to control display brightness,
volume and keyboard illumination. But as I understand it cannot easily be
done, as a wscons Cmd_xxx code always requires CTRL+ALT to be pressed, and
not FN...

Frank Wille

Home | Main Index | Thread Index | Old Index