linux-evdev 0.1 → 0.2
raw patch · 2 files changed
+20/−14 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- System/Linux/Input/Event.hsc +12/−11
- linux-evdev.cabal +8/−3
System/Linux/Input/Event.hsc view
@@ -1,6 +1,7 @@ {-# LANGUAGE ForeignFunctionInterface #-} -module System.Linux.Input.Event ( Event(..)+module System.Linux.Input.Event ( -- * Events+ Event(..) , hReadEvent , module System.Linux.Input.Event.Constants ) where@@ -22,6 +23,7 @@ #include <linux/input.h> +-- | An Event data Event = SyncEvent { evTimestamp :: DiffTime , evSyncCode :: SyncType } | KeyEvent { evTimestamp :: DiffTime@@ -73,17 +75,16 @@ poke = undefined +-- | Read an event hReadEvent :: Handle -> IO (Maybe Event)-hReadEvent h =- do a <- hGet h $ sizeOf (undefined::Event)- case a of- _ | BS.null a -> return Nothing- _ | otherwise -> getEvent a >>= return . Just+hReadEvent h = do+ a <- hGet h $ sizeOf (undefined::Event)+ case a of+ _ | BS.null a -> return Nothing+ _ | otherwise -> getEvent a >>= return . Just getEvent :: ByteString -> IO Event-getEvent bs =- do let (fptr, off, len) = toForeignPtr bs- print off- print len- withForeignPtr fptr $ peek . castPtr +getEvent bs = do+ let (fptr, off, len) = toForeignPtr bs+ withForeignPtr fptr $ peek . castPtr
linux-evdev.cabal view
@@ -1,13 +1,14 @@ Name: linux-evdev-Version: 0.1+Version: 0.2 Synopsis: Bindings to Linux evdev input device interface.+Description: Bindings to Linux evdev input device interface. License: BSD3 License-file: LICENSE Author: Ben Gamari Maintainer: bgamari.foss@gmail.com Category: System Build-type: Simple-Cabal-version: >=1.2+Cabal-version: >=1.6 Library Exposed-modules: System.Linux.Input.Event, System.Linux.Input.Event.Constants@@ -15,4 +16,8 @@ Build-depends: base >= 4.0 && < 5.0, time >= 1.4 && < 1.5, bytestring >= 0.9 && < 0.11- + +source-repository head+ type: git+ location: git://github.com/bgamari/linux-evdev.git+