-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinput.h
More file actions
40 lines (30 loc) · 742 Bytes
/
input.h
File metadata and controls
40 lines (30 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef INPUT_H_
#define INPUT_H_
#define TKEY_LEFT 1
#define TKEY_RIGHT 2
#define TKEY_UP 4
#define TKEY_DOWN 8
#define TKEY_BUTTON 16
#define TKEY_DROP TKEY_DOWN
#define TKEY_ROTATE TKEY_BUTTON
extern unsigned char usejoysticks;
extern unsigned char numjoysticks;
extern unsigned char lastkey;
#if !defined (NO2DIMARRAYS)
extern const unsigned char joykeys[8][4];
#else
extern const unsigned char joykeys[8 * 4];
#endif
#if !defined (NOKEYBOARD)
unsigned char poll_key(unsigned char n);
#else
#define poll_key(x) 0
#endif
void init_joy(void);
#if !defined (NOJOYSTICKS)
unsigned char poll_joy(unsigned char n);
#endif
void poll_controller(void);
unsigned char keypressed(void);
void flushkeys(void);
#endif // INPUT_H_