File: input.h

package info (click to toggle)
input-utils 1.0-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, sid, stretch
  • size: 380 kB
  • ctags: 1,091
  • sloc: ansic: 1,900; sh: 25; makefile: 6
file content (29 lines) | stat: -rw-r--r-- 770 bytes parent folder | download | duplicates (2)
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);