kbmap 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 or as
  49. .BI M n
  50. to represent a mouse button.
  51. .PP
  52. The map
  53. .B /sys/lib/kbmap/mouse-fn
  54. maps the F1, F2, and F3 keys to the three mouse buttons.
  55. Similarly,
  56. .B mouse-csa
  57. maps the left Control, Start, and Alt keys to the three mouse buttons.
  58. These maps are useful on laptops without three-button mice.
  59. .SH "SEE ALSO"
  60. .IR cons (3),
  61. .IR keyboard (6),
  62. .IR utf (6)
  63. .SH FILES
  64. .B /sys/lib/kbmap/*
  65. .SH SOURCE
  66. .B /sys/src/9/port/devkbmap.c