keyboard.h 865 B

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