1SETKEYCODES(8)              System Manager's Manual             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).  To these scancodes or scancode pairs, a corre‐
32       sponding keycode can be assigned (in the range 1-127).  For example, if
33       you have a Macro key that produces e0 6f according to  showkey(1),  the
34       command
35              setkeycodes e06f 112
36       will  assign the keycode 112 to it, and then loadkeys(1) can be used to
37       define the function of this key.
38
39       USB keyboards have standardized keycodes and setkeycodes doesn't affect
40       them at all.
41
42       Some  older  kernels might hardwire a low scancode range to the equiva‐
43       lent keycodes; setkeycodes will fail when you try to remap these.
44
45

2.6 KERNELS

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

OPTIONS

55       None.
56

BUGS

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

SEE ALSO

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