1
0

kbmap 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. .TH KBMAP 3
  2. .SH NAME
  3. kbmap \- keyboard map
  4. .SH SYNOPSIS
  5. .nf
  6. .B bind -a #κ /dev
  7. .B /dev/kbmap
  8. .fi
  9. .SH DESCRIPTION
  10. .PP
  11. The
  12. .I kbmap
  13. device serves a one-level directory containing a single file,
  14. .BR kbmap ,
  15. representing the kernel's mapping of
  16. keyboard scan codes to Unicode characters
  17. (see
  18. .IR cons (3)
  19. and
  20. .IR keyboard (6)).
  21. .PP
  22. Reads return the current contents of the map.
  23. Each entry is one line containing three 11 character numeric fields, each followed by a space:
  24. a table number, an index into the table (scan code), and the decimal value
  25. of the corresponding Unicode character (0 if none).
  26. The table numbers are platform dependent; they typically distinguish
  27. between unshifted and shifted keys.
  28. The scan code values are hardware dependent and can vary
  29. from keyboard to keyboard.
  30. .PP
  31. Writes to the file change the map.
  32. Lines written to the file must contain three space-separated fields,
  33. representing the table number, scan code index, and Unicode character.
  34. Values are taken to be decimal unless they start with
  35. .B 0x
  36. (hexadecimal) or
  37. .B 0
  38. (octal).
  39. The Unicode character can also be represented as
  40. .BI ' x
  41. where
  42. .I x
  43. gives the UTF-8 representation of the character
  44. (see
  45. .IR utf (6)),
  46. or as
  47. .BI ^ X
  48. to represent a control character.
  49. .PP
  50. The Unicode character can also be
  51. .BI M n
  52. to represent mouse button
  53. .IR n .
  54. The map
  55. .B /sys/lib/kbmap/mouse-fn
  56. maps the F1 through F5 keys to the three mouse buttons and the two
  57. scroll wheel buttons.
  58. Similarly,
  59. .B mouse-csa
  60. maps the left Control, Start, and Alt keys to the three mouse buttons.
  61. These maps are useful on laptops without three-button mice.
  62. .SH "SEE ALSO"
  63. .IR cons (3),
  64. .IR keyboard (6),
  65. .IR utf (6)
  66. .SH FILES
  67. .B /sys/lib/kbmap/*
  68. .SH SOURCE
  69. .B /sys/src/9/port/devkbmap.c