mirror of
https://github.com/ilyakooo0/vty.git
synced 2024-11-25 19:22:08 +03:00
commit
67b25158f9
@ -1,6 +1,7 @@
|
|||||||
{-# Language DeriveGeneric #-}
|
{-# Language DeriveGeneric #-}
|
||||||
module Graphics.Vty.Input.Events where
|
module Graphics.Vty.Input.Events where
|
||||||
|
|
||||||
|
import Control.DeepSeq
|
||||||
import Data.ByteString
|
import Data.ByteString
|
||||||
import GHC.Generics
|
import GHC.Generics
|
||||||
|
|
||||||
@ -21,16 +22,22 @@ data Key = KEsc | KChar Char | KBS | KEnter
|
|||||||
| KHome | KPageUp | KDel | KEnd | KPageDown | KBegin | KMenu
|
| KHome | KPageUp | KDel | KEnd | KPageDown | KBegin | KMenu
|
||||||
deriving (Eq,Show,Read,Ord,Generic)
|
deriving (Eq,Show,Read,Ord,Generic)
|
||||||
|
|
||||||
|
instance NFData Key
|
||||||
|
|
||||||
-- | Modifier keys. Key codes are interpreted such that users are more
|
-- | Modifier keys. Key codes are interpreted such that users are more
|
||||||
-- likely to have Meta than Alt; for instance on the PC Linux console,
|
-- likely to have Meta than Alt; for instance on the PC Linux console,
|
||||||
-- 'MMeta' will generally correspond to the physical Alt key.
|
-- 'MMeta' will generally correspond to the physical Alt key.
|
||||||
data Modifier = MShift | MCtrl | MMeta | MAlt
|
data Modifier = MShift | MCtrl | MMeta | MAlt
|
||||||
deriving (Eq,Show,Read,Ord,Generic)
|
deriving (Eq,Show,Read,Ord,Generic)
|
||||||
|
|
||||||
|
instance NFData Modifier
|
||||||
|
|
||||||
-- | Mouse buttons.
|
-- | Mouse buttons.
|
||||||
data Button = BLeft | BMiddle | BRight | BScrollUp | BScrollDown
|
data Button = BLeft | BMiddle | BRight | BScrollUp | BScrollDown
|
||||||
deriving (Eq,Show,Read,Ord,Generic)
|
deriving (Eq,Show,Read,Ord,Generic)
|
||||||
|
|
||||||
|
instance NFData Button
|
||||||
|
|
||||||
-- | Events.
|
-- | Events.
|
||||||
data Event
|
data Event
|
||||||
= EvKey Key [Modifier]
|
= EvKey Key [Modifier]
|
||||||
@ -62,4 +69,6 @@ data Event
|
|||||||
-- ^ The terminal running the application gained input focus.
|
-- ^ The terminal running the application gained input focus.
|
||||||
deriving (Eq,Show,Read,Ord,Generic)
|
deriving (Eq,Show,Read,Ord,Generic)
|
||||||
|
|
||||||
|
instance NFData Event
|
||||||
|
|
||||||
type ClassifyMap = [(String,Event)]
|
type ClassifyMap = [(String,Event)]
|
||||||
|
Loading…
Reference in New Issue
Block a user