local navigation
[oftp] / src / input.h
1 #ifndef INPUT_H_
2 #define INPUT_H_
3
4 enum {
5         KB_DEL = 128,
6         KB_INS,
7         KB_UP,
8         KB_DOWN,
9         KB_LEFT,
10         KB_RIGHT,
11         KB_HOME,
12         KB_END,
13         KB_PGUP,
14         KB_PGDN,
15
16         KB_F1,
17         KB_F2,
18         KB_F3,
19         KB_F4,
20         KB_F5,
21         KB_F6,
22         KB_F7,
23         KB_F8,
24         KB_F9,
25         KB_F10,
26         KB_F11,
27         KB_F12
28 };
29
30 enum {
31         EV_KEY,
32         EV_MMOVE,
33         EV_MBUTTON
34 };
35
36 struct event_key {
37         int type;
38         int key;
39 };
40
41 struct event_mmove {
42         int type;
43         int x, y;
44 };
45
46 struct event_mbutton {
47         int type;
48         int x, y, bn, press;
49 };
50
51 union event {
52         int type;
53         struct event_key key;
54         struct event_mmove mmove;
55         struct event_mbutton mbutton;
56 };
57
58
59 int init_input(void);
60 void cleanup_input(void);
61
62 int poll_input(union event *ev);
63 int have_input(void);
64
65 #endif  /* INPUT_H_ */