Lines Matching refs:code
50 static void handleKeyEvent(_GLFWjoystick* js, int code, int value)
53 js->linjs.keyMap[code - BTN_MISC],
59 static void handleAbsEvent(_GLFWjoystick* js, int code, int value)
61 const int index = js->linjs.absMap[code];
63 if (code >= ABS_HAT0X && code <= ABS_HAT3Y)
72 const int hat = (code - ABS_HAT0X) / 2;
73 const int axis = (code - ABS_HAT0X) % 2;
89 const struct input_absinfo* info = &js->linjs.absInfo[code];
109 for (int code = 0; code < ABS_CNT; code++)
111 if (js->linjs.absMap[code] < 0)
114 struct input_absinfo* info = &js->linjs.absInfo[code];
116 if (ioctl(js->linjs.fd, EVIOCGABS(code), info) < 0)
119 handleAbsEvent(js, code, info->value);
193 for (int code = BTN_MISC; code < KEY_CNT; code++)
195 if (!isBitSet(code, keyBits))
198 linjs.keyMap[code - BTN_MISC] = buttonCount;
202 for (int code = 0; code < ABS_CNT; code++)
204 linjs.absMap[code] = -1;
205 if (!isBitSet(code, absBits))
208 if (code >= ABS_HAT0X && code <= ABS_HAT3Y)
210 linjs.absMap[code] = hatCount;
213 code++;
217 if (ioctl(linjs.fd, EVIOCGABS(code), &linjs.absInfo[code]) < 0)
220 linjs.absMap[code] = axisCount;
405 if (e.code == SYN_DROPPED)
407 else if (e.code == SYN_REPORT)
418 handleKeyEvent(js, e.code, e.value);
420 handleAbsEvent(js, e.code, e.value);