Lines Matching refs:linjs
53 js->linjs.keyMap[code - BTN_MISC],
61 const int index = js->linjs.absMap[code];
74 int* state = js->linjs.hats[hat];
89 const struct input_absinfo* info = &js->linjs.absInfo[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)
133 if (strcmp(_glfw.joysticks[jid].linjs.path, path) == 0)
137 _GLFWjoystickLinux linjs = {0};
138 linjs.fd = open(path, O_RDONLY | O_NONBLOCK | O_CLOEXEC);
139 if (linjs.fd == -1)
147 if (ioctl(linjs.fd, EVIOCGBIT(0, sizeof(evBits)), evBits) < 0 ||
148 ioctl(linjs.fd, EVIOCGBIT(EV_KEY, sizeof(keyBits)), keyBits) < 0 ||
149 ioctl(linjs.fd, EVIOCGBIT(EV_ABS, sizeof(absBits)), absBits) < 0 ||
150 ioctl(linjs.fd, EVIOCGID, &id) < 0)
155 close(linjs.fd);
162 close(linjs.fd);
168 if (ioctl(linjs.fd, EVIOCGNAME(sizeof(name)), name) < 0)
198 linjs.keyMap[code - BTN_MISC] = buttonCount;
204 linjs.absMap[code] = -1;
210 linjs.absMap[code] = hatCount;
217 if (ioctl(linjs.fd, EVIOCGABS(code), &linjs.absInfo[code]) < 0)
220 linjs.absMap[code] = axisCount;
229 close(linjs.fd);
233 strncpy(linjs.path, path, sizeof(linjs.path) - 1);
234 memcpy(&js->linjs, &linjs, sizeof(linjs));
249 close(js->linjs.fd);
259 return strcmp(fj->linjs.path, sj->linjs.path);
269 if (_glfw.linjs.inotify <= 0)
274 const ssize_t size = read(_glfw.linjs.inotify, buffer, sizeof(buffer));
283 if (regexec(&_glfw.linjs.regex, e->name, 1, &match, 0) != 0)
295 if (strcmp(_glfw.joysticks[jid].linjs.path, path) == 0)
314 _glfw.linjs.inotify = inotify_init1(IN_NONBLOCK | IN_CLOEXEC);
315 if (_glfw.linjs.inotify > 0)
320 _glfw.linjs.watch = inotify_add_watch(_glfw.linjs.inotify,
327 _glfw.linjs.regexCompiled = (regcomp(&_glfw.linjs.regex, "^event[0-9]\\+$", 0) == 0);
328 if (!_glfw.linjs.regexCompiled)
345 if (regexec(&_glfw.linjs.regex, entry->d_name, 1, &match, 0) != 0)
374 if (_glfw.linjs.inotify > 0)
376 if (_glfw.linjs.watch > 0)
377 inotify_rm_watch(_glfw.linjs.inotify, _glfw.linjs.watch);
379 close(_glfw.linjs.inotify);
382 if (_glfw.linjs.regexCompiled)
383 regfree(&_glfw.linjs.regex);
394 if (read(js->linjs.fd, &e, sizeof(e)) < 0)
406 _glfw.linjs.dropped = GLFW_TRUE;
409 _glfw.linjs.dropped = GLFW_FALSE;
414 if (_glfw.linjs.dropped)