emacs-keys-0.0.2.0: library to parse emacs style keybinding into the modifiers and the chars

Safe HaskellNone
LanguageHaskell2010

EmacsKeys

Description

Main module that reexports the other ones

Synopsis

Documentation

data Modifier Source

Represents the accepted modifiers C,M,S

Constructors

Ctrl 
Meta 
Shift 

parseEmacsKeys :: String -> Either String ([Modifier], [Keysym]) Source

Parse a string into a list of modifiers and keysyms If Shift is part of the modifiers, the keysyms are converted to upper case

>>> parseEmacsKeys "M-a"
Right ([Meta],[Keysym 97])
>>> parseEmacsKeys "Return"
Right ([],[Keysym 65293])
>>> parseEmacsKeys "S-a"
Right ([Shift],[Keysym 65])

mkEmacsKeys :: String -> Q Exp Source

TH helper, to turn parse errors into compile time errors