1SETKEYCODES(8)                 Keyboard Support                 SETKEYCODES(8)
2
3
4

NAME

6       setkeycodes - load kernel scancode-to-keycode mapping table entries
7

SYNOPSIS

9       setkeycodes scancode keycode ...
10

DESCRIPTION

12       The setkeycodes command reads its arguments two at a time, each pair of
13       arguments consisting of a scancode (given in hexadecimal) and a keycode
14       (given  in  decimal).  For each such pair, it tells the kernel keyboard
15       driver to map the specified scancode to the specified keycode.
16
17       This command is useful only for people with slightly unusual keyboards,
18       that  have  a few keys which produce scancodes that the kernel does not
19       recognize.
20
21

THEORY

23       The usual PC keyboard produces a series of scancodes for each key press
24       and  key  release. (Scancodes are shown by showkey -s, see showkey(1).)
25       The kernel parses this stream of scancodes, and converts it to a stream
26       of  keycodes  (key  press/release  events).   (Keycodes  are  shown  by
27       showkey.)  Apart from a few scancodes with special meaning,  and  apart
28       from  the sequence produced by the Pause key, and apart from shiftstate
29       related scancodes, and apart from the key up/down bit,  the  stream  of
30       scancodes consists of unescaped scancodes xx (7 bits) and escaped scan‐
31       codes e0 xx (8+7 bits).  It is hardwired in the current kernel that  in
32       the  range  1-88 (0x01-0x58) keycode equals scancode. For the remaining
33       scancodes (0x59-0x7f) or scancode pairs (0xe0 0x00 - 0xe0 0x7f) a  cor‐
34       responding  keycode can be assigned (in the range 1-127).  For example,
35       if you have a Macro key that produces e0 6f  according  to  showkey(1),
36       the command
37              setkeycodes e06f 112
38       will  assign the keycode 112 to it, and then loadkeys(1) can be used to
39       define the function of this key.
40
41       USB keyboards have standardized keycodes and setkeycodes doesn't affect
42       them at all.
43
44

2.6 KERNELS

46       In 2.6 kernels key codes lie in the range 1-255, instead of 1-127.  (It
47       might be best to confine oneself to the range 1-239.)
48
49       In 2.6 kernels raw mode, or scancode mode, is not very raw at all.  The
50       code  returned  by  showkey -s will change after use of setkeycodes.  A
51       kernel bug. See also showkey(1).
52

OPTIONS

54       None.
55

BUGS

57       The keycodes of X have nothing to do with those of Linux.  Unusual keys
58       can be made visible under Linux, but not under X.
59
60       setkeycodes  affects  only the "first" input device that has modifiable
61       scancode-to-keycode mapping.  If there is more than  one  such  device,
62       setkeycodes cannot change the mapping of other devices than the "first"
63       one.
64
65

SEE ALSO

67       dumpkeys (1), loadkeys (1), showkey (1), getkeycodes (8)
68
69
70
71
72
73Local                             8 Nov 1994                    SETKEYCODES(8)
Impressum