keyboard.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. #pragma src "/sys/src/libdraw"
  10. #pragma lib "libdraw.a"
  11. typedef struct Keyboardctl Keyboardctl;
  12. typedef struct Channel Channel;
  13. struct Keyboardctl
  14. {
  15. Channel *c; /* chan(Rune)[20] */
  16. char *file;
  17. int consfd; /* to cons file */
  18. int ctlfd; /* to ctl file */
  19. int pid; /* of slave proc */
  20. };
  21. extern Keyboardctl* initkeyboard(char*);
  22. extern int ctlkeyboard(Keyboardctl*, char*);
  23. extern void closekeyboard(Keyboardctl*);
  24. enum {
  25. KF= 0xF000, /* Rune: beginning of private Unicode space */
  26. Spec= 0xF800,
  27. /* KF|1, KF|2, ..., KF|0xC is F1, F2, ..., F12 */
  28. Khome= KF|0x0D,
  29. Kup= KF|0x0E,
  30. Kpgup= KF|0x0F,
  31. Kprint= KF|0x10,
  32. Kleft= KF|0x11,
  33. Kright= KF|0x12,
  34. Kdown= Spec|0x00,
  35. Kview= Spec|0x00,
  36. Kpgdown= KF|0x13,
  37. Kins= KF|0x14,
  38. Kend= KF|0x18,
  39. Kalt= KF|0x15,
  40. Kshift= KF|0x16,
  41. Kctl= KF|0x17,
  42. Kbs= 0x08,
  43. Kdel= 0x7f,
  44. Kesc= 0x1b,
  45. Keof= 0x04,
  46. };