@hackage evdev2.0.0.0
Bindings to libevdev
Categories
License
BSD-3-Clause
Maintainer
George Thomas
Links
Versions
Installation
Dependencies (7)
- base >=4.11 && <5
- bytestring ^>=0.10
- containers ^>=0.6.2
- extra ^>=1.6.18 || ^>=1.7
- monad-loops ^>=0.4.3
- time ^>=1.9.3 || ^>=1.10 Show all…
Dependents (1)
@hackage/evdev-streamly
Evdev
This library provides access to the Linux evdev interface, for reading input events from devices. It uses c2hs-generated bindings to libevdev, which should be available on almost any modern Linux distro.
It aims to expose the full set of functionality exposed by libevdev, while providing stronger types, and a higher level of abstraction - no worrying about memory management, ordering of operations etc.
Getting started
Your user will need to be a member of the input group in order to read from devices. Try usermod -a -G input [username].
If you wish to make use of concurrency, e.g. to use functions like allEvents, be sure to pass the option -threaded to GHC, in order to enable the threaded runtime.
The evdev-examples folder contains a basic evtest clone, with the added ability to read events from multiple devices concurrently.
Streamly
For a higher-level, more functional API based on event streams, see evdev-streamly.