on master help sign in
remove mkVtyEscDelay. mkVty is sufficient
commit00a6a4fdb516ba4842e29be72cfbb98f035c7f51 authorCorey O'Connor <coreyoconnor@gmail.com> dateFri 24 Jan 2014, 08:11 (13 years ago) parent4ff7b3a
3 files changed+6−16
src/Graphics/Vty.hs+3−14 src/Graphics/Vty/Inline/Unsafe.hs+2−1 src/Graphics/Vty/Input/Internal.hs+1−1
src/Graphics/Vty.hs+3−14
@@ -24,14 +24,10 @@
2424-- - <http://vt100.net/docs/vt100-ug/chapter3.html vt100 control sequences>
2525module Graphics.Vty ( Vty(..)
2626 , mkVty
27− , mkVtyEscDelay
27+ , module Graphics.Vty.Input
2828 , module Graphics.Vty.Output
2929 , module Graphics.Vty.Picture
3030 , DisplayRegion
31− , Key(..)
32− , Modifier(..)
33− , Button(..)
34− , Event(..)
3531 )
3632 where
3733
@@ -88,15 +84,8 @@ data Vty = Vty
8884
8985-- | Set up the state object for using vty. At most one state object should be
9086-- 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
99−mkVtyEscDelay config = do
87+mkVty :: Config -> IO Vty
88+mkVty config = do
10089 input <- input_for_current_terminal config
10190 out <- output_for_current_terminal
10291 intMkVty input out
src/Graphics/Vty/Inline/Unsafe.hs+2−1
@@ -2,6 +2,7 @@ module Graphics.Vty.Inline.Unsafe where
22
33import Graphics.Vty
44
5+import Data.Default
56import Data.IORef
67
78import System.IO.Unsafe
@@ -17,7 +18,7 @@ withVty f = do
1718 mvty <- readIORef global_vty
1819 vty <- case mvty of
1920 Nothing -> do
20− vty <- mkVty
21+ vty <- mkVty def
2122 writeIORef global_vty (Just vty)
2223 return vty
2324 Just vty -> return vty
src/Graphics/Vty/Input/Internal.hs+1−1
@@ -37,7 +37,7 @@ import System.Posix.IO ( fdReadBuf
3737import System.Posix.Types (Fd(..))
3838
3939data 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.
4141 } deriving (Show, Eq)
4242
4343instance Default Config where