fix some gcc warnings
[rofl0r-gnuboy.git] / input.h
blob5b19168115796413e04f24fc9d9681517b6f195b
1 /*
2 * input.h
4 * Definitions for input device stuff - buttons, keys, etc.
5 */
8 #define M_IGNORE 0
9 #define M_RELATIVE 1
10 #define M_ABSOLUTE 2
13 #define K_SHIFT 0x101
14 #define K_CTRL 0x102
15 #define K_ALT 0x103
17 #define K_UP 0x10a
18 #define K_DOWN 0x10b
19 #define K_RIGHT 0x10c
20 #define K_LEFT 0x10d
22 #define K_ENTER '\r'
23 #define K_TAB '\t'
24 #define K_SPACE ' '
25 #define K_BS 010
26 #define K_DEL 127
27 #define K_INS 0x121
28 #define K_HOME 0x122
29 #define K_END 0x123
30 #define K_PRIOR 0x124
31 #define K_NEXT 0x125
32 #define K_ESC 033
33 #define K_SYSRQ 0x1fe
34 #define K_PAUSE 0x1ff
35 #define K_CAPS 0x1f1
36 #define K_NUMLOCK 0x1f2
37 #define K_SCROLL 0x1f3
39 #define K_MINUS '-'
40 #define K_EQUALS '='
41 #define K_TILDE '~'
42 #define K_SLASH '/'
43 #define K_BSLASH '\\'
44 #define K_SEMI ';'
45 #define K_QUOTE '\''
47 #define K_F1 0x131
48 #define K_F2 0x132
49 #define K_F3 0x133
50 #define K_F4 0x134
51 #define K_F5 0x135
52 #define K_F6 0x136
53 #define K_F7 0x137
54 #define K_F8 0x138
55 #define K_F9 0x139
56 #define K_F10 0x13a
57 #define K_F11 0x13b
58 #define K_F12 0x13c
60 #define K_NUM0 0x140
61 #define K_NUM1 0x141
62 #define K_NUM2 0x142
63 #define K_NUM3 0x143
64 #define K_NUM4 0x144
65 #define K_NUM5 0x145
66 #define K_NUM6 0x146
67 #define K_NUM7 0x147
68 #define K_NUM8 0x148
69 #define K_NUM9 0x149
70 #define K_NUMPLUS 0x14a
71 #define K_NUMMINUS 0x14b
72 #define K_NUMMUL 0x14c
73 #define K_NUMDIV 0x14d
74 #define K_NUMDOT 0x14e
75 #define K_NUMENTER 0x14f
77 #define K_MOUSE0 0x1a0
78 #define K_MOUSE1 0x1a1
79 #define K_MOUSE2 0x1a2
80 #define K_MOUSE3 0x1a3
81 #define K_MOUSE4 0x1a4
83 #define K_JOY0 0x1b0
84 #define K_JOY1 0x1b1
85 #define K_JOY2 0x1b2
86 #define K_JOY3 0x1b3
87 #define K_JOY4 0x1b4
88 #define K_JOY5 0x1b5
89 #define K_JOY6 0x1b6
90 #define K_JOY7 0x1b7
91 #define K_JOY8 0x1b8
92 #define K_JOY9 0x1b9
93 #define K_JOY10 0x1ba
94 #define K_JOY11 0x1bb
95 #define K_JOY12 0x1bc
96 #define K_JOY13 0x1bd
97 #define K_JOY14 0x1be
98 #define K_JOY15 0x1bf
100 #define K_JOYUP 0x1ca
101 #define K_JOYDOWN 0x1cb
102 #define K_JOYRIGHT 0x1cc
103 #define K_JOYLEFT 0x1cd
105 #define MAX_KEYS 0x200
107 typedef struct keytable_s
109 char *name;
110 int code;
111 } keytable_t;
113 extern keytable_t keytable[];
114 extern char keystates[MAX_KEYS];
115 extern int nkeysdown;
118 int k_keycode(char *name);
119 char *k_keyname(int code);
123 typedef struct event_s
125 int type;
126 int code;
127 int dx, dy;
128 int x, y;
129 } event_t;
131 #define EV_NONE 0
132 #define EV_PRESS 1
133 #define EV_RELEASE 2
134 #define EV_REPEAT 3
135 #define EV_MOUSE 4
137 int ev_postevent(event_t *ev);
138 int ev_getevent(event_t *ev);