diff options
Diffstat (limited to 'plug/src/Montis/Dsl/Bind.hs')
| -rw-r--r-- | plug/src/Montis/Dsl/Bind.hs | 10 |
1 files changed, 5 insertions, 5 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 |