]> git.lizzy.rs Git - plan9front.git/blob - sys/src/cmd/nusb/kb/hid.h
kb.c: add curly braces to enable usb mouse nub scrolling
[plan9front.git] / sys / src / cmd / nusb / kb / hid.h
1 /*
2  * USB keyboard/mouse constants
3  */
4 enum {
5
6         Stack = 32 * 1024,
7
8         /* HID class subclass protocol ids */
9         PtrCSP          = 0x020103,     /* mouse.boot.hid */
10         KbdCSP          = 0x010103,     /* keyboard.boot.hid */
11
12         /* Requests */
13         Getreport = 0x01,
14         Setreport = 0x09,
15         Getproto        = 0x03,
16         Setproto        = 0x0b,
17
18         /* protocols for SET_PROTO request */
19         Bootproto       = 0,
20         Reportproto     = 1,
21
22         /* protocols for SET_REPORT request */
23         Reportout = 0x0200,
24 };
25
26 enum {
27         /* keyboard modifier bits */
28         Mlctrl          = 0,
29         Mlshift         = 1,
30         Mlalt           = 2,
31         Mlgui           = 3,
32         Mrctrl          = 4,
33         Mrshift         = 5,
34         Mralt           = 6,
35         Mrgui           = 7,
36
37         /* masks for byte[0] */
38         Mctrl           = 1<<Mlctrl | 1<<Mrctrl,
39         Mshift          = 1<<Mlshift | 1<<Mrshift,
40         Malt            = 1<<Mlalt | 1<<Mralt,
41         Mcompose        = 1<<Mlalt,
42         Maltgr          = 1<<Mralt,
43         Mgui            = 1<<Mlgui | 1<<Mrgui,
44
45         MaxAcc = 3,                     /* max. ptr acceleration */
46         PtrMask= 0xf,                   /* 4 buttons: should allow for more. */
47
48 };
49
50 /*
51  * Plan 9 keyboard driver constants.
52  */
53 enum {
54         /* Scan codes (see kbd.c) */
55         SCesc1          = 0xe0,         /* first of a 2-character sequence */
56         SCesc2          = 0xe1,
57         SClshift                = 0x2a,
58         SCrshift                = 0x36,
59         SCctrl          = 0x1d,
60         SCcompose       = 0x38,
61         Keyup           = 0x80,         /* flag bit */
62         Keymask         = 0x7f,         /* regular scan code bits */
63 };
64
65 int kbmain(Dev *d, int argc, char*argv[]);