chiark / gitweb /
64b6a2bd36573989a7808bc7c16066fbbf3c2d0c
[trains.git] / hostside / hidrawconv-joytechneos.c
1 #include "hidrawconv.h"
2
3 static const KeyBit keybits[]= {
4   { "EV_KEY BTN_1",          6, 0x01 },
5   { "EV_KEY BTN_2",          6, 0x02 },
6   { "EV_KEY BTN_3",          6, 0x04 },
7   { "EV_KEY BTN_4",          6, 0x08 },
8   { "EV_KEY BTN_5",          6, 0x10 },
9   { "EV_KEY BTN_6",          6, 0x20 },
10   { "EV_KEY BTN_THUMBL",     7, 0x01 },
11   { "EV_KEY BTN_THUMBR",     7, 0x02 },
12   { "EV_KEY BTN_TL",         6, 0x40 },
13   { "EV_KEY BTN_TR",         6, 0x80 },
14   { "EV_KEY BTN_TOP2",       7, 0x04 },
15   { "EV_KEY BTN_TOP",        7, 0x08 },
16   { 0 }
17 };
18 static const ValLoc vallocs[]= {
19   { "EV_ABS ABS_X",          1,0,+1, 0xff, 0x80 },
20   { "EV_ABS ABS_Y",          2,0,-1, 0xff, 0x80 },
21   { "EV_ABS ABS_RUDDER",     3,0,+1, 0xff, 0x80 },
22   { "EV_ABS ABS_THROTTLE",   4,0,-1, 0xff, 0x80 },
23 //  { "EV_ABS DPAD",           5,0,+1, 0x0f, 0x00 },
24   { 0 }
25 };
26
27 static void pr(const uint8_t *msg, int msglen, const uint8_t *last) {
28   reportbits(msg, last, msglen, keybits);
29   reportlocs(msg, last, msglen, vallocs);
30 }
31
32 const char *progname= "hidrawconv-joytechneos";
33
34 const char *const descriptor=
35   "05010904a101854a0901a1000501093009311580257f350045ff660000750895028102c0050209ba150026ff00750895018102050209bb150026ff007508950181020501093915012508360000463b016514750895018102950c7501050945013500150025011901290c810295040605ff09018102c005140924a101854d150026ff000931750895079182c005010906a101854b050719e029e71500250175019508810295017508810195057501050819012905910295017503910195057508150025680507190029688100c0";
36
37 ProcessReport *const report_processors[MAXREPORTS]= {
38  [0x4a] = pr
39 };