• Home
  • Raw
  • Download

Lines Matching +full:c +full:- +full:define +full:- +full:name

1 .. _joystick-api:
7 :Author: Ragnar Hojland Espinosa <ragnar@macula.net> - 7 Aug 1998
18 driver now reports only any changes of its state. See joystick-api.txt,
19 joystick.h and jstest.c included in the joystick package for more
65 -------------
69 #define JS_EVENT_BUTTON 0x01 /* button pressed/released */
70 #define JS_EVENT_AXIS 0x02 /* joystick moved */
71 #define JS_EVENT_INIT 0x80 /* initial state of device */
86 ---------------
108 --------------
110 For an axis, ``value`` is a signed integer between -32767 and +32767
141 -------------
161 b) open the device in non-blocking mode (O_NONBLOCK)
165 ----------
167 If read returns -1 when reading in O_NONBLOCK mode, this isn't
170 all events on the queue (that is, until you get a -1).
219 In this case, read would return -1 if the queue was empty, or some
231 #define JSIOCGAXES /* get number of axes char */
232 #define JSIOCGBUTTONS /* get number of buttons char */
233 #define JSIOCGVERSION /* get driver version int */
234 #define JSIOCGNAME(len) /* get identifier string char */
235 #define JSIOCSCORR /* set correction values &js_corr */
236 #define JSIOCGCORR /* get correction values &js_corr */
245 -------------
247 JSIOGCVERSION is a good way to check in run-time whether the running
249 IOCTL will fail. For a compile-time decision, you can test the
257 ----------
259 JSIOCGNAME(len) allows you to get the name string of the joystick - the same
261 buffer provided by the application asking for the name. It is used to avoid
262 possible overrun should the name be too long::
264 char name[128];
265 if (ioctl(fd, JSIOCGNAME(sizeof(name)), name) < 0)
266 strscpy(name, "Unknown", sizeof(name));
267 printf("Name: %s\n", name);
271 -------------
273 For usage on JSIOC[SG]CORR I suggest you to look into jscal.c They are
292 #define JS_CORR_NONE 0x00 /* returns raw values */
293 #define JS_CORR_BROKEN 0x01 /* broken line */
321 #define JS_RETURN sizeof(struct JS_DATA_TYPE)
331 except that the values are non-negative. The 1.2.8+ drivers use a