From ea9566443c725c3893cef5cbbc8ee7c0b095d685 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Sun, 2 Sep 2012 22:57:08 -0700 Subject: [PATCH] edwin: Fixed arrow keys in xterms. Added ts-enter/exit-keypad-mode and used them in console-enter/exit!. --- src/edwin/termcap.scm | 4 ++++ src/edwin/tterm.scm | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/edwin/termcap.scm b/src/edwin/termcap.scm index be5ff78b9..7daa828dd 100644 --- a/src/edwin/termcap.scm +++ b/src/edwin/termcap.scm @@ -101,10 +101,12 @@ USA. (ts-enter-insert-mode false read-only true) (ts-enter-standout-mode false read-only true) (ts-enter-termcap-mode false read-only true) + (ts-enter-keypad-mode false read-only true) (ts-exit-delete-mode false read-only true) (ts-exit-insert-mode false read-only true) (ts-exit-standout-mode false read-only true) (ts-exit-termcap-mode false read-only true) + (ts-exit-keypad-mode false read-only true) (ts-forward-scroll false read-only true) (ts-forward-scroll-multi false read-only true) (ts-insert-char false read-only true) @@ -249,10 +251,12 @@ USA. ts-enter-insert-mode ts-enter-standout-mode (termcap-get-string "ti") ;ts-enter-termcap-mode + (termcap-get-string "ks") ;ts-enter-keypad-mode (termcap-get-string "ed") ;ts-exit-delete-mode (termcap-get-string "ei") ;ts-exit-insert-mode ts-exit-standout-mode (termcap-get-string "te") ;ts-exit-termcap-mode + (termcap-get-string "ke") ;ts-exit-keypad-mode ts-forward-scroll ts-forward-scroll-multi ts-insert-char diff --git a/src/edwin/tterm.scm b/src/edwin/tterm.scm index 9ae354ec7..0879913ef 100644 --- a/src/edwin/tterm.scm +++ b/src/edwin/tterm.scm @@ -515,6 +515,7 @@ USA. (define (console-enter! screen) (add-event-receiver! event:console-resize resize-screen) (maybe-output screen (ts-enter-termcap-mode (screen-description screen))) + (maybe-output screen (ts-enter-keypad-mode (screen-description screen))) (set-screen-cursor-x! screen false) (set-screen-cursor-y! screen false)) @@ -524,6 +525,7 @@ USA. (move-cursor screen 0 (fix:-1+ (screen-y-size screen))) (exit-standout-mode screen) (exit-insert-mode screen) + (maybe-output screen (ts-exit-keypad-mode description)) (maybe-output screen (ts-exit-termcap-mode description))) (output-port/flush-output console-i/o-port)) -- 2.25.1