@@ -165,18 +165,22 @@ initTermInput escDelay terminal = do
165 , k "E" KBegin
165 , k "E" KBegin
168− -- Support for arrows
168+ -- Support for arrows and KHome/KEnd
169 [("\ESC[" ++ charCnt ++ show mc++c,(s,m))
169 [("\ESC[" ++ charCnt ++ show mc++c,(s,m))
170 | charCnt <- ["1;", ""], -- we can have a count or not
170 | charCnt <- ["1;", ""], -- we can have a count or not
171 (m,mc) <- [([MShift],2::Int), ([MCtrl],5), ([MMeta],3),
171 (m,mc) <- [([MShift],2::Int), ([MCtrl],5), ([MMeta],3),
172 ([MShift, MCtrl],6), ([MShift, MMeta],4)], -- modifiers and their codes
172 ([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
176 let k n s = ("\ESC["++show n++"~",(s,[]))
176 let k n s = ("\ESC["++show n++"~",(s,[]))
177 in zipWith k [2::Int,3,5,6,1,4]
177 in zipWith k [2::Int,3,5,6,1,4]
178 [KIns,KDel,KPageUp,KPageDown,KHome,KEnd],
178 [KIns,KDel,KPageUp,KPageDown,KHome,KEnd],
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],
180 -- Support for simple characters.
184 -- Support for simple characters.
181 [ (x:[],(KASCII x,[])) | x <- map toEnum [0..255] ],
185 [ (x:[],(KASCII x,[])) | x <- map toEnum [0..255] ],