stand/lua: Correct usage and acceptance of BACKSPACE/DELETE keys
This commit is contained in:
parent
dfbc272d5d
commit
1504bce32d
@ -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";
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user