MAN page from Fedora Other kbd-2.8.0-3.fc43.x86_64.rpm
SETKEYCODES
Section: Maintenance Commands (8)
Updated: 24 October 2024
Index NAME
setkeycodes - load kernel scancode-to-keycode mapping table entries
SYNOPSIS
setkeycodes[
,options/]
scancode keycode ... DESCRIPTION
The
setkeycodescommand reads its arguments two at a time, each pair of argumentsconsisting of a scancode (given in hexadecimal) and a keycode (givenin decimal). For each such pair, it tells the kernel keyboard driverto map the specified scancode to the specified keycode.
This command is useful only for people with slightly unusual keyboards,that have a few keys which produce scancodes that the kernel does notrecognize.
THEORY
The usual PC keyboard produces a series of scancodes for eachkey press and key release. (Scancodes are shown by
showkey -s, see
showkey(1)) The kernel parses this stream of scancodes, and converts it toa stream of keycodes (key press/release events).(Keycodes are shown by
showkey.)Apart from a few scancodes with special meaning, and apart fromthe sequence produced by the Pause key, and apart from shiftstaterelated scancodes, and apart from the key up/down bit,the stream of scancodes consists of unescapedscancodes xx (7 bits) and escaped scancodes e0 xx (8+7 bits).To these scancodes or scancode pairs, a corresponding keycode can beassigned (in the range 1-127).For example, if you have a Macro key that produces e0 6f accordingto
showkey(1),the command
- setkeycodes e06f 112
will assign the keycode 112 to it, and then
loadkeys(1)can be used to define the function of this key.
USB keyboards have standardized keycodes andsetkeycodesdoesn't affect them at all.
Some older kernels might hardwire a low scancode range to theequivalent keycodes; setkeycodes will fail when you try to remapthese.
2.6 KERNELS
In 2.6 kernels key codes lie in the range 1-255, instead of 1-127.(It might be best to confine oneself to the range 1-239.)
In 2.6 kernels raw mode, or scancode mode, is not very raw at all.The code returned by showkey -s will change after use of setkeycodes.A kernel bug. See alsoshowkey(1).
OPTIONS
- -C, --console=,DEV/
- the console device to be used.
- -V, --version
- print version number.
- -h, --help
- print this usage message.
BUGS
The keycodes of X have nothing to do with those of Linux.Unusual keys can be made visible under Linux, but not under X.
setkeycodesaffects only the "first" input devicethat has modifiable scancode-to-keycode mapping.If there is more than one such device,setkeycodescannot change the mapping of other devices than the "first" one.
SEE ALSO
dumpkeys(1),
loadkeys(1),
showkey(1),
getkeycodes(8)
Index
- NAME
- SYNOPSIS
- DESCRIPTION
- THEORY
- 2.6 KERNELS
- OPTIONS
- BUGS
- SEE ALSO
This document was created byman2html,using the manual pages.