stand/lua: Correct usage and acceptance of BACKSPACE/DELETE keys

This commit is contained in:
Kyle Evans 2018-02-16 17:42:38 +00:00
parent dfbc272d5d
commit 1504bce32d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=329386
3 changed files with 5 additions and 3 deletions

View File

@ -29,8 +29,9 @@
local core = {};
-- Commonly appearing constants
core.KEY_BACKSPACE = 8;
core.KEY_ENTER = 13;
core.KEY_BACKSPACE = 127;
core.KEY_DELETE = 127;
core.KEYSTR_ESCAPE = "\027";

View File

@ -266,7 +266,8 @@ function menu.run(m)
local key = io.getchar();
-- Special key behaviors
if (key == core.KEY_BACKSPACE) and (m ~= menu.welcome) then
if ((key == core.KEY_BACKSPACE) or (key == core.KEY_DELETE)) and
(m ~= menu.welcome) then
break
elseif (key == core.KEY_ENTER) then
core.boot();

View File

@ -41,7 +41,7 @@ function password.read()
break;
end
if ch == core.KEY_BACKSPACE then
if (ch == core.KEY_BACKSPACE) or (ch == core.KEY_DELETE) then
if n > 0 then
n = n - 1;
-- loader.printc("\008 \008");