diff -uNr linux-2.6.16-hardened-r10.orig/drivers/usb/input/hid-debug.h linux-2.6.16-hardened-r10/drivers/usb/input/hid-debug.h --- linux-2.6.16-hardened-r10.orig/drivers/usb/input/hid-debug.h 2006-07-15 05:27:29.000000000 +0300 +++ linux-2.6.16-hardened-r10/drivers/usb/input/hid-debug.h 2006-07-15 18:07:37.000000000 +0300 @@ -675,7 +675,10 @@ [KEY_SLOW] = "Slow", [KEY_SHUFFLE] = "Shuffle", [KEY_BREAK] = "Break", [KEY_PREVIOUS] = "Previous", [KEY_DIGITS] = "Digits", [KEY_TEEN] = "TEEN", - [KEY_TWEN] = "TWEN", [KEY_DEL_EOL] = "DeleteEOL", + [KEY_TWEN] = "TWEN", + [KEY_ZOOMPLUS] = "ZoomPlus", [KEY_ZOOMMINUS] = "ZoomMinus", + [KEY_SPELL] = "Spell", + [KEY_DEL_EOL] = "DeleteEOL", [KEY_DEL_EOS] = "DeleteEOS", [KEY_INS_LINE] = "InsertLine", [KEY_DEL_LINE] = "DeleteLine", [KEY_SEND] = "Send", [KEY_REPLY] = "Reply", diff -uNr linux-2.6.16-hardened-r10.orig/drivers/usb/input/hid-input.c linux-2.6.16-hardened-r10/drivers/usb/input/hid-input.c --- linux-2.6.16-hardened-r10.orig/drivers/usb/input/hid-input.c 2006-07-15 05:27:29.000000000 +0300 +++ linux-2.6.16-hardened-r10/drivers/usb/input/hid-input.c 2006-07-15 18:14:14.000000000 +0300 @@ -51,7 +51,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, @@ -426,12 +426,16 @@ 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; case 0x183: map_key_clear(KEY_CONFIG); break; case 0x18a: map_key_clear(KEY_MAIL); break; case 0x192: map_key_clear(KEY_CALC); break; case 0x194: map_key_clear(KEY_FILE); break; case 0x1a7: map_key_clear(KEY_DOCUMENTS); break; + case 0x1ab: map_key_clear(KEY_SPELL); break; case 0x201: map_key_clear(KEY_NEW); break; + case 0x202: map_key_clear(KEY_OPEN); break; + case 0x203: map_key_clear(KEY_CLOSE); break; case 0x207: map_key_clear(KEY_SAVE); break; case 0x208: map_key_clear(KEY_PRINT); break; case 0x209: map_key_clear(KEY_PROPS); break; @@ -446,6 +450,8 @@ case 0x226: map_key_clear(KEY_STOP); break; case 0x227: map_key_clear(KEY_REFRESH); break; case 0x22a: map_key_clear(KEY_BOOKMARKS); break; + case 0x22d: map_key_clear(KEY_ZOOMPLUS); break; + case 0x22e: map_key_clear(KEY_ZOOMMINUS); break; case 0x233: map_key_clear(KEY_SCROLLUP); break; case 0x234: map_key_clear(KEY_SCROLLDOWN); break; case 0x238: map_rel(REL_HWHEEL); break; @@ -483,8 +489,23 @@ } break; - case HID_UP_MSVENDOR: - goto ignore; + case HID_UP_MSVENDOR: /* Reported on MS Natural Ergonomic 4000 USB keyboard */ + + 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; + } + break; case HID_UP_CUSTOM: /* Reported on Logitech and Powerbook USB keyboards */ @@ -655,6 +676,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==418) 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.16-hardened-r10.orig/drivers/usb/input/usbkbd.c linux-2.6.16-hardened-r10/drivers/usb/input/usbkbd.c --- linux-2.6.16-hardened-r10.orig/drivers/usb/input/usbkbd.c 2006-07-15 05:27:29.000000000 +0300 +++ linux-2.6.16-hardened-r10/drivers/usb/input/usbkbd.c 2006-07-15 18:07:37.000000000 +0300 @@ -58,7 +58,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.16-hardened-r10.orig/include/linux/input.h linux-2.6.16-hardened-r10/include/linux/input.h --- linux-2.6.16-hardened-r10.orig/include/linux/input.h 2006-07-15 05:27:29.000000000 +0300 +++ linux-2.6.16-hardened-r10/include/linux/input.h 2006-07-15 18:07:37.000000000 +0300 @@ -483,6 +483,10 @@ #define KEY_TEEN 0x19e #define KEY_TWEN 0x19f +#define KEY_ZOOMPLUS 0x1a0 +#define KEY_ZOOMMINUS 0x1a1 +#define KEY_SPELL 0x1a2 + #define KEY_DEL_EOL 0x1c0 #define KEY_DEL_EOS 0x1c1 #define KEY_INS_LINE 0x1c2