1
0

kbdputc 1015 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. .TH KBDPUTC 9
  2. .SH NAME
  3. kbdputc, kbdq \- keyboard interface to \fIcons\fP(3)
  4. .SH SYNOPSIS
  5. .ta \w'\f5extern\ \ \f1'u
  6. .B
  7. .B
  8. void kbdputc(Queue *q, int c)
  9. .PP
  10. .B
  11. extern Queue *kbdq;
  12. .SH DESCRIPTION
  13. This is the internal interface between
  14. .IR cons (3)
  15. and the platform-dependent keyboard driver.
  16. Before calling any of these functions,
  17. the global variable
  18. .B kbdq
  19. must be initialised;
  20. .IR cons (3)
  21. does not initialise it.
  22. This is usually done during system initialisation by the keyboard driver's
  23. .I kbdinit
  24. or
  25. .I kbdenable
  26. function ,
  27. as follows:
  28. .IP
  29. .EX
  30. kbdq = qopen(4*1024, 0, 0, 0);
  31. qnoblock(kbdq, 1);
  32. .EE
  33. .PP
  34. .I Kbdputc
  35. puts a 16-bit Unicode character
  36. .I c
  37. (ie, a `rune')
  38. on the given
  39. .IR q ,
  40. as a sequence of bytes in UTF-8 encoding
  41. (see
  42. .IR utf (6)).
  43. It is up to the platform's keyboard driver to map a physical keyboard character,
  44. or a combination of them (for instance, following
  45. .IR keyboard (6))
  46. to a given Unicode character.
  47. .SH SOURCE
  48. .B /sys/src/9/*/kbd*.c
  49. .SH SEE ALSO
  50. .IR cons (3),
  51. .IR utf (6),
  52. .IR qio (9)