Lines Matching refs:read
14 (JS_EVENT_INIT) that you can read to check the initial state of the
26 read (fd, &e, sizeof(e));
37 If the read is successful, it will return sizeof(e), unless you wanted to read
38 more than one event per read as described in section 3.1.
86 don't read a 0 when the joystick is `dead', or if it doesn't span the
124 If you open the device in blocking mode, a read will block (that is,
125 wait) forever until an event is generated and effectively read. There
129 a) use select to wait until there's data to be read on fd, or
139 If read returns -1 when reading in O_NONBLOCK mode, this isn't
141 are no events pending to be read on the driver queue. You should read
147 while (read (fd, &e, sizeof(e)) > 0) {
165 mentioned, or because too much time elapses from one read to another
170 the driver will switch to startup mode and next time you read it,
179 In the above code, you might as well want to read more than one event
180 at a time using the typical read(2) functionality. For that, you would
181 replace the read above with something like
184 int i = read (fd, mybuffer, sizeof(mybuffer));
186 In this case, read would return -1 if the queue was empty, or some
187 other value in which the number of events read would be i /
205 For example, to read the number of axes
271 if (read (fd, &js, JS_RETURN) != JS_RETURN) {
277 As you can figure out from the example, the read returns immediately,