From: Jerome F. <jf...@gm...> - 2008-06-02 07:58:05
|
> On Sun, 2008-06-01 at 20:00 -0700, Jerome Flesch wrote: >> >> >> >> In kernel/mactel-patches-2.6.24/hid-add-new-apple-keyboard.patch , two >> >> keys seem to be missing in the array "apple_keyboard_fn_keys": >> >> { KEY_F5, KEY_KBDILLUMDOWN, POWERBOOK_FLAG_FKEY }, >> >> { KEY_F6, KEY_KBDILLUMUP, POWERBOOK_FLAG_FKEY }, >> >> >> >> Without these two lines, it's not possible for me on my macbook pro >> >> 4.1 to adjust the light of the keyboard with pommed, but with them, it >> >> works fine. >> > >> > >> > It would be great if you could test if the problem still happens on >> > 2.6.25.x, and port it if necessary (I quickly tried, but it is not trival, >> > as some files changed quite importantly in the kernel) >> > >> Done. I had to port the patch for the 2.6.24 to the 2.6.25.4 (some >> part of the 2.6.24 patch were already included mainstream ?). > > Yeah, I pushed that via the hid tree for external Aluminum USB > keyboards. > >> I've joined the patch to this mail. >> >> The problem with the two keys is confirmed and solved in this patch. >> >> I prefered to not add another "#define APPLE_QUIRK" as done in the >> 2.6.24 patch because the 2.6.25 seems to include a lot more quirks and >> almost all the bits of the 32bits integer contaning the list of quirk >> to apply are used now. Moreover, the word "powerbook" has been >> replaced in many places by "apple", so adding another quirk name using >> the word "apple" would have been confusing :/ >> Instead, I did like it seems to be done in the mainstream 2.6.25.4 : >> Look if the product ID is between 0x220 and 0x300 to know if it's a >> powerbook keyboard or another apple keyboard. According to the list of >> apple keyboards in drivers/hid/usbhid/hid-quirks.c, it should be fine. > > The way you're doing it: > >> static struct hidinput_key_translation apple_fn_keys[] = { >> { KEY_BACKSPACE, KEY_DELETE }, >> { KEY_F1, KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY }, >> { KEY_F2, KEY_BRIGHTNESSUP, APPLE_FLAG_FKEY }, >> { KEY_F3, KEY_FN_F5, APPLE_FLAG_FKEY }, /* >> Exposé */ >> { KEY_F4, KEY_FN_F4, APPLE_FLAG_FKEY }, /* >> Dashboard */ >> + { KEY_F5, KEY_KBDILLUMDOWN, APPLE_FLAG_FKEY }, >> + { KEY_F6, KEY_KBDILLUMUP, APPLE_FLAG_FKEY }, >> { KEY_F7, KEY_PREVIOUSSONG, APPLE_FLAG_FKEY }, >> { KEY_F8, KEY_PLAYPAUSE, APPLE_FLAG_FKEY }, >> { KEY_F9, KEY_NEXTSONG, APPLE_FLAG_FKEY }, > > breaks keyboards without these special keys, e.g. external USB > keyboards. Also, I think some MacBook Pros have/had a different layout > of the special keys, though you may already account for that. > I had a quick look and on Google images, and the only similar layout but different for these 2 keys that I can find is the one of the alu wireless keyboard of Apple: http://www.thomann.de/fr/prod_bdb_AR_119224.html?image=0&sid=c0c7390b59f0507d18fadbba8776c7b8 But these two keys seem to be mapped to nothing in fact. So, imho, mapping these two keys to keyboard brightness control, even if it's not applicable to these keyboard, still makes sense to me : It keeps the layout consistent (having to press Fn to get the Fx keys except for F5 and F6 is weird), and should no other side effect on these keyboards. My quick look on Google images also showed me some macbooks pro (probably first generation) having the powerbook layout ( http://www.notebookreview.com/assets/15839.jpg ). But none of them having one similar-but-different to mine. > I'm CC'ing Michael Hanselmann, who's done most of the work on this > stuff. I think his plan was to add a new field to the quirks struct so a > single quirk can use several different tables. Michael, have you > submitted any of that yet? > |