aboutsummaryrefslogtreecommitdiff
path: root/plug/src/Montis/Dsl
diff options
context:
space:
mode:
Diffstat (limited to 'plug/src/Montis/Dsl')
-rw-r--r--plug/src/Montis/Dsl/Bind.hs10
-rw-r--r--plug/src/Montis/Dsl/Buttons.hsc1
-rw-r--r--plug/src/Montis/Dsl/Input.hs3
3 files changed, 6 insertions, 8 deletions
diff --git a/plug/src/Montis/Dsl/Bind.hs b/plug/src/Montis/Dsl/Bind.hs
index c7dbc43..ddba481 100644
--- a/plug/src/Montis/Dsl/Bind.hs
+++ b/plug/src/Montis/Dsl/Bind.hs
@@ -1,9 +1,11 @@
+{-# OPTIONS_GHC -Wno-unused-top-binds #-}
-- | eDSL for the 'bind' function. The 'bind' function provides an easy way to
-- bind certain actions to other actions.
module Montis.Dsl.Bind
( bind,
(.+),
MatchEvent (..),
+ MatchModifiers (..),
Modifier (..),
released,
weak,
@@ -14,7 +16,6 @@ module Montis.Dsl.Bind
where
import Control.Monad
-import Control.Monad.Trans
import Data.Bits
import Data.Word
import Montis.Core.ButtonEvent (ButtonEvent(..))
@@ -82,19 +83,18 @@ data MatchModifiers = MatchModifiers
}
instance MatchEvent MatchModifiers where
- matches (MatchModifiers weak bits base) ev = do
+ matches (MatchModifiers weakMatch bits base) ev = do
mods <- getMods ev
b <- liftW $ base ev
return $
b
- && ( (not weak && mods == bits)
- || (weak && (bits .&. mods == bits))
+ && ( (not weakMatch && mods == bits)
+ || (weakMatch && (bits .&. mods == bits))
)
where
getMods (InputButtonEvent (ButtonEvent {ButtonEvent.modifiers = mods})) = return mods
getMods (InputKeyEvent (KeyEvent {KeyEvent.modifiers = mods})) = return mods
- getMods _ = getModifierState
class LiftMatchModifiers a where
toModifiers :: a -> MatchModifiers
diff --git a/plug/src/Montis/Dsl/Buttons.hsc b/plug/src/Montis/Dsl/Buttons.hsc
index 963d5ce..a73ccc6 100644
--- a/plug/src/Montis/Dsl/Buttons.hsc
+++ b/plug/src/Montis/Dsl/Buttons.hsc
@@ -1,3 +1,4 @@
+{-# OPTIONS_GHC -Wno-missing-export-lists #-}
module Montis.Dsl.Buttons where
import Data.Word
diff --git a/plug/src/Montis/Dsl/Input.hs b/plug/src/Montis/Dsl/Input.hs
index 4855951..a295a19 100644
--- a/plug/src/Montis/Dsl/Input.hs
+++ b/plug/src/Montis/Dsl/Input.hs
@@ -24,7 +24,6 @@ module Montis.Dsl.Input
)
where
-import Control.Concurrent (threadDelay)
import Control.Monad
import Control.Monad.Cont (MonadCont)
import Control.Monad.Loops (andM)
@@ -164,8 +163,6 @@ replayEvents events = do
)
InputM $ modify $ \st -> st {inputSource = newInput}
- where
- delay to act = liftIO (threadDelay to) >> act
-- | Call in the reset handler with the InputM handler you wolud like to use.
useInputHandler :: (InputProxy spy) => InputM spy () -> W ()