From 29b1a3d97d3b585dcd783580618205dd12f9a50f Mon Sep 17 00:00:00 2001 From: kevans Date: Wed, 14 Feb 2018 20:18:23 +0000 Subject: [PATCH] stand/lua: Exit sub-menus on backspace --- stand/lua/menu.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/stand/lua/menu.lua b/stand/lua/menu.lua index 73d14958fcee..73ad91f435ae 100644 --- a/stand/lua/menu.lua +++ b/stand/lua/menu.lua @@ -270,8 +270,14 @@ function menu.run(m) cont = true; while cont do - local key = string.char(io.getchar()); + local key = io.getchar(); + -- Exit on backspace + if (key == 127) and (m ~= menu.welcome) then + break + end + + key = string.char(key) -- check to see if key is an alias local sel_entry = nil; for k, v in pairs(alias_table) do