on master help sign in
Merge pull request #228 from mlang/NFData
67b2515Jonathan Daugherty
src/Graphics/Vty/Input/Events.hs+9
@@ -1,6 +1,7 @@
1{-# Language DeriveGeneric #-}
1{-# Language DeriveGeneric #-}
2module Graphics.Vty.Input.Events where
2module Graphics.Vty.Input.Events where
3
3
4+import Control.DeepSeq
4import Data.ByteString
5import Data.ByteString
5import GHC.Generics
6import GHC.Generics
6
7
@@ -21,16 +22,22 @@ data Key = KEsc | KChar Char | KBS | KEnter
21 | KHome | KPageUp | KDel | KEnd | KPageDown | KBegin | KMenu
22 | KHome | KPageUp | KDel | KEnd | KPageDown | KBegin | KMenu
22 deriving (Eq,Show,Read,Ord,Generic)
23 deriving (Eq,Show,Read,Ord,Generic)
23
24
25+instance NFData Key
26+
24-- | Modifier keys. Key codes are interpreted such that users are more
27-- | Modifier keys. Key codes are interpreted such that users are more
25-- likely to have Meta than Alt; for instance on the PC Linux console,
28-- likely to have Meta than Alt; for instance on the PC Linux console,
26-- 'MMeta' will generally correspond to the physical Alt key.
29-- 'MMeta' will generally correspond to the physical Alt key.
27data Modifier = MShift | MCtrl | MMeta | MAlt
30data Modifier = MShift | MCtrl | MMeta | MAlt
28 deriving (Eq,Show,Read,Ord,Generic)
31 deriving (Eq,Show,Read,Ord,Generic)
29
32
33+instance NFData Modifier
34+
30-- | Mouse buttons.
35-- | Mouse buttons.
31data Button = BLeft | BMiddle | BRight | BScrollUp | BScrollDown
36data Button = BLeft | BMiddle | BRight | BScrollUp | BScrollDown
32 deriving (Eq,Show,Read,Ord,Generic)
37 deriving (Eq,Show,Read,Ord,Generic)
33
38
39+instance NFData Button
40+
34-- | Events.
41-- | Events.
35data Event
42data Event
36 = EvKey Key [Modifier]
43 = EvKey Key [Modifier]
@@ -62,4 +69,6 @@ data Event
62 -- ^ The terminal running the application gained input focus.
69 -- ^ The terminal running the application gained input focus.
63 deriving (Eq,Show,Read,Ord,Generic)
70 deriving (Eq,Show,Read,Ord,Generic)
64
71
72+instance NFData Event
73+
65type ClassifyMap = [(String,Event)]
74type ClassifyMap = [(String,Event)]