netwire-input 0.0.3 → 0.0.4
raw patch · 2 files changed
+16/−3 lines, 2 filesdep ~base
Dependency ranges changed: base
Files
- lib/FRP/Netwire/Input.hs +14/−1
- netwire-input.cabal +2/−2
lib/FRP/Netwire/Input.hs view
@@ -19,9 +19,10 @@ -------------------------------------------------------------------------------- -- Requried modules+import Prelude hiding ((.), id) import Control.Monad (liftM) import Control.Monad.Fix-import Control.Wire hiding ((.))+import Control.Wire import Data.Monoid -------------------------------------------------------------------------------- @@ -101,6 +102,12 @@ then return (Right x) else return (Left mempty) +-- | Ignores its input and returns True whenever the mouse button is pressed+--+-- * Inhibits: never+isMousePressed :: (Monoid e, MonadMouse mb m) => mb -> Wire s e m a Bool+isMousePressed b = mousePressed b . pure True <|> pure False+ -- | Behaves like the identity wire for a signle instant when the mouse button -- is pressed and otherwise inhibits -- @@ -169,6 +176,12 @@ if pressed then return (Right x) else return (Left mempty)++-- | Ignores its input and returns True whenever the key is pressed+--+-- * Inhibits: never+isKeyPressed :: (Monoid e, MonadKeyboard k m) => k -> Wire s e m a Bool+isKeyPressed key = keyPressed key . pure True <|> pure False -- | Behaves like the identity wire when the key is not pressed -- and inhibits otherwise
netwire-input.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: netwire-input-version: 0.0.3+version: 0.0.4 synopsis: Input handling abstractions for netwire description: This package contains a collection of Monad typeclasses that support interaction with input devices such as keyboard and mice. Moreover, these@@ -29,7 +29,7 @@ default-extensions: FunctionalDependencies MultiParamTypeClasses exposed-modules: FRP.Netwire.Input- build-depends: base >=4.6 && <4.8,+ build-depends: base >= 4.6 && < 4.10, netwire >= 5 hs-source-dirs: lib default-language: Haskell2010