on master help sign in
remove mkVtyEscDelay. mkVty is sufficient
00a6a4fCorey O'Connor
src/Graphics/Vty.hs+3−14
@@ -24,14 +24,10 @@
24-- - <http://vt100.net/docs/vt100-ug/chapter3.html vt100 control sequences>
24-- - <http://vt100.net/docs/vt100-ug/chapter3.html vt100 control sequences>
25module Graphics.Vty ( Vty(..)
25module Graphics.Vty ( Vty(..)
26 , mkVty
26 , mkVty
27− , mkVtyEscDelay
27+ , module Graphics.Vty.Input
28 , module Graphics.Vty.Output
28 , module Graphics.Vty.Output
29 , module Graphics.Vty.Picture
29 , module Graphics.Vty.Picture
30 , DisplayRegion
30 , DisplayRegion
31− , Key(..)
32− , Modifier(..)
33− , Button(..)
34− , Event(..)
35 )
31 )
36 where
32 where
37
33
@@ -88,15 +84,8 @@ data Vty = Vty
88
84
89-- | Set up the state object for using vty. At most one state object should be
85-- | Set up the state object for using vty. At most one state object should be
90-- created at a time.
86-- created at a time.
91−mkVty :: IO Vty
92−mkVty = mkVtyEscDelay def
93−
94−-- | Set up the state object for using vty. At most one state object should be
95−-- created at a time. The delay, in microseconds, specifies the period of time to wait for a key
96−-- following reading ESC from the terminal before considering the ESC key press as a discrete event.
97−-- \todo move input init into terminal interface
98−mkVtyEscDelay :: Config -> IO Vty
87+mkVty :: Config -> IO Vty
99−mkVtyEscDelay config = do
88+mkVty config = do
100 input <- input_for_current_terminal config
89 input <- input_for_current_terminal config
101 out <- output_for_current_terminal
90 out <- output_for_current_terminal
102 intMkVty input out
91 intMkVty input out
src/Graphics/Vty/Inline/Unsafe.hs+2−1
@@ -2,6 +2,7 @@ module Graphics.Vty.Inline.Unsafe where
2
2
3import Graphics.Vty
3import Graphics.Vty
4
4
5+import Data.Default
5import Data.IORef
6import Data.IORef
6
7
7import System.IO.Unsafe
8import System.IO.Unsafe
@@ -17,7 +18,7 @@ withVty f = do
17 mvty <- readIORef global_vty
18 mvty <- readIORef global_vty
18 vty <- case mvty of
19 vty <- case mvty of
19 Nothing -> do
20 Nothing -> do
20− vty <- mkVty
21+ vty <- mkVty def
21 writeIORef global_vty (Just vty)
22 writeIORef global_vty (Just vty)
22 return vty
23 return vty
23 Just vty -> return vty
24 Just vty -> return vty
src/Graphics/Vty/Input/Internal.hs+1−1
@@ -37,7 +37,7 @@ import System.Posix.IO ( fdReadBuf
37import System.Posix.Types (Fd(..))
37import System.Posix.Types (Fd(..))
38
38
39data Config = Config
39data Config = Config
40− { singleEscPeriod :: Int -- ^ The default is 100000 microseconds or 0.1 seconds.
40+ { singleEscPeriod :: Int -- ^ AKA VTIME. The default is 100000 microseconds or 0.1 seconds.
41 } deriving (Show, Eq)
41 } deriving (Show, Eq)
42
42
43instance Default Config where
43instance Default Config where