From f7631619d325d1825081c521f8808103817bcc69 Mon Sep 17 00:00:00 2001 From: minjaesong Date: Fri, 24 Sep 2021 15:02:41 +0900 Subject: [PATCH] shell now accepts envvar KEYBOARD and changes key layout on the fly --- assets/JS_INIT.js | 2 +- assets/disk0/tvdos/bin/command.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/assets/JS_INIT.js b/assets/JS_INIT.js index 58577d4..e1678c2 100644 --- a/assets/JS_INIT.js +++ b/assets/JS_INIT.js @@ -426,7 +426,7 @@ con.KEY_INSERT = 210; con.KEY_DELETE = 211; con.KEY_BACKSPACE = 8; con.KEY_TAB = 9; -con.KEY_RETURN = 13; +con.KEY_RETURN = 10; con.getch = function() { return sys.readKey(); }; diff --git a/assets/disk0/tvdos/bin/command.js b/assets/disk0/tvdos/bin/command.js index 1c262c7..676c383 100644 --- a/assets/disk0/tvdos/bin/command.js +++ b/assets/disk0/tvdos/bin/command.js @@ -319,6 +319,10 @@ shell.coreutils = { } else { _TVDOS.variables[key] = shell.replaceVarCall(value); + + // if key is KEYBOARD, reload the keyboard layout + if ("KEYBOARD" == key) + input.changeKeyLayout(_TVDOS.variables.KEYBOARD || "us_qwerty"); } } },