mirror of
https://github.com/jtdaugherty/brick.git
synced 2024-12-03 11:41:06 +03:00
Merge pull request #95 from kquick/master
guide: update example uses of getVtyHandle
This commit is contained in:
commit
eacda57e84
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user