chiark / gitweb /
keymap: Add Toshiba Satellite U500
[elogind.git] / extras / keymap / README.keymap.txt
1 = The udev keymap tool =
2
3 == Introduction ==
4
5 This udev extension configures computer model specific key mappings. This is
6 particularly necessary for the non-standard extra keys found on many laptops,
7 such as "brightness up", "next song", "www browser", or "suspend". Often these
8 are accessed with the Fn key.
9
10 Every key produces a "scan code", which is highly vendor/model specific for the
11 nonstandard keys. This tool maintains mappings for these scan codes to standard
12 "key codes", which denote the "meaning" of the key. The key codes are defined
13 in /usr/include/linux/input.h.
14
15 If some of your keys on your keyboard are not working at all, or produce the
16 wrong effect, then a very likely cause of this is that the scan code -> key
17 code mapping is incorrect on your computer.
18
19 == Structure ==
20
21 udev-keymap consists of the following parts:
22
23  keymaps/*:: mappings of scan codes to key code names
24    
25  95-keymap.rules:: udev rules for mapping system vendor/product names and
26  input module names to one of the keymaps above
27
28  keymap:: manipulate an evdev input device:
29   * write a key map file into a device (used by udev rules)
30   * dump current scan → key code mapping
31   * interactively display scan and key codes of pressed keys
32
33  findkeyboards:: display evdev input devices which belong to actual keyboards,
34  i. e. those suitable for the keymap program
35
36  fdi2rules.py:: convert hal keymap FDIs into udev rules and key map files
37  (Please note that this is far from perfect, since the mapping between fdi and
38   udev rules is not straightforward, and impossible in some cases.)
39
40 == Fixing broken keys ==
41
42 In order to make a broken key work on your system and send it back to upstream
43 for inclusion you need to do the following steps:
44
45  1. Find the keyboard device.
46
47  Run /lib/udev/findkeyboards. This should always give you an "AT
48  keyboard" and possibly a "module". Some laptops (notably Thinkpads, Sonys, and
49  Acers) have multimedia/function keys on a separate input device instead of the
50  primary keyboard. The keyboard device should have a name like "input/event3".
51  In the following commands, the name will be written as "input/eventX" (replace
52  X with the appropriate number).
53
54  2. Dump current mapping:
55
56  sudo /lib/udev/keymap input/eventX > /tmp/orig-map.txt
57
58  3. Find broken scan codes:
59
60  sudo /lib/udev/keymap -i input/eventX
61
62  Press all multimedia/function keys and check if the key name that gets printed
63  out is plausible. If it is unknown or wrong, write down the scan code (looks
64  like "0x1E") and the intended functionality of this key. Look in
65  /usr/include/linux/input.h for an available KEY_XXXXX constant which most
66  closely approximates this functionality and write it down as the new key code. 
67  
68  For example, you might press a key labeled "web browser" which currently
69  produces "unknown". Note down this:
70
71    0x1E www # Fn+F2 web browser
72
73  Repeat that for all other keys. Write the resulting list into a file. Look at
74  /lib/udev/keymaps/ for existing key map files and make sure that you use the
75  same structure.
76
77  If the key only ever works once and then your keyboard (or the entire desktop)
78  gets stuck for a long time, then it is likely that the BIOS fails to send a
79  corresponding "key release" event after the key press event. Please note down
80  this case as well, as it can be worked around in
81  /lib/udev/keymaps/95-keyboard-force-release.rules .
82
83  4. Find out your system vendor and product:
84
85  cat /sys/class/dmi/id/sys_vendor
86  cat /sys/class/dmi/id/product_name
87
88  5. Generate a device dump with "udevadm info --export-db > /tmp/udev-db.txt".
89
90  6. Send the system vendor/product names, the key mapping from step 3,
91  /tmp/orig-map.txt from step 2, and /tmp/udev-db.txt from step 5
92  to the bug tracker, so that they can be included in the next release:
93
94    https://bugs.launchpad.net/udev/+bugs
95
96 For local testing, copy your map file to /lib/udev/keymaps/ with an appropriate
97 name, and add an appropriate udev rule to /lib/udev/rules.d/95-keymap.rules:
98
99   * If you selected an "AT keyboard", add the rule to the section after
100   'LABEL="keyboard_vendorcheck"'.
101
102   * If you selected a "module", add the rule to the top section where the
103   "ThinkPad Extra Buttons" are.
104
105 == Author ==
106
107 keymap is written and maintained by Martin Pitt <martin.pitt@ubuntu.com>.