hid.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * USB keyboard/mouse constants
  3. */
  4. enum {
  5. /* HID class subclass protocol ids */
  6. PtrCSP = 0x020103, /* mouse.boot.hid */
  7. KbdCSP = 0x010103, /* keyboard.boot.hid */
  8. /* Requests */
  9. SET_PROTO = 0x0b,
  10. /* protocols for SET_PROTO request */
  11. BOOT_PROTO = 0,
  12. REPORT_PROTO = 1,
  13. };
  14. enum {
  15. /* keyboard modifier bits */
  16. Mlctrl= 0,
  17. Mlshift= 1,
  18. Mlalt= 2,
  19. Mlgui= 3,
  20. Mrctrl= 4,
  21. Mrshift= 5,
  22. Mralt= 6,
  23. Mrgui= 7,
  24. /* masks for byte[0] */
  25. Mctrl= 1<<Mlctrl | 1<<Mrctrl,
  26. Mshift= 1<<Mlshift | 1<<Mrshift,
  27. Malt= 1<<Mlalt | 1<<Mralt,
  28. Mcompose= 1<<Mlalt,
  29. Maltgr= 1<<Mralt,
  30. Mgui= 1<<Mlgui | 1<<Mrgui,
  31. MaxAcc = 3, /* max. ptr acceleration */
  32. PtrMask= 0xf, /* 4 buttons: should allow for more. */
  33. Awakemsg=0xdeaddead,
  34. };
  35. /*
  36. * Plan 9 keyboard driver constants.
  37. */
  38. enum {
  39. /* Scan codes (see kbd.c) */
  40. SCesc1= 0xe0, /* first of a 2-character sequence */
  41. SCesc2= 0xe1,
  42. SClshift= 0x2a,
  43. SCrshift= 0x36,
  44. SCctrl= 0x1d,
  45. SCcompose= 0x38,
  46. Keyup= 0x80, /* flag bit */
  47. Keymask= 0x7f, /* regular scan code bits */
  48. };
  49. extern int hdebug;