From owner-svn-src-head@freebsd.org Fri Feb 16 17:42:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7282F031D0; Fri, 16 Feb 2018 17:42:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5939887E9D; Fri, 16 Feb 2018 17:42:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5405610E6D; Fri, 16 Feb 2018 17:42:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1GHgdWU026933; Fri, 16 Feb 2018 17:42:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1GHgdDk026930; Fri, 16 Feb 2018 17:42:39 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802161742.w1GHgdDk026930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 16 Feb 2018 17:42:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329386 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 329386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Feb 2018 17:42:39 -0000 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");