@@ -33,26 +33,26 @@ import System.Console.Terminfo
3333--
3434-- \todo terminfo meta is not supported.
3535-- \todo no 8bit
36−classifyTableForTerm :: String -> Terminal -> ClassifyTable
37−classifyTableForTerm termName term =
38− concat $ capsClassifyTable term keysFromCapsTable
36+classifyMapForTerm :: String -> Terminal -> ClassifyMap
37+classifyMapForTerm termName term =
38+ concat $ capsClassifyMap term keysFromCapsTable
3939 : universalTable
4040 : termSpecificTables termName
4141
4242-- | key table applicable to all terminals.
4343--
4444-- TODO: some probably only applicable to ANSI/VT100 terminals.
45−universalTable :: ClassifyTable
45+universalTable :: ClassifyMap
4646universalTable = concat [visibleChars, ctrlChars, ctrlMetaChars, specialSupportKeys]
4747
48−capsClassifyTable :: Terminal -> [(String,Event)] -> ClassifyTable
49−capsClassifyTable terminal table = [(x,y) | (Just x,y) <- map extractCap table]
48+capsClassifyMap :: Terminal -> [(String,Event)] -> ClassifyMap
49+capsClassifyMap terminal table = [(x,y) | (Just x,y) <- map extractCap table]
5050 where extractCap = first (getCapability terminal . tiGetStr)
5151
5252-- | tables specific to a given terminal that are not derivable from terminfo.
5353--
5454-- TODO: Adds the ANSI/VT100/VT50 tables regardless of term identifier.
55−termSpecificTables :: String -> [ClassifyTable]
55+termSpecificTables :: String -> [ClassifyMap]
5656termSpecificTables _termName = ANSIVT.classifyTable
5757
5858-- | Visible characters in the ISO-8859-1 and UTF-8 common set.
@@ -62,7 +62,7 @@ termSpecificTables _termName = ANSIVT.classifyTable
6262--
6363-- TODO: resolve
6464-- 1. start at ' '. The earlier characters are all 'ctrlChar'
65−visibleChars :: ClassifyTable
65+visibleChars :: ClassifyMap
6666visibleChars = [ ([x], EvKey (KChar x) [])
6767 | x <- [' ' .. toEnum 0xC1]
6868 ]
@@ -70,7 +70,7 @@ visibleChars = [ ([x], EvKey (KChar x) [])
7070-- | Non visible characters in the ISO-8859-1 and UTF-8 common set translated to ctrl + char.
7171--
7272-- \todo resolve CTRL-i is the same as tab
73−ctrlChars :: ClassifyTable
73+ctrlChars :: ClassifyMap
7474ctrlChars =
7575 [ ([toEnum x],EvKey (KChar y) [MCtrl])
7676 | (x,y) <- zip ([0..31]) ('@':['a'..'z']++['['..'_'])
@@ -79,11 +79,11 @@ ctrlChars =
7979 ]
8080
8181-- | Ctrl+Meta+Char
82−ctrlMetaChars :: ClassifyTable
82+ctrlMetaChars :: ClassifyMap
8383ctrlMetaChars = map (\(s,EvKey c m) -> ('\ESC':s, EvKey c (MMeta:m))) ctrlChars
8484
8585-- | esc, meta esc, delete, meta delete, enter, meta enter
86−specialSupportKeys :: ClassifyTable
86+specialSupportKeys :: ClassifyMap
8787specialSupportKeys =
8888 [ -- special support for ESC
8989 ("\ESC",EvKey KEsc []), ("\ESC\ESC",EvKey KEsc [MMeta])
@@ -150,7 +150,7 @@ specialSupportKeys =
150150-- * kRIT - shift right
151151--
152152-- * kcuu1 - up
153−keysFromCapsTable :: ClassifyTable
153+keysFromCapsTable :: ClassifyMap
154154keysFromCapsTable =
155155 [ ("ka1", EvKey KUpLeft [])
156156 , ("ka3", EvKey KUpRight [])
@@ -180,5 +180,5 @@ keysFromCapsTable =
180180 ] ++ functionKeyCapsTable
181181
182182-- | cap names for function keys
183−functionKeyCapsTable :: ClassifyTable
183+functionKeyCapsTable :: ClassifyMap
184184functionKeyCapsTable = flip map [0..63] $ \n -> ("kf" ++ show n, EvKey (KFun n) [])