OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.9 KiB

  1. # --- T2-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # T2 SDE: package/.../linux26/96-usb-hid-apple-kbd-mapping.patch
  5. # Copyright (C) 2004 - 2006 The T2 SDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- T2-COPYRIGHT-NOTE-END ---
  16. The Apple USB keyboards carry symbols differing from the on-wire values sent.
  17. So we swap the events here simillar as in the 95-adb-mapping patch.
  18. - Rene Rebe <rene@exactcode.de>
  19. --- linux-2.6.16/drivers/usb/input/hid-input.c 2006-03-20 06:53:29.000000000 +0100
  20. +++ linux-2.6.16/drivers/usb/input/hid-input.c 2006-06-09 14:24:12.000000000 +0200
  21. @@ -256,8 +256,27 @@
  22. set_bit(EV_REP, input->evbit);
  23. if ((usage->hid & HID_USAGE) < 256) {
  24. - if (!hid_keyboard[usage->hid & HID_USAGE]) goto ignore;
  25. - map_key_clear(hid_keyboard[usage->hid & HID_USAGE]);
  26. + unsigned char code = hid_keyboard[usage->hid & HID_USAGE];
  27. + if (!code) goto ignore;
  28. +
  29. + /* Apple? */
  30. + if (input->id.vendor == 0x5ac) {
  31. + /* alt->altgr, lmeta->alt, and no dups
  32. + due Linux meta bit parsing */
  33. + switch (code) {
  34. + case 56: code = 100; break;
  35. + case 125: code = 56; break;
  36. + case 100: code = 127; break;
  37. + }
  38. + /* ISO key exchange */
  39. + if (input->id.product == 0x0215 ||
  40. + input->id.product == 0x0218)
  41. + switch (code) {
  42. + case 41: code = 86; break;
  43. + case 86: code = 41; break;
  44. + }
  45. + }
  46. + map_key_clear(code);
  47. } else
  48. map_key(KEY_UNKNOWN);