kmonad-0.4.1: Advanced keyboard remapping utility

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

KMonad.Keyboard

Contents

Description

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

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.

data Switch Source #

KMonad recognizes 2 different types of actions: presses and releases. Note that we do not handle repeat events at all.

Constructors

Press 
Release 
Instances
Enum Switch Source # 
Instance details

Defined in KMonad.Keyboard

Eq Switch Source # 
Instance details

Defined in KMonad.Keyboard

Methods

(==) :: Switch -> Switch -> Bool #

(/=) :: Switch -> Switch -> Bool #

Ord Switch Source # 
Instance details

Defined in KMonad.Keyboard

Show Switch Source # 
Instance details

Defined in KMonad.Keyboard

Generic Switch Source # 
Instance details

Defined in KMonad.Keyboard

Associated Types

type Rep Switch :: Type -> Type #

Methods

from :: Switch -> Rep Switch x #

to :: Rep Switch x -> Switch #

Hashable Switch Source # 
Instance details

Defined in KMonad.Keyboard

Methods

hashWithSalt :: Int -> Switch -> Int #

hash :: Switch -> Int #

type Rep Switch Source # 
Instance details

Defined in KMonad.Keyboard

type Rep Switch = D1 (MetaData "Switch" "KMonad.Keyboard" "kmonad-0.4.1-FPseCbFTtIEC38tuwaAvvU" False) (C1 (MetaCons "Press" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Release" PrefixI False) (U1 :: Type -> Type))

data KeyEvent Source #

An KeyEvent is a Switch on a particular Keycode

Instances
Eq KeyEvent Source # 
Instance details

Defined in KMonad.Keyboard

Ord KeyEvent Source #

An Ord instance, where Press > Release, and otherwise we Ord on the Keycode

Instance details

Defined in KMonad.Keyboard

Show KeyEvent Source # 
Instance details

Defined in KMonad.Keyboard

Generic KeyEvent Source # 
Instance details

Defined in KMonad.Keyboard

Associated Types

type Rep KeyEvent :: Type -> Type #

Methods

from :: KeyEvent -> Rep KeyEvent x #

to :: Rep KeyEvent x -> KeyEvent #

Hashable KeyEvent Source # 
Instance details

Defined in KMonad.Keyboard

Methods

hashWithSalt :: Int -> KeyEvent -> Int #

hash :: KeyEvent -> Int #

Display KeyEvent Source #

A Display instance for KeyEvents that prints them out nicely.

Instance details

Defined in KMonad.Keyboard

type Rep KeyEvent Source # 
Instance details

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)))

mkKeyEvent :: Switch -> Keycode -> KeyEvent Source #

Create a new KeyEvent from a Switch and a Keycode

mkPress :: Keycode -> KeyEvent Source #

Create a KeyEvent that represents pressing a key

mkRelease :: Keycode -> KeyEvent Source #

Create a KeyEvent that represents releaseing a key

Predicates

type KeyPred = KeyEvent -> Bool Source #

Predicate on KeyEvent's

isPress :: KeyPred Source #

Return whether the provided KeyEvent is a Press

isRelease :: KeyPred Source #

Return whether the provided KeyEvent is a Release

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

type LayerTag = Text Source #

Layers are identified by a tag that is simply a Text value.

type LMap a = LayerStack LayerTag Keycode a Source #

LMaps are mappings from LayerTagd maps from Keycode to things.

Reexports