on master help sign in
Graphics.Vty.Input.Terminfo: haddock pass
commitc85a0586e830248d021942b45a26b83f0dfbbfa5 authorJonathan Daugherty <cygnus@foobox.com> dateSun 22 Jan 2017, 15:09 (10 years ago) parentde3a203
1 file changed+17−17
src/Graphics/Vty/Input/Terminfo.hs+17−17
src/Graphics/Vty/Input/Terminfo.hs+17−17
@@ -7,8 +7,8 @@ import qualified Graphics.Vty.Input.Terminfo.ANSIVT as ANSIVT
77import Control.Arrow
88import System.Console.Terminfo
99
10−-- | Queries the terminal for all capability based input sequences then
11−-- adds on a terminal dependent input sequence mapping.
10+-- | Queries the terminal for all capability-based input sequences and
11+-- then adds on a terminal-dependent input sequence mapping.
1212--
1313-- For reference see:
1414--
@@ -20,25 +20,26 @@ import System.Console.Terminfo
2020--
2121-- * http://aperiodic.net/phil/archives/Geekery/term-function-keys.html
2222--
23−-- This is painful. Terminfo is incomplete. The vim source implies that
24−-- terminfo is also incorrect. Vty assumes that the an internal terminfo
25−-- table added to the system provided terminfo table is correct.
23+-- Terminfo is incomplete. The vim source implies that terminfo is also
24+-- incorrect. Vty assumes that the internal terminfo table added to the
25+-- system-provided terminfo table is correct.
2626--
27−-- 1. build terminfo table for all caps. Missing caps are not added.
27+-- The procedure used here is:
2828--
29−-- 2. add tables for visible chars, esc, del plus ctrl and meta
29+-- 1. Build terminfo table for all caps. Missing caps are not added.
3030--
31−-- 3. add internally defined table for given terminal type.
31+-- 2. Add tables for visible chars, esc, del, ctrl, and meta.
3232--
33−-- Precedence is currently implicit in the 'compile' algorithm. Which is
34−-- a bit odd.
33+-- 3. Add internally-defined table for given terminal type.
34+--
35+-- Precedence is currently implicit in the 'compile' algorithm.
3536classifyMapForTerm :: String -> Terminal -> ClassifyMap
3637classifyMapForTerm termName term =
3738 concat $ capsClassifyMap term keysFromCapsTable
3839 : universalTable
3940 : termSpecificTables termName
4041
41−-- | key table applicable to all terminals.
42+-- | The key table applicable to all terminals.
4243--
4344-- Note that some of these entries are probably only applicable to
4445-- ANSI/VT100 terminals.
@@ -66,7 +67,7 @@ visibleChars = [ ([x], EvKey (KChar x) [])
6667 | x <- [' ' .. toEnum 0xC1]
6768 ]
6869
69−-- | Non visible characters in the ISO-8859-1 and UTF-8 common set
70+-- | Non-printable characters in the ISO-8859-1 and UTF-8 common set
7071-- translated to ctrl + char.
7172--
7273-- This treats CTRL-i the same as tab.
@@ -82,7 +83,7 @@ ctrlChars =
8283ctrlMetaChars :: ClassifyMap
8384ctrlMetaChars = map (\(s,EvKey c m) -> ('\ESC':s, EvKey c (MMeta:m))) ctrlChars
8485
85−-- | esc, meta esc, delete, meta delete, enter, meta enter
86+-- | Esc, meta-esc, delete, meta-delete, enter, meta-enter.
8687specialSupportKeys :: ClassifyMap
8788specialSupportKeys =
8889 [ -- special support for ESC
@@ -95,9 +96,8 @@ specialSupportKeys =
9596 , ("\t", EvKey (KChar '\t') [])
9697 ]
9798
98−-- | classify table directly generated from terminfo cap strings
99−--
100−-- these are:
99+-- | A classification table directly generated from terminfo cap
100+-- strings. These are:
101101--
102102-- * ka1 - keypad up-left
103103--
@@ -179,6 +179,6 @@ keysFromCapsTable =
179179 , ("kcuu1", EvKey KUp [])
180180 ] ++ functionKeyCapsTable
181181
182−-- | cap names for function keys
182+-- | Cap names for function keys.
183183functionKeyCapsTable :: ClassifyMap
184184functionKeyCapsTable = flip map [0..63] $ \n -> ("kf" ++ show n, EvKey (KFun n) [])