Tachyon (current)  Current Main Branch
eventio.h
Go to the documentation of this file.
1 /*
2  * eventio.h - Input device event I/O for modern Linux kernels,
3  * for joysticks and other input devices connected by
4  * hot-plug USB and Bluetooth interfaces
5  *
6  * (C) Copyright 1994-2022 John E. Stone
7  * SPDX-License-Identifier: BSD-3-Clause
8  *
9  * $Id: eventio.h,v 1.3 2022/02/18 18:18:36 johns Exp $
10  *
11  */
12 
13 #ifndef EVENTIO_INC
14 #define EVENTIO_INC 1
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 #define EVENTIO_SUCCESS 0
21 #define EVENTIO_ERROR -1
22 
23 #define EVENTIO_BACK 0x0001
24 #define EVENTIO_TASK 0x0002
25 #define EVENTIO_START 0x0004
26 #define EVENTIO_UNUSED08 0x0008
27 
28 #define EVENTIO_UNUSED10 0x0010
29 #define EVENTIO_UNUSED20 0x0020
30 #define EVENTIO_UNUSED40 0x0040
31 #define EVENTIO_UNUSED80 0x0080
32 
33 #define EVENTIO_GAMEPAD_A 0x0100
34 #define EVENTIO_GAMEPAD_B 0x0200
35 #define EVENTIO_GAMEPAD_X 0x0400
36 #define EVENTIO_GAMEPAD_Y 0x0800
37 
38 #define EVENTIO_TL 0x1000
39 #define EVENTIO_TR 0x2000
40 #define EVENTIO_THUMBL 0x4000
41 #define EVENTIO_THUMBR 0x8000
42 
43 #define EVENTIO_JOYSTICK_STD 0x01
44 #define EVENTIO_JOYSTICK_LOGIF310 0x02
45 #define EVENTIO_JOYSTICK_NYKO 0x04
46 
47 #define EVENTIO_SPACEBALL_STD 0x01
48 
49 typedef void * evio_handle;
50 evio_handle evio_open(const char *devpath);
54 int evio_get_joystick_status(evio_handle, float *abs_x1, float *abs_y1,
55  float *abs_x2, float *abs_y2, int *buttons);
56 
57 #ifdef __cplusplus
58 }
59 #endif
60 
61 #endif
62 
63 
int evio_get_joystick_status(evio_handle, float *abs_x1, float *abs_y1, float *abs_x2, float *abs_y2, int *buttons)
Definition: eventio.c:300
int evio_is_joystick(evio_handle)
int evio_print_devinfo(evio_handle)
Definition: eventio.c:467
int evio_close(evio_handle)
Definition: eventio.c:172
evio_handle evio_open(const char *devpath)
Definition: eventio.c:96
void * evio_handle
Definition: eventio.h:49