evdev-streamly- Bridge for working with evdev and streamly
Safe HaskellNone



Functions for working with streams of input events. Unless stated otherwise, these functions will throw exceptions if the underlying C calls fail.



allDevices :: (IsStream t, Monad (t IO)) => t IO Device Source #

All valid existing devices (in /dev/input). If a device can't be initialised for an individual path, then the exception is printed, and the function continues to try to initialise the others.

allEvents :: IsStream t => t IO (Device, Event) Source #

All events on all valid devices (in /dev/input). Prints any exceptions.

allEvents == readEventsMany allDevices

makeDevices :: IsStream t => t IO RawFilePath -> t IO Device Source #

Create devices for all paths in the stream.

newDevices :: (IsStream t, Monad (t IO)) => t IO Device Source #

All new devices created (in /dev/input). Watches for new file paths (using inotify), and those corresponding to valid devices are added to the stream.

readEvents :: Device -> SerialT IO Event Source #

Read all events from a device.

readEventsMany :: IsStream t => AsyncT IO Device -> t IO (Device, Event) Source #

Concurrently read events from multiple devices. If a read fails on one, the exception is printed to stderr and the stream continues to read from the others.