diff --git a/src/Graphics/Vty/Input/Events.hs b/src/Graphics/Vty/Input/Events.hs index 6ae1cb0..4c960fd 100644 --- a/src/Graphics/Vty/Input/Events.hs +++ b/src/Graphics/Vty/Input/Events.hs @@ -1,6 +1,7 @@ {-# Language DeriveGeneric #-} module Graphics.Vty.Input.Events where +import Control.DeepSeq import Data.ByteString import GHC.Generics @@ -21,16 +22,22 @@ data Key = KEsc | KChar Char | KBS | KEnter | KHome | KPageUp | KDel | KEnd | KPageDown | KBegin | KMenu deriving (Eq,Show,Read,Ord,Generic) +instance NFData Key + -- | Modifier keys. Key codes are interpreted such that users are more -- likely to have Meta than Alt; for instance on the PC Linux console, -- 'MMeta' will generally correspond to the physical Alt key. data Modifier = MShift | MCtrl | MMeta | MAlt deriving (Eq,Show,Read,Ord,Generic) +instance NFData Modifier + -- | Mouse buttons. data Button = BLeft | BMiddle | BRight | BScrollUp | BScrollDown deriving (Eq,Show,Read,Ord,Generic) +instance NFData Button + -- | Events. data Event = EvKey Key [Modifier] @@ -62,4 +69,6 @@ data Event -- ^ The terminal running the application gained input focus. deriving (Eq,Show,Read,Ord,Generic) +instance NFData Event + type ClassifyMap = [(String,Event)]