Hi Federico, On Jan 1, 2008 5:50 PM, Federico Ferri <[EMAIL PROTECTED]> wrote: > again it's me dealing with Apple Keyboards... I got the latest [1], > which unfortunately lacks an Insert key (yes, I could type 'i' instead > of hitting Intert inside vim, but I'd like to get my Ins key back... you > know...) > > till today I used keyfuzz to remap KEY_F13 to the (missing since ever!) > KEY_SYSRQ, this way: > echo "0x00070068 99" | keyfuzz -s -d/dev/input/event1 > > today I spent hours on trying to understand how the above worked. what I > learned today is: > * usage code is split into PAGE and the CODE itself... so, I see my > usage code is 0x68 of page 7
RIght. > (but I didn't find in the hid code > where/what are those pages) http://www.usb.org/developers/devclass_docs/Hut1_12.pdf > * usage code is mapped thru the hid_keyboard[256] array at > drivers/hid/hid-input.c:44 > > so I believed now I know how to find more usage codes, but... surprise! > KEY_FN which is 0x1d0 (464) doesn't fit at all into that table > now here I don't really understand how things work (and this is not a > powerbook!). > > do you think it is possible to remap that FN key to the more appropriate > (at least for its location*) INS key [with keyfuzz]? > can you give me the usage code? > please, more generally, teach me how to find those usages in such > situations.. I would really appreciate! > > > > *: would otherwise be reasonable to fix this stuff in hid-input or > whatever, hard-replacing that key? No. It is only your preference to have FN map to INS. > a FN key which does not act like a modifier** is totally useless for me, > while missing the INS key it is a big handicap. > > **: on Macs, the FN key combined with the special keys should output one > of: 113 (Mute), 114 (VolumeDown), 115 (VolumeUp), 161 (EjectCD), 163 > (NextSong), 164 (PlayPause), 165 (PreviousSong). [[this does not happen > on linux, or at least I can't hit those keycodes - tested in evtest- > using FN+F##... so my guess that FN doesn't act as a modifier]] > those keycode should came out of the second input devices (yes, the > apple USB keyboard is seen as two distinct event devices, one for > keyboard, one for special keys) > You need to lok at hid_pb_fnmode option of the HID driver. It has to do with enabling aforemention FN translation on powerbooks. It only works if the device is marked with HID_QUIRK_POWERBOOK_HAS_FN so please check the VID/PID of your device. Since you mentioned that it is not a powerbook you may have to add that quirk dynamically via sysfs. -- Dmitry