diff -uNr linux-2.6.23-hardened-r4.orig/drivers/hid/hid-input.c linux-2.6.23-hardened-r4/drivers/hid/hid-input.c --- linux-2.6.23-hardened-r4.orig/drivers/hid/hid-input.c 2008-02-21 23:57:28.000000000 +0200 +++ linux-2.6.23-hardened-r4/drivers/hid/hid-input.c 2008-02-22 00:26:58.000000000 +0200 @@ -53,7 +53,7 @@ 115,114,unk,unk,unk,121,unk, 89, 93,124, 92, 94, 95,unk,unk,unk, 122,123, 90, 91, 85,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk, unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk, - unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk, + unk,unk,unk,unk,unk,unk,179,180,unk,unk,unk,unk,unk,unk,unk,unk, unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk, unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk,unk, 29, 42, 56,125, 97, 54,100,126,164,166,165,163,161,115,114,113, @@ -590,6 +590,7 @@ case 0x0e5: map_key_clear(KEY_BASSBOOST); break; case 0x0e9: map_key_clear(KEY_VOLUMEUP); break; case 0x0ea: map_key_clear(KEY_VOLUMEDOWN); break; + case 0x182: map_key_clear(KEY_FAVORITES); break; /* reserved in HUT 1.12. Reported on Petalynx remote */ case 0x0f6: map_key_clear(KEY_NEXT); break; @@ -614,6 +615,7 @@ case 0x19e: map_key_clear(KEY_COFFEE); break; case 0x1a6: map_key_clear(KEY_HELP); break; case 0x1a7: map_key_clear(KEY_DOCUMENTS); break; + case 0x1ab: map_key_clear(KEY_SPELL); break; case 0x1bc: map_key_clear(KEY_MESSENGER); break; case 0x1bd: map_key_clear(KEY_INFO); break; case 0x201: map_key_clear(KEY_NEW); break; @@ -738,7 +740,24 @@ default: goto ignore; } } else { - goto ignore; + /* Microsoft Natural Keyboard 4000 Favorite key */ + if (device->vendor == 0x045e && device->product == 0x00db) { + set_bit(EV_REP, input->evbit); + switch(usage->hid & HID_USAGE) { + case 0xff05: + /* The Favourites 1-5 keys */ + map_key_clear(KEY_FN); + set_bit(KEY_FN_F1, input->keybit); + set_bit(KEY_FN_F2, input->keybit); + set_bit(KEY_FN_F3, input->keybit); + set_bit(KEY_FN_F4, input->keybit); + set_bit(KEY_FN_F5, input->keybit); + break; + default: goto ignore; + } + } else { + goto ignore; + } } break; @@ -932,6 +951,41 @@ if ((hid->quirks & HID_QUIRK_POWERBOOK_HAS_FN) && hidinput_pb_event(hid, input, usage, value)) return; + if (usage->hid == (HID_UP_MSVENDOR | 0xff05)) { + unsigned int code = 0; + + switch (value) { + case 0x01: code = KEY_FN_F1; break; + case 0x02: code = KEY_FN_F2; break; + case 0x04: code = KEY_FN_F3; break; + case 0x08: code = KEY_FN_F4; break; + case 0x10: code = KEY_FN_F5; break; + default: code = 0; break; + } + if (code) { + input_event(input, usage->type, code, 1); + input_event(input, usage->type, code, 0); + return; + } + } + /* + * Convert FLock's F-keys to normal F-keys + * Probably this code isn't universal and will work only for: + * Microsoft Natural Ergonomic Keyboard 4000 v1.0 + */ + if (usage->code==138) usage->code=59; + if (usage->code==131) usage->code=60; + if (usage->code==182) usage->code=61; + if (usage->code==181) usage->code=62; + if (usage->code==134) usage->code=63; + if (usage->code==206) usage->code=64; + if (usage->code==232) usage->code=65; + if (usage->code==233) usage->code=66; + if (usage->code==231) usage->code=67; + if (usage->code==431) usage->code=68; + if (usage->code==234) usage->code=87; + if (usage->code==210) usage->code=88; + if (usage->hat_min < usage->hat_max || usage->hat_dir) { int hat_dir = usage->hat_dir; if (!hat_dir) diff -uNr linux-2.6.23-hardened-r4.orig/drivers/hid/usbhid/usbkbd.c linux-2.6.23-hardened-r4/drivers/hid/usbhid/usbkbd.c --- linux-2.6.23-hardened-r4.orig/drivers/hid/usbhid/usbkbd.c 2008-02-21 23:57:28.000000000 +0200 +++ linux-2.6.23-hardened-r4/drivers/hid/usbhid/usbkbd.c 2008-02-22 00:29:54.000000000 +0200 @@ -57,7 +57,7 @@ 115,114, 0, 0, 0,121, 0, 89, 93,124, 92, 94, 95, 0, 0, 0, 122,123, 90, 91, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0,179,180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 42, 56,125, 97, 54,100,126,164,166,165,163,161,115,114,113, diff -uNr linux-2.6.23-hardened-r4.orig/include/linux/input.h linux-2.6.23-hardened-r4/include/linux/input.h --- linux-2.6.23-hardened-r4.orig/include/linux/input.h 2008-02-21 23:58:14.000000000 +0200 +++ linux-2.6.23-hardened-r4/include/linux/input.h 2008-02-22 00:31:24.000000000 +0200 @@ -521,6 +521,7 @@ #define KEY_VOICEMAIL 0x1ac /* AL Voicemail */ #define KEY_ADDRESSBOOK 0x1ad /* AL Contacts/Address Book */ #define KEY_MESSENGER 0x1ae /* AL Instant Messaging */ +#define KEY_SPELL 0x1af #define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */ #define KEY_DEL_EOL 0x1c0