Crate slint_evdev_input

Crate slint_evdev_input 

Source
Expand description

Convert linux evdev input events from a touchscreen into slint WindowEvents

§Why?

For small embedded linux devices it may not make sense to run the normal slint event loop, but to use the MinimalSoftwareRenderer to draw to a frame buffer, and implement the event loop as part of the application. Most linux touch drivers provide an events interface, e.g. /etc/input/event0, from which events can be read.

This is a wrapper around the evdev crate to convert the input events into WindowEvent structs which can be passed to slint via the dispatch_event() method on a MinimalSoftwareWindow.

§Caveats

This only supports touch events: PointerPressed, PointerMoved, and PointedReleased.

§Usage

Can be used as a blocking call via fetch_events(), or via async stream by enabling the tokio feature and using into_event_stream() to create an EventStream.

Structs§

SlintEventsIterator
An iterator over window events which will block until a new event is ready
SlintEventsWrapper
A wrapper for evdev::Device to convert events to slint WindowEvents