    module Brick.Keybindings.Normalize
      ( normalizeKey
      )
    where

    import Data.Char (toLower)
    import qualified Graphics.Vty as Vty

    -- | A keybinding involving modifiers should have its key character
    -- normalized to lowercase since it's impossible to get uppercase keys
    -- from the terminal when modifiers are present.
    normalizeKey :: [Vty.Modifier] -> Vty.Key -> Vty.Key
    normalizeKey :: [Modifier] -> Key -> Key
    normalizeKey (Modifier
    _:[Modifier]
    _) (Vty.KChar Char
    c) = Char -> Key
    Vty.KChar (Char -> Key) -> Char -> Key
    forall a b. (a -> b) -> a -> b
    $ Char -> Char
    toLower Char
    c
    normalizeKey [Modifier]
    _ Key
    k = Key
    k