145 lines
4.6 KiB
HTML
145 lines
4.6 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of SHOWKEY</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>SHOWKEY</H1>
|
|
Section: User Commands (1)<BR>Updated: 1 Feb 1998<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
showkey - examine the codes sent by the keyboard
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
showkey [-h|--help] [-a|--ascii] [-s|--scancodes] [-k|--keycodes] [-V|--version]
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<P>
|
|
|
|
<B>showkey</B>
|
|
|
|
prints to standard output either the scan codes or the keycode
|
|
or the `ascii' code of each key pressed.
|
|
In the first two modes the program runs until 10 seconds have elapsed
|
|
since the last key press or release event, or until it receives
|
|
a suitable signal, like SIGTERM, from another process.
|
|
In `ascii' mode the program terminates when the user types ^D.
|
|
<P>
|
|
|
|
When in scancode dump mode,
|
|
<B>showkey</B>
|
|
|
|
prints in hexadecimal format each byte received from the keyboard to the
|
|
standard output. A new line is printed when an interval of about 0.1
|
|
seconds occurs between the bytes received, or when the internal receive
|
|
buffer fills up. This can be used to determine roughly, what byte
|
|
sequences the keyboard sends at once on a given key press. The scan code
|
|
dumping mode is primarily intended for debugging the keyboard driver or
|
|
other low level interfaces. As such it shouldn't be of much interest to
|
|
the regular end-user. However, some modern keyboards have keys or buttons
|
|
that produce scancodes to which the kernel does not associate a keycode,
|
|
and, after finding out what these are, the user can assign keycodes with
|
|
<B><A HREF="/cgi-bin/man/man2html?8+setkeycodes">setkeycodes</A></B>(8).
|
|
|
|
<P>
|
|
|
|
When in the default keycode dump mode,
|
|
<B>showkey</B>
|
|
|
|
prints to the standard output the keycode number or each key pressed or
|
|
released. The kind of the event, press or release, is also reported.
|
|
Keycodes are numbers assigned by the kernel to each individual physical
|
|
key. Every key has always only one associated keycode number, whether
|
|
the keyboard sends single or multiple scan codes when pressing it. Using
|
|
<B>showkey</B>
|
|
|
|
in this mode, you can find out what numbers to use in your personalized
|
|
keymap files.
|
|
<P>
|
|
|
|
When in `ascii' dump mode,
|
|
<B>showkey</B>
|
|
|
|
prints to the standard output the decimal, octal, and hexadecimal
|
|
value(s) of the key pressed, according to he present keymap.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="1">-h --help<DD>
|
|
<B>showkey</B>
|
|
|
|
prints to the standard error output its version number, a compile
|
|
option and a short usage message, then exits.
|
|
<DT id="2">-s --scancodes<DD>
|
|
Starts
|
|
<B>showkey</B>
|
|
|
|
in scan code dump mode.
|
|
<DT id="3">-k --keycodes<DD>
|
|
Starts
|
|
<B>showkey</B>
|
|
|
|
in keycode dump mode. This is the default, when no command line options
|
|
are present.
|
|
<DT id="4">-a --ascii<DD>
|
|
Starts
|
|
<B>showkey</B>
|
|
|
|
in `ascii' dump mode.
|
|
<DT id="5">-V --version<DD>
|
|
<B>showkey</B>
|
|
|
|
prints version number and exits.
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>2.6 KERNELS</H2>
|
|
|
|
In 2.6 kernels key codes lie in the range 1-255, instead of 1-127.
|
|
Key codes larger than 127 are returned as three bytes of which the
|
|
low order 7 bits are: zero, bits 13-7, and bits 6-0 of the key code.
|
|
The high order bits are: 0/1 for make/break, 1, 1.
|
|
<P>
|
|
|
|
In 2.6 kernels raw mode, or scancode mode, is not very raw at all.
|
|
Scan codes are first translated to key codes, and when scancodes
|
|
are desired, the key codes are translated back. Various transformations
|
|
are involved, and there is no guarantee at all that the final result
|
|
corresponds to what the keyboard hardware did send. So, if you want
|
|
to know the scan codes sent by various keys it is better to boot a
|
|
2.4 kernel. Since 2.6.9 there also is the boot option atkbd.softraw=0
|
|
that tells the 2.6 kernel to return the actual scan codes.
|
|
<A NAME="lbAG"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+loadkeys">loadkeys</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+dumpkeys">dumpkeys</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?5+keymaps">keymaps</A></B>(5),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+setkeycodes">setkeycodes</A></B>(8)
|
|
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="6"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="7"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="8"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="9"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="10"><A HREF="#lbAF">2.6 KERNELS</A><DD>
|
|
<DT id="11"><A HREF="#lbAG">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:27 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|