Author: kevans Date: Fri Feb 16 17:42:38 2018 New Revision: 329386 URL: https://svnweb.freebsd.org/changeset/base/329386
Log: stand/lua: Correct usage and acceptance of BACKSPACE/DELETE keys Modified: head/stand/lua/core.lua head/stand/lua/menu.lua head/stand/lua/password.lua Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Fri Feb 16 17:08:42 2018 (r329385) +++ head/stand/lua/core.lua Fri Feb 16 17:42:38 2018 (r329386) @@ -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"; Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Feb 16 17:08:42 2018 (r329385) +++ head/stand/lua/menu.lua Fri Feb 16 17:42:38 2018 (r329386) @@ -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(); Modified: head/stand/lua/password.lua ============================================================================== --- head/stand/lua/password.lua Fri Feb 16 17:08:42 2018 (r329385) +++ head/stand/lua/password.lua Fri Feb 16 17:42:38 2018 (r329386) @@ -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"); _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"