Hi, I am thinking about an approach to set the brightness on my MacBook via standard keyboard keys. I can already call from the commandline "wsconsctl display.brightness=xx", and it will arrive in my asmc.c driver (thanx to Mark's hints). Now I want to use the standard fn-keys on the keyboard. Other laptops (Thinkpad, Toshiba…) have acpi usage, that does not work for the Mac. So I thought I need to go through ukbd/wskbd.
The brightness keys are FN-F1 (down) and FN-F2 (up), and keyboard backlight FN-F5 (down) and FN-F6 (up). The MBPro has a USB type keyboard, and in ukbd.c there is "void ukbd_apple_munge()" prepared. Looking at the way audio is prepared, I seem to understand, that ukbd.c translates key codes to values defined in ukbdmap.c, and based on these values volume can be raised/lowered in wskbd.c. Can I simply add equivalents in ukbdmap.c for brightnes and backlight control? (is there a logic I'd violate, when using numbers behind audio section?) In wskbd.c: I was trying to find out the link between "wskbd_set_mixervolume" and the function in audio.c. How would wskbd.c know, it is in audio.c defined? I'd like to do similar with a call "wskbd_set_kbdbacklit" and "wskbd_set_brightness" to my asmc.c driver. Oh, yes, Miod mentioned, he has "evil wscons plans [to] include the introduction of a brightness controller abstraction" [post release...] :-) thx, regards, Volker
