eve-cli-0.2.0.0

Safe HaskellNone
LanguageHaskell2010

Eve.CLI.Internal.Events

Synopsis

Documentation

initCLI :: HasEvents s => AppT s IO () Source #

Place initCLI first in your eve initialization block. It registers listeners for terminal events and sets up the renderer

main :: IO ()
eve_ $ do
  initCLI
  -- add listeners here

onEvent :: (Typeable m, MonadIO m, HasEvents s) => (Event -> AppT s m result) -> AppT s m ListenerId Source #

React to terminal events Event

onKeypress :: (Typeable m, MonadIO m, HasEvents s) => (Keypress -> AppT s m result) -> AppT s m ListenerId Source #

React to a Keypress

onMouseDown :: (Typeable m, MonadIO m, HasEvents s) => (MouseDown -> AppT s m result) -> AppT s m ListenerId Source #

React to a Mouse Down

onMouseUp :: (Typeable m, MonadIO m, HasEvents s) => (MouseUp -> AppT s m result) -> AppT s m ListenerId Source #

React to a Mouse Up

onResize :: (Typeable m, MonadIO m, HasEvents s) => (Resize -> AppT s m result) -> AppT s m ListenerId Source #

React to a Terminal Resize

onPaste :: (Typeable m, MonadIO m, HasEvents s) => (Paste -> AppT s m result) -> AppT s m ListenerId Source #

React to a Paste

onEvent_ :: (Typeable m, MonadIO m, HasEvents s) => (Event -> AppT s m result) -> AppT s m () Source #

React to a Event

onKeypress_ :: (Typeable m, MonadIO m, HasEvents s) => (Keypress -> AppT s m result) -> AppT s m () Source #

React to a Keypress

onMouseDown_ :: (Typeable m, MonadIO m, HasEvents s) => (MouseDown -> AppT s m result) -> AppT s m () Source #

React to a Mouse Down

onMouseUp_ :: (Typeable m, MonadIO m, HasEvents s) => (MouseUp -> AppT s m result) -> AppT s m () Source #

React to a Mouse Up

onResize_ :: (Typeable m, MonadIO m, HasEvents s) => (Resize -> AppT s m result) -> AppT s m () Source #

React to a Terminal Resize

onPaste_ :: (Typeable m, MonadIO m, HasEvents s) => (Paste -> AppT s m result) -> AppT s m () Source #

React to a Paste

data Keypress Source #

Type for terminal keypress events

Constructors

Keypress Key [Modifier] 

data MouseDown Source #

Type for terminal mouse down events

Constructors

MouseDown Int Int Button [Modifier] 

data MouseUp Source #

Type for terminal mouse up events

Constructors

MouseUp Int Int (Maybe Button) 

data Resize Source #

Type for terminal resize events

Constructors

Resize Int Int 

Instances

data Paste Source #

Type for terminal paste events

Constructors

Paste ByteString 

Instances

Eq Paste Source # 

Methods

(==) :: Paste -> Paste -> Bool #

(/=) :: Paste -> Paste -> Bool #

Show Paste Source # 

Methods

showsPrec :: Int -> Paste -> ShowS #

show :: Paste -> String #

showList :: [Paste] -> ShowS #

data LostFocus Source #

Type for terminal blur events

Constructors

LostFocus 

data GainedFocus Source #

Type for terminal focus events

Constructors

GainedFocus