Lines Matching full:read
35 (JS_EVENT_INIT) that you can read to obtain the initial state of the
49 read (fd, &e, sizeof(e));
60 If the read is successful, it will return sizeof(e), unless you wanted to read
61 more than one event per read as described in section 3.1.
112 don't read a 0 when the joystick is ``dead``, or if it doesn't span the
152 If you open the device in blocking mode, a read will block (that is,
153 wait) forever until an event is generated and effectively read. There
157 a) use select to wait until there's data to be read on fd, or
167 If read returns -1 when reading in O_NONBLOCK mode, this isn't
169 are no events pending to be read on the driver queue. You should read
177 while (read (fd, &e, sizeof(e)) > 0) {
195 mentioned, or because too much time elapses from one read to another
200 the driver will switch to startup mode and next time you read it,
212 In the above code, you might as well want to read more than one event
213 at a time using the typical read(2) functionality. For that, you would
214 replace the read above with something like::
217 int i = read (fd, mybuffer, sizeof(mybuffer));
219 In this case, read would return -1 if the queue was empty, or some
220 other value in which the number of events read would be i /
238 For example, to read the number of axes::
304 if (read (fd, &js, JS_RETURN) != JS_RETURN) {
310 As you can figure out from the example, the read returns immediately,