logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

showkey.1 (3493B)


  1. .\" @(#)showkey.1 1.1 980201 aeb
  2. .TH SHOWKEY 1 "1 Feb 1998" "kbd"
  3. .SH NAME
  4. showkey \- examine the codes sent by the keyboard
  5. .SH SYNOPSIS
  6. showkey [\-h|\-\-help] [\-a|\-\-ascii] [\-s|\-\-scancodes] [\-k|\-\-keycodes] [\-V|\-\-version]
  7. .SH DESCRIPTION
  8. .IX "showkey command" "" "\fLshowkey\fR command"
  9. .LP
  10. .B showkey
  11. prints to standard output either the scan codes or the keycode
  12. or the `ascii' code of each key pressed.
  13. In the first two modes the program runs until 10 seconds have elapsed
  14. since the last key press or release event, or until it receives
  15. a suitable signal, like SIGTERM, from another process.
  16. In `ascii' mode the program terminates when the user types ^D.
  17. .LP
  18. When in scancode dump mode,
  19. .B showkey
  20. prints in hexadecimal format each byte received from the keyboard to the
  21. standard output. A new line is printed when an interval of about 0.1
  22. seconds occurs between the bytes received, or when the internal receive
  23. buffer fills up. This can be used to determine roughly, what byte
  24. sequences the keyboard sends at once on a given key press. The scan code
  25. dumping mode is primarily intended for debugging the keyboard driver or
  26. other low level interfaces. As such it shouldn't be of much interest to
  27. the regular end-user. However, some modern keyboards have keys or buttons
  28. that produce scancodes to which the kernel does not associate a keycode,
  29. and, after finding out what these are, the user can assign keycodes with
  30. .BR setkeycodes (8).
  31. .LP
  32. When in the default keycode dump mode,
  33. .B showkey
  34. prints to the standard output the keycode number or each key pressed or
  35. released. The kind of the event, press or release, is also reported.
  36. Keycodes are numbers assigned by the kernel to each individual physical
  37. key. Every key has always only one associated keycode number, whether
  38. the keyboard sends single or multiple scan codes when pressing it. Using
  39. .B showkey
  40. in this mode, you can find out what numbers to use in your personalized
  41. keymap files.
  42. .LP
  43. When in `ascii' dump mode,
  44. .B showkey
  45. prints to the standard output the decimal, octal, and hexadecimal
  46. value(s) of the key pressed, according to he present keymap.
  47. .SH OPTIONS
  48. .TP
  49. \-h \-\-help
  50. .B showkey
  51. prints to the standard error output its version number, a compile
  52. option and a short usage message, then exits.
  53. .TP
  54. \-s \-\-scancodes
  55. Starts
  56. .B showkey
  57. in scan code dump mode.
  58. .TP
  59. \-k \-\-keycodes
  60. Starts
  61. .B showkey
  62. in keycode dump mode. This is the default, when no command line options
  63. are present.
  64. .TP
  65. \-a \-\-ascii
  66. Starts
  67. .B showkey
  68. in `ascii' dump mode.
  69. .TP
  70. \-V \-\-version
  71. .B showkey
  72. prints version number and exits.
  73. .SH "2.6 KERNELS"
  74. In 2.6 kernels key codes lie in the range 1-255, instead of 1-127.
  75. Key codes larger than 127 are returned as three bytes of which the
  76. low order 7 bits are: zero, bits 13-7, and bits 6-0 of the key code.
  77. The high order bits are: 0/1 for make/break, 1, 1.
  78. .LP
  79. In 2.6 kernels raw mode, or scancode mode, is not very raw at all.
  80. Scan codes are first translated to key codes, and when scancodes
  81. are desired, the key codes are translated back. Various transformations
  82. are involved, and there is no guarantee at all that the final result
  83. corresponds to what the keyboard hardware did send. So, if you want
  84. to know the scan codes sent by various keys it is better to boot a
  85. 2.4 kernel. Since 2.6.9 there also is the boot option atkbd.softraw=0
  86. that tells the 2.6 kernel to return the actual scan codes.
  87. .SH "SEE ALSO"
  88. .BR loadkeys (1),
  89. .BR dumpkeys (1),
  90. .BR keymaps (5),
  91. .BR setkeycodes (8)