-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinput.h
More file actions
29 lines (21 loc) · 770 Bytes
/
input.h
File metadata and controls
29 lines (21 loc) · 770 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
#include <inttypes.h>
#include <sys/ioctl.h>
#include "linux-input.h"
#define ev_name(code) ((code) < EV_MAX && EV_NAME[code] ? EV_NAME[code] : "???")
#define ev_type_name(type, code) ((code) < EV_TYPE_MAX[type] && EV_TYPE_NAME[type][code] ? EV_TYPE_NAME[type][code] : "???")
#define BITFIELD uint32_t
extern char *EV_NAME[EV_CNT];
extern int EV_TYPE_MAX[EV_CNT];
extern char **EV_TYPE_NAME[EV_CNT];
extern char *BUS_NAME[];
static __inline__ int test_bit(int nr, BITFIELD * addr)
{
BITFIELD mask;
addr += nr >> 5;
mask = 1 << (nr & 0x1f);
return ((mask & *addr) != 0);
}
/* ------------------------------------------------------------------ */
int device_open(int nr, int verbose);
void device_info(int fd);
void print_event(struct input_event *event);