evdev 1.0.0.0 → 1.1.0.0
raw patch · 4 files changed
+38/−6 lines, 4 filesdep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- README.md +29/−0
- evdev.cabal +5/−4
- src/Evdev/LowLevel.chs +0/−2
CHANGELOG.md view
@@ -7,3 +7,7 @@ ## 1.0.0.0 -- 2019-12-15 * First stable release.++## 1.1.0.0 -- 2019-12-16++* Hide LowLevel.
+ README.md view
@@ -0,0 +1,29 @@+Haskell evdev library+=====================++http://hackage.haskell.org/package/evdev++This library provides access to the Linux [evdev](https://en.wikipedia.org/wiki/Evdev) interface, for reading input events from devices. It uses [c2hs](https://github.com/haskell/c2hs/wiki/User-Guide)-generated bindings to [libevdev](https://www.freedesktop.org/wiki/Software/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](https://hackage.haskell.org/package/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](https://hackage.haskell.org/package/streamly-0.7.0/docs/Streamly-Tutorial.html#g:39) 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](https://github.com/georgefst/evdev/tree/master/evdev-examples) folder contains a basic `evtest` clone, with the added ability to read events from multiple devices concurrently.++See [Hackage](http://hackage.haskell.org/package/evdev) for further documentation. Full descriptions for each function, datatype etc. will be uploaded in the very near future.
evdev.cabal view
@@ -1,6 +1,6 @@-cabal-version: 2.4+cabal-version: 2.2 name: evdev-version: 1.0.0.0+version: 1.1.0.0 author: George Thomas maintainer: George Thomas description: Provides access to the Linux event device interface, with an optional high-level Streamly-based API.@@ -10,6 +10,7 @@ license-file: LICENSE category: System extra-source-files: CHANGELOG.md+ README.md source-repository head type: git@@ -18,11 +19,11 @@ library exposed-modules: Evdev Evdev.Codes- Evdev.LowLevel Evdev.Stream+ other-modules: Evdev.LowLevel hs-source-dirs: src ghc-options: -Wall- build-depends: base ^>= 4.12.0 || ^>= 4.13,+ build-depends: base ^>= 4.11 || ^>= 4.12 || ^>= 4.13, bytestring ^>= 0.10, containers ^>= 0.6.2, either ^>= 5.0.1,
src/Evdev/LowLevel.chs view
@@ -1,5 +1,3 @@-{-# OPTIONS_HADDOCK hide, prune, ignore-exports #-}- module Evdev.LowLevel where import Control.Monad.Loops (iterateWhile)