kmonad-0.4.1: Advanced keyboard remapping utility

Copyright(c) David Janssen 2019
LicenseMIT
Maintainerjanssen.dhj@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

KMonad.App.BEnv

Description

When running KMonad, we need to keep track the last switchstate of a Button, because we only allowing switching, (we have to filter out repeated Press or Release events). Additionally, we keep track of what Keycode a button is bound to, to provide the myBinding functionality from MonadK.

Synopsis

Documentation

data BEnv Source #

The configuration of a Button with some additional state to keep track of the last Switch

Constructors

BEnv 

Fields

initBEnv :: MonadIO m => Button -> Keycode -> m BEnv Source #

Initialize a BEnv, note that a key is always initialized in an unpressed state.

runBEnv :: MonadUnliftIO m => BEnv -> Switch -> m (Maybe Action) Source #

Try to switch a BEnv. This only does something if the Switch is different from the lastSwitch field. I.e. pressing a pressed button or releasing a released button does nothing.