keyboard.h 790 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. /* KF|1, KF|2, ..., KF|0xC is F1, F2, ..., F12 */
  19. Khome= KF|0x0D,
  20. Kup= KF|0x0E,
  21. Kpgup= KF|0x0F,
  22. Kprint= KF|0x10,
  23. Kleft= KF|0x11,
  24. Kright= KF|0x12,
  25. Kdown= 0x80,
  26. Kview= 0x80,
  27. Kpgdown= KF|0x13,
  28. Kins= KF|0x14,
  29. Kend= KF|0x18,
  30. Kalt= KF|0x15,
  31. Kshift= KF|0x16,
  32. Kctl= KF|0x17,
  33. };