[squeak-dev] Successful reading of /dev/input/event2 (was Re: Touchscreen events and non-blocking file I/O)

David T. Lewis lewis at mail.msen.com
Wed Jun 8 23:12:00 UTC 2016


Very nice, thanks for posting this.

Dave

On Wed, Jun 08, 2016 at 05:28:00PM -0400, Tony Garnock-Jones wrote:
> Hello all,
> 
> 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'.
>   d eventHandler:
>     [: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,
> 
>   d close.
> 
> (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
> touchscreens, perhaps!
> 
> Regards,
>   Tony
> 



More information about the Squeak-dev mailing list