From 608a2607ca06f3e8d7df0eb2cf716691e9b2a4cf Mon Sep 17 00:00:00 2001
From: Oliver Schmidt
Date: Mon, 22 May 2017 00:41:42 +0200
Subject: [PATCH] Fixed Cursor Control Key Codes.
http://vt100.net/docs/vt100-ug/table3-6.html says that ESC O A..D is to be send if Cursor Key Mode is set and http://vt100.net/docs/vt100-ug/chapter3.html says "A mode is considered set until it is reset by a reset mode (RM) control sequence.". So ESC O A..D is the default.
Beside this spec perspective sending ESC O A..D instead of ESC [ A..D makes i.e. aptitude and midnight commander work out-of-the-box.
---
drivers/a2vt100.s | 8 ++++----
drivers/c64vt100.s | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/a2vt100.s b/drivers/a2vt100.s
index 332d284..24980bb 100644
--- a/drivers/a2vt100.s
+++ b/drivers/a2vt100.s
@@ -814,10 +814,10 @@ POrts rts
;
; -------------------------------------
-ScrsrU .byt $1b, $5b, $41, $00 ; esc [ A
-ScrsrD .byt $1b, $5b, $42, $00 ; esc [ B
-ScrsrR .byt $1b, $5b, $43, $00 ; esc [ C
-ScrsrL .byt $1b, $5b, $44, $00 ; esc [ D
+ScrsrU .byt $1b, $4f, $41, $00 ; esc O A
+ScrsrD .byt $1b, $4f, $42, $00 ; esc O B
+ScrsrR .byt $1b, $4f, $43, $00 ; esc O C
+ScrsrL .byt $1b, $4f, $44, $00 ; esc O D
CmdKey tya ; restore character
diff --git a/drivers/c64vt100.s b/drivers/c64vt100.s
index 03617c3..49261c5 100644
--- a/drivers/c64vt100.s
+++ b/drivers/c64vt100.s
@@ -976,10 +976,10 @@ POrts rts
; params: key in y
; -------------------------------------
-ScrsrU .byt $1b, $5b, $41, $00 ; esc [ A
-ScrsrD .byt $1b, $5b, $42, $00 ; esc [ B
-ScrsrR .byt $1b, $5b, $43, $00 ; esc [ C
-ScrsrL .byt $1b, $5b, $44, $00 ; esc [ D
+ScrsrU .byt $1b, $4f, $41, $00 ; esc O A
+ScrsrD .byt $1b, $4f, $42, $00 ; esc O B
+ScrsrR .byt $1b, $4f, $43, $00 ; esc O C
+ScrsrL .byt $1b, $4f, $44, $00 ; esc O D
StrKey tya ; restore key