on master help sign in
cleanup
commit12cd6e507c7b3581043abb4a7cc7755da890bd03 authorCorey O'Connor <coreyoconnor@gmail.com> dateSat 26 Oct 2013, 09:43 (13 years ago) parentb6caadc
2 files changed+10−10
src/Graphics/Vty/Input/Data.hs+2−10 src/Graphics/Vty/Input/Internal.hs+8
src/Graphics/Vty/Input/Data.hs+2−10
@@ -13,23 +13,15 @@ data Key = KEsc | KFun Int | KBackTab | KPrtScr | KPause | KASCII Char | KBS | K
1313data Modifier = MShift | MCtrl | MMeta | MAlt
1414 deriving (Eq,Show,Ord)
1515
16−-- |Mouse buttons. Not yet used.
16+-- | Mouse buttons. Not yet used.
1717data Button = BLeft | BMiddle | BRight
1818 deriving (Eq,Show,Ord)
1919
20−-- |Generic events.
20+-- | Generic events.
2121data Event = EvKey Key [Modifier] | EvMouse Int Int Button [Modifier]
2222 | EvResize Int Int
2323 deriving (Eq,Show,Ord)
2424
25−data KClass
26− = Valid Key [Modifier]
27− | Invalid
28− | EndLoop
29− | Prefix
30− | MisPfx Key [Modifier] [Char]
31− deriving(Show)
32−
3325type ClassifyTable = [(String, (Key, [Modifier]))]
3426
3527map_to_legacy_table :: [(String, Event)] -> ClassifyTable
src/Graphics/Vty/Input/Internal.hs+8
@@ -12,6 +12,14 @@ import Data.Maybe ( mapMaybe )
1212import qualified Data.Set as S( fromList, member )
1313import Data.Word
1414
15+data KClass
16+ = Valid Key [Modifier]
17+ | Invalid
18+ | EndLoop
19+ | Prefix
20+ | MisPfx Key [Modifier] [Char]
21+ deriving(Show)
22+
1523inputToEventThread :: (String -> KClass) -> Chan Char -> Chan Event -> IO ()
1624inputToEventThread classifier inputChannel eventChannel = loop []
1725 where loop kb = case (classifier kb) of