chiark / gitweb /
5ad96fed3b60e1f0cc9519c4f57a5f4b24ce3ad5
[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_9",          7, 0x01 },
11   { "EV_KEY BTN_10",         7, 0x02 },
12   { "EV_KEY TRIG_L",         6, 0x40 },
13   { "EV_KEY TRIG_R",         6, 0x80 },
14   { "EV_KEY PUSH_THROTTLE",  7, 0x04 },
15   { "EV_KEY PUSH_XY",        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(uint8_t msg[MAXREPORTLEN], int msglen,
28                const uint8_t last[MAXREPORTLEN]) {
29   reportbits(msg, last, msglen, keybits);
30   reportlocs(msg, last, msglen, vallocs);
31 }
32
33 const char *progname= "hidrawconv-joytechneos";
34
35 const char *const descriptor=
36   "05010904a101854a0901a1000501093009311580257f350045ff660000750895028102c0050209ba150026ff00750895018102050209bb150026ff007508950181020501093915012508360000463b016514750895018102950c7501050945013500150025011901290c810295040605ff09018102c005140924a101854d150026ff000931750895079182c005010906a101854b050719e029e71500250175019508810295017508810195057501050819012905910295017503910195057508150025680507190029688100c0";
37
38 ProcessReport *const report_processors[MAXREPORTS]= {
39  [0x4a] = pr
40 };