Blame docs/man/man1/showkey.1

Packit Service 50ad14
.\" @(#)showkey.1 1.1 980201 aeb
Packit Service 50ad14
.TH SHOWKEY 1 "1 Feb 1998"
Packit Service 50ad14
.SH NAME
Packit Service 50ad14
showkey \- examine the codes sent by the keyboard
Packit Service 50ad14
.SH SYNOPSIS
Packit Service 50ad14
showkey [\-h|\-\-help] [\-a|\-\-ascii] [\-s|\-\-scancodes] [\-k|\-\-keycodes] [\-V|\-\-version]
Packit Service 50ad14
.SH DESCRIPTION
Packit Service 50ad14
.IX "showkey command" "" "\fLshowkey\fR command"  
Packit Service 50ad14
.LP
Packit Service 50ad14
.B showkey
Packit Service 50ad14
prints to standard output either the scan codes or the keycode
Packit Service 50ad14
or the `ascii' code of each key pressed.
Packit Service 50ad14
In the first two modes the program runs until 10 seconds have elapsed
Packit Service 50ad14
since the last key press or release event, or until it receives
Packit Service 50ad14
a suitable signal, like SIGTERM, from another process.
Packit Service 50ad14
In `ascii' mode the program terminates when the user types ^D.
Packit Service 50ad14
.LP
Packit Service 50ad14
When in scancode dump mode, 
Packit Service 50ad14
.B showkey
Packit Service 50ad14
prints in hexadecimal format each byte received from the keyboard to the
Packit Service 50ad14
standard output. A new line is printed when an interval of about 0.1
Packit Service 50ad14
seconds occurs between the bytes received, or when the internal receive
Packit Service 50ad14
buffer fills up. This can be used to determine roughly, what byte
Packit Service 50ad14
sequences the keyboard sends at once on a given key press. The scan code
Packit Service 50ad14
dumping mode is primarily intended for debugging the keyboard driver or
Packit Service 50ad14
other low level interfaces. As such it shouldn't be of much interest to
Packit Service 50ad14
the regular end-user. However, some modern keyboards have keys or buttons
Packit Service 50ad14
that produce scancodes to which the kernel does not associate a keycode,
Packit Service 50ad14
and, after finding out what these are, the user can assign keycodes with
Packit Service 50ad14
.BR setkeycodes (8).
Packit Service 50ad14
.LP
Packit Service 50ad14
When in the default keycode dump mode,
Packit Service 50ad14
.B showkey
Packit Service 50ad14
prints to the standard output the keycode number or each key pressed or
Packit Service 50ad14
released. The kind of the event, press or release, is also reported.
Packit Service 50ad14
Keycodes are numbers assigned by the kernel to each individual physical
Packit Service 50ad14
key. Every key has always only one associated keycode number, whether
Packit Service 50ad14
the keyboard sends single or multiple scan codes when pressing it. Using
Packit Service 50ad14
.B showkey
Packit Service 50ad14
in this mode, you can find out what numbers to use in your personalized
Packit Service 50ad14
keymap files.
Packit Service 50ad14
.LP
Packit Service 50ad14
When in `ascii' dump mode,
Packit Service 50ad14
.B showkey
Packit Service 50ad14
prints to the standard output the decimal, octal, and hexadecimal
Packit Service 50ad14
value(s) of the key pressed, according to he present keymap.
Packit Service 50ad14
.SH OPTIONS
Packit Service 50ad14
.TP
Packit Service 50ad14
\-h \-\-help
Packit Service 50ad14
.B showkey
Packit Service 50ad14
prints to the standard error output its version number, a compile
Packit Service 50ad14
option and a short usage message, then exits.
Packit Service 50ad14
.TP
Packit Service 50ad14
\-s \-\-scancodes
Packit Service 50ad14
Starts
Packit Service 50ad14
.B showkey
Packit Service 50ad14
in scan code dump mode.
Packit Service 50ad14
.TP
Packit Service 50ad14
\-k \-\-keycodes
Packit Service 50ad14
Starts
Packit Service 50ad14
.B showkey
Packit Service 50ad14
in keycode dump mode. This is the default, when no command line options
Packit Service 50ad14
are present.
Packit Service 50ad14
.TP
Packit Service 50ad14
\-a \-\-ascii
Packit Service 50ad14
Starts
Packit Service 50ad14
.B showkey
Packit Service 50ad14
in `ascii' dump mode.
Packit Service 50ad14
.TP
Packit Service 50ad14
\-V \-\-version
Packit Service 50ad14
.B showkey
Packit Service 50ad14
prints version number and exits.
Packit Service 50ad14
.SH "2.6 KERNELS"
Packit Service 50ad14
In 2.6 kernels key codes lie in the range 1-255, instead of 1-127.
Packit Service 50ad14
Key codes larger than 127 are returned as three bytes of which the
Packit Service 50ad14
low order 7 bits are: zero, bits 13-7, and bits 6-0 of the key code.
Packit Service 50ad14
The high order bits are: 0/1 for make/break, 1, 1.
Packit Service 50ad14
.LP
Packit Service 50ad14
In 2.6 kernels raw mode, or scancode mode, is not very raw at all.
Packit Service 50ad14
Scan codes are first translated to key codes, and when scancodes
Packit Service 50ad14
are desired, the key codes are translated back. Various transformations
Packit Service 50ad14
are involved, and there is no guarantee at all that the final result
Packit Service 50ad14
corresponds to what the keyboard hardware did send. So, if you want
Packit Service 50ad14
to know the scan codes sent by various keys it is better to boot a
Packit Service 50ad14
2.4 kernel. Since 2.6.9 there also is the boot option atkbd.softraw=0
Packit Service 50ad14
that tells the 2.6 kernel to return the actual scan codes.
Packit Service 50ad14
.SH "SEE ALSO"
Packit Service 50ad14
.BR loadkeys (1),
Packit Service 50ad14
.BR dumpkeys (1),
Packit Service 50ad14
.BR keymaps (5),
Packit Service 50ad14
.BR setkeycodes (8)