blob: f6993f5fe4ea0e5b4d6e54c2b7683e29c4fde99d (
plain)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
#ifndef _HID_H
#define _HID_H
#include <m_pd.h>
#include "hid.h"
static char *version = "$Revision: 1.3 $";
/*------------------------------------------------------------------------------
* CLASS DEF
*/
static t_class *hid_class;
typedef struct _hid
{
t_object x_obj;
t_int x_fd;
t_symbol *x_devname;
t_clock *x_clock;
t_int x_read_ok;
t_int x_started;
t_int x_delay;
t_int x_vendorID;
t_int x_productID;
t_int x_locID;
} t_hid;
/*------------------------------------------------------------------------------
* GLOBALS
*/
char *deviceList[64];
char *typeList[256];
char *codeList[256];
/*------------------------------------------------------------------------------
* FUNCTION PROTOTYPES FOR DIFFERENT PLATFORMS
*/
#ifdef __linux__
void releaseDevices(void);
void buildDeviceList(void);
void buildTypeList(void);
#endif
#ifdef __APPLE__
void releaseHIDDevices(void);
int prHIDBuildElementList(void);
int prHIDBuildDeviceList(void);
int prHIDGetValue(void);
void PushQueueEvents_RawValue(void);
void PushQueueEvents_CalibratedValue(void);
int prHIDReleaseDeviceList(void);
int prHIDRunEventLoop(void);
int prHIDQueueDevice(void);
int prHIDQueueElement(void);
int prHIDDequeueElement(void);
int prHIDDequeueDevice(void);
int prHIDStopEventLoop(void);
#endif /* #ifdef __APPLE__ */
#endif /* #ifndef _HID_H */
|