forked from Tasssadar/multirom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
input.h
55 lines (43 loc) · 945 Bytes
/
input.h
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef INPUT_H
#define INPUT_H
#include <sys/time.h>
#define KEY_VOLUMEUP 115
#define KEY_VOLUMEDOWN 114
#define KEY_POWER 116
enum
{
TCHNG_POS = 0x01,
//TCHNG_PRESSURE = 0x02, // unused
TCHNG_ADDED = 0x04,
TCHNG_REMOVED = 0x08
};
enum
{
HANDLERS_FIRST = 0,
HANDLERS_ALL = 1
};
typedef struct
{
int id;
int x;
int y;
int changed;
struct timeval time;
int64_t us_diff;
} touch_event;
typedef int (*touch_callback)(touch_event*, void*); // event, data
typedef struct
{
void *data;
touch_callback callback;
} touch_handler;
void start_input_thread(void);
void stop_input_thread(void);
int get_last_key(void);
int wait_for_key(void);
void add_touch_handler(touch_callback callback, void *data);
void rm_touch_handler(touch_callback callback, void *data);
void set_touch_handlers_mode(int mode);
void input_push_context(void);
void input_pop_context(void);
#endif