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