mirror of
https://github.com/ilyakooo0/vty.git
synced 2024-11-29 08:49:40 +03:00
commit
67b25158f9
@ -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)]
|
||||
|
Loading…
Reference in New Issue
Block a user