1SHOWKEY(1)                  General Commands Manual                 SHOWKEY(1)
2
3
4

NAME

6       showkey - examine the codes sent by the keyboard
7

SYNOPSIS

9       showkey [-h|--help] [-a|--ascii] [-s|--scancodes] [-k|--keycodes]
10

DESCRIPTION

12       showkey  prints to standard output either the scan codes or the keycode
13       or the `ascii' code of each key pressed.  In the first  two  modes  the
14       program  runs until 10 seconds have elapsed since the last key press or
15       release event, or until it receives a suitable  signal,  like  SIGTERM,
16       from  another process.  In `ascii' mode the program terminates when the
17       user types ^D.
18
19       When in scancode dump mode, showkey prints in hexadecimal  format  each
20       byte  received  from the keyboard to the standard output. A new line is
21       printed when an interval of about 0.1 seconds occurs between the  bytes
22       received,  or  when  the  internal receive buffer fills up. This can be
23       used to determine roughly, what byte sequences the  keyboard  sends  at
24       once  on  a  given  key  press. The scan code dumping mode is primarily
25       intended for debugging the keyboard driver or other  low  level  inter‐
26       faces.  As  such  it  shouldn't be of much interest to the regular end-
27       user. However, some modern keyboards have keys or buttons that  produce
28       scancodes  to which the kernel does not associate a keycode, and, after
29       finding out what these are, the user can assign keycodes  with  setkey‐
30       codes(8).
31
32       When  in  the default keycode dump mode, showkey prints to the standard
33       output the keycode number or each key pressed or released. The kind  of
34       the  event,  press  or release, is also reported.  Keycodes are numbers
35       assigned by the kernel to each individual physical key. Every  key  has
36       always  only  one associated keycode number, whether the keyboard sends
37       single or multiple scan codes when pressing it. Using showkey  in  this
38       mode,  you can find out what numbers to use in your personalized keymap
39       files.
40
41       When in `ascii' dump mode, showkey prints to the  standard  output  the
42       decimal,  octal, and hexadecimal value(s) of the key pressed, according
43       to he present keymap.
44

OPTIONS

46       -h --help
47              showkey prints to the standard error output its version  number,
48              a compile option and a short usage message, then exits.
49
50       -s --scancodes
51              Starts showkey in scan code dump mode.
52
53       -k --keycodes
54              Starts  showkey  in keycode dump mode. This is the default, when
55              no command line options are present.
56
57       -a --ascii
58              Starts showkey in `ascii' dump mode.
59
60

NOTES

62       The raw scan codes are available only on AT  and  PS/2  keyboards,  and
63       even then they are disabled unless the atkbd.softraw=0 kernel parameter
64       is used.  When the raw scan codes are not available, the kernel uses  a
65       fixed  built-in table to produce scan codes from keycodes.  Thus, setk‐
66       eycodes(8) can affect the output of showkey in scan code dump mode.
67
68

SEE ALSO

70       loadkeys(1), dumpkeys(1), keymaps(5), setkeycodes(8)
71
72
73
74                                  1 Feb 1998                        SHOWKEY(1)
Impressum