Copyright | (c) David Janssen 2019 |
---|---|
License | MIT |
Maintainer | janssen.dhj@gmail.com |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
This module contains or reexports all the basic, non-IO concepts related to dealing with key codes, events, and mappings. For keyboard-related IO see KMonad.Keyboard.IO.
Synopsis
- data Switch
- data KeyEvent
- switch :: Lens' KeyEvent Switch
- keycode :: Lens' KeyEvent Keycode
- mkKeyEvent :: Switch -> Keycode -> KeyEvent
- mkPress :: Keycode -> KeyEvent
- mkRelease :: Keycode -> KeyEvent
- type KeyPred = KeyEvent -> Bool
- isPress :: KeyPred
- isRelease :: KeyPred
- isKeycode :: Keycode -> KeyPred
- isPressOf :: Keycode -> KeyPred
- isReleaseOf :: Keycode -> KeyPred
- type LayerTag = Text
- type LMap a = LayerStack LayerTag Keycode a
- module KMonad.Keyboard.Keycode
KeyEvents and their helpers
An KeyEvent
in KMonad is either the Press
or Release
of a particular
Keycode
. A complete list of keycodes can be found in
KMonad.Keyboard.Keycode.
KMonad recognizes 2 different types of actions: presses and releases. Note that we do not handle repeat events at all.
Instances
Eq KeyEvent Source # | |
Ord KeyEvent Source # | An |
Defined in KMonad.Keyboard | |
Show KeyEvent Source # | |
Generic KeyEvent Source # | |
Hashable KeyEvent Source # | |
Defined in KMonad.Keyboard | |
Display KeyEvent Source # | A |
Defined in KMonad.Keyboard display :: KeyEvent -> Utf8Builder # textDisplay :: KeyEvent -> Text # | |
type Rep KeyEvent Source # | |
Defined in KMonad.Keyboard type Rep KeyEvent = D1 (MetaData "KeyEvent" "KMonad.Keyboard" "kmonad-0.4.1-FPseCbFTtIEC38tuwaAvvU" False) (C1 (MetaCons "KeyEvent" PrefixI True) (S1 (MetaSel (Just "_switch") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Switch) :*: S1 (MetaSel (Just "_keycode") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Keycode))) |
Predicates
isKeycode :: Keycode -> KeyPred Source #
Return whether the provided KeyEvent matches a particular Keycode
isPressOf :: Keycode -> KeyPred Source #
Return whether the provided KeyEvent matches the press of the Keycode
isReleaseOf :: Keycode -> KeyPred Source #
Returth whether the provided KeyEvent matches the release of the Keycode
LMaps
Type aliases for specifying stacked-layer mappings
Reexports
module KMonad.Keyboard.Keycode