HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulebrick-2.10Haskell2010

Brick.Keybindings.KeyEvents

This module provides KeyEvents, a data type for mapping application-defined abstract events to user-facing names (e.g. for use in configuration files and documentation). This data structure gives you a place to define the correspondence between your application's key events and their names. A KeyEvents also effectively tells the key binding system about the collection of possible abstract events that can be handled.

A KeyEvents is used to construct a KeyConfig with newKeyConfig.

  • 1 type
  • 4 values
  • Packagebrick-2.10
  • Exports5
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceKeyEvents.hs
datadata KeyEvents k
#

A bidirectional mapping between events k and their user-readable names.

Instances2Eq, Show
  • Eq k => Eq (KeyEvents k)Defined in brick-2.10 · Brick.Keybindings.KeyEvents
  • Show k => Show (KeyEvents k)Defined in brick-2.10 · Brick.Keybindings.KeyEvents
valuekeyEvents :: Ord k => [(Text, k)] -> KeyEvents k
#

Build a new KeyEvents map from the specified list of events and names. Key event names are stored in lowercase.

Calls error if any events have the same name (ignoring case) or if multiple names map to the same event.

valuelookupKeyEvent :: Ord k => KeyEvents k -> Text -> Maybe k
#

Look up the specified event name to get its abstract event. The lookup ignores leading and trailing whitespace as well as case.