Merge pull request #95 from kquick/master

guide: update example uses of getVtyHandle
This commit is contained in:
Jonathan Daugherty 2016-11-19 01:05:18 -08:00 committed by GitHub
commit eacda57e84

View File

@ -814,9 +814,11 @@ to the Vty library handle in ``EventM``:
do
vty <- Brick.Main.getVtyHandle
let output = outputIface vty
when (supportsMode output BracketedPaste) $
liftIO $ setMode output BracketedPaste True
case vty of
Nothing -> return ()
Just v -> let output = outputIface v
in when (supportsMode output BracketedPaste) $
liftIO $ setMode output BracketedPaste True
Once enabled, paste mode will generate Vty ``EvPaste`` events. These
events will give you the entire pasted content as a ``ByteString`` which
@ -835,9 +837,11 @@ To enable mouse mode, we need to get access to the Vty library handle in
do
vty <- Brick.Main.getVtyHandle
let output = outputIface vty
when (supportsMode output Mouse) $
liftIO $ setMode output Mouse True
case vty of
Nothing -> return ()
Just v -> let output = outputIface vt
in when (supportsMode output Mouse) $
liftIO $ setMode output Mouse True
Bear in mind that some terminals do not support mouse interaction, so
use Vty's ``getModeStatus`` to find out whether your terminal will