-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Bridge for working with evdev and streamly -- -- Functions for working with streams of input events. Often much more -- pleasant than working in a more imperative style. @package evdev-streamly @version 0.0.2.0 -- | Functions for working with streams of input events. Unless stated -- otherwise, these functions will throw exceptions if the underlying C -- calls fail. module Evdev.Stream -- | 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. allDevices :: (IsStream t, Monad (t IO)) => t IO Device -- | All events on all valid devices (in /dev/input). Prints any -- exceptions. -- --
-- allEvents == readEventsMany allDevices --allEvents :: IsStream t => t IO (Device, Event) -- | Create devices for all paths in the stream. makeDevices :: IsStream t => t IO RawFilePath -> t IO Device -- | 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. newDevices :: (IsStream t, Monad (t IO)) => t IO Device -- | This is a workaround for bugginess in newDevices when it comes -- to waiting for permissions on a new device - it just waits the number -- of microseconds given before trying to read from the device. newDevices' :: (IsStream t, Monad (t IO)) => Int -> t IO Device -- | Read all events from a device. readEvents :: Device -> SerialT IO Event -- | 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. readEventsMany :: IsStream t => AsyncT IO Device -> t IO (Device, Event)