[squeak-dev] Successful reading of /dev/input/event2 (was Re:
Touchscreen events and non-blocking file I/O)
tonyg at ccs.neu.edu
Wed Jun 8 21:28:00 UTC 2016
Following Levente's suggestion, I managed to read Linux input events
from /dev/input/event2 (which is a mouse on this system) without
blocking the whole image.
Attached is LinuxIO.st. To try it out,
d := LinuxInputEventDevice openPath: '/dev/input/event2'.
[:e | Transcript nextPutAll: e printString; crlf; flush].
(Change event2 to the device file for your mouse - or touchscreen!)
Then, wiggling the mouse should print messages to Transcript.
To stop it,
(You can start it again with "d open".)
It's just a proof-of-concept; ideally, it'd know to reopen itself at
image startup. Plus it'd be useful to have some way of identifying at
least device classes. But it's good enough to start playing with reading
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3248 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20160608/54baa622/LinuxIO.bin
More information about the Squeak-dev