on master help sign in
Add rules for keypad keys with Ctrl

Tested with xterm (full success) and rxvt (Home, End and Ins have the same codes with Ctrl, to be being with, but other keys are OK now).

commitd01c8638df78bd76870cc473acee4a1e257ad4e7 authorMikolaj <mikolaj.konarski@gmail.com> dateFri 2 Mar 2012, 20:04 (15 years ago) parenteb390a8
1 file changed+6−2
src/Graphics/Vty/LLInput.hs+6−2
src/Graphics/Vty/LLInput.hs+6−2
@@ -165,18 +165,22 @@ initTermInput escDelay terminal = do
165165 , k "E" KBegin
166166 ],
167167
168− -- Support for arrows
168+ -- Support for arrows and KHome/KEnd
169169 [("\ESC[" ++ charCnt ++ show mc++c,(s,m))
170170 | charCnt <- ["1;", ""], -- we can have a count or not
171171 (m,mc) <- [([MShift],2::Int), ([MCtrl],5), ([MMeta],3),
172172 ([MShift, MCtrl],6), ([MShift, MMeta],4)], -- modifiers and their codes
173− (c,s) <- [("A", KUp), ("B", KDown), ("C", KRight), ("D", KLeft)] -- directions and their codes
173+ (c,s) <- [("A", KUp), ("B", KDown), ("C", KRight), ("D", KLeft), ("H", KHome), ("F", KEnd)] -- directions and their codes
174174 ],
175175
176176 let k n s = ("\ESC["++show n++"~",(s,[]))
177177 in zipWith k [2::Int,3,5,6,1,4]
178178 [KIns,KDel,KPageUp,KPageDown,KHome,KEnd],
179179
180+ let k n s = ("\ESC["++show n++";5~",(s,[MCtrl]))
181+ in zipWith k [2::Int,3,5,6,1,4]
182+ [KIns,KDel,KPageUp,KPageDown,KHome,KEnd],
183+
180184 -- Support for simple characters.
181185 [ (x:[],(KASCII x,[])) | x <- map toEnum [0..255] ],
182186