keyboard.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. typedef struct Keyboardctl Keyboardctl;
  10. typedef struct Channel Channel;
  11. struct Keyboardctl
  12. {
  13. Channel *c; /* chan(Rune)[20] */
  14. char *file;
  15. int consfd; /* to cons file */
  16. int ctlfd; /* to ctl file */
  17. int pid; /* of slave proc */
  18. };
  19. extern Keyboardctl* initkeyboard(char*);
  20. extern int ctlkeyboard(Keyboardctl*, char*);
  21. extern void closekeyboard(Keyboardctl*);
  22. enum {
  23. KF= 0xF000, /* Rune: beginning of private Unicode space */
  24. Spec= 0xF800,
  25. /* KF|1, KF|2, ..., KF|0xC is F1, F2, ..., F12 */
  26. Khome= KF|0x0D,
  27. Kup= KF|0x0E,
  28. Kpgup= KF|0x0F,
  29. Kprint= KF|0x10,
  30. Kleft= KF|0x11,
  31. Kright= KF|0x12,
  32. Kdown= Spec|0x00,
  33. Kview= Spec|0x00,
  34. Kpgdown= KF|0x13,
  35. Kins= KF|0x14,
  36. Kend= KF|0x18,
  37. Kalt= KF|0x15,
  38. Kshift= KF|0x16,
  39. Kctl= KF|0x17,
  40. Kbs= 0x08,
  41. Kdel= 0x7f,
  42. Kesc= 0x1b,
  43. Keof= 0x04,
  44. };