Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Feb 2018 17:42:39 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r329386 - head/stand/lua
Message-ID:  <201802161742.w1GHgdDk026930@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802161742.w1GHgdDk026930>