evdev: Bindings to libevdev

[ bsd3, library, linux, streamly, system ] [ Propose Tags ]

Provides access to the Linux event device interface, with an optional high-level Streamly-based API.


[Skip to Readme]
Versions [faq] 0.1.0.0, 0.1.0.1, 0.2.0.0, 0.2.0.1, 1.0.0.0, 1.1.0.0, 1.1.0.1, 1.2.0.0 (info)
Change log CHANGELOG.md
Dependencies base (>=4.11 && <4.14), bytestring (==0.10.*), containers (>=0.6.2 && <0.7), either (>=5.0.1 && <5.1), extra (>=1.6.18 && <1.7), hinotify (==0.4.*), monad-loops (>=0.4.3 && <0.5), paths (==0.2.*), posix-paths (>=0.2.1 && <0.3), process (>=1.6.5 && <1.7), rawfilepath (>=0.2.4 && <0.3), safe (>=0.3.18 && <0.4), streamly (>=0.6.1 && <0.8), streamly-fsnotify (==1.0.*), time (>=1.9.3 && <1.10), unix (>=2.7.2 && <2.8) [details]
License BSD-3-Clause
Author George Thomas
Maintainer George Thomas
Category System
Home page https://github.com/georgefst/evdev
Source repo head: git clone git://github.com/georgefst/evdev.git
Uploaded by GeorgeThomas at Thu Dec 19 14:29:21 UTC 2019
Distributions NixOS:1.2.0.0
Downloads 450 total (152 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs uploaded by user
Build status unknown [no reports yet]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for evdev-1.2.0.0

[back to package description]

Haskell evdev library

http://hackage.haskell.org/package/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.

Modules

  • Evdev provides the basic functionality for initialising devices, reading events etc.
  • Evdev.Codes contains datatypes corresponding to the constants in input-event-codes.h, such as keys and device properties.
  • Evdev.Stream provides a higher-level Streamly-based interface, for obtaining a stream of events.

Why streamly?

Compared to other Haskell streaming libraries, I've found streamly to have a remarkably easy-to-use API, and the best, simplest support for concurrency. For example, merging concurrent streams of events, from different devices, is trivial.

If you wish to use this library alongside conduit, pipes etc. then see here for a guide on interoperation.

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.

See Hackage for further documentation. Full descriptions for each function, datatype etc. will be uploaded in the very near future.