From fb7b55fb111d0a2acf7ad13bbd5cbaad0ca12c19 Mon Sep 17 00:00:00 2001 From: myk002 Date: Sun, 6 Nov 2022 16:47:45 -0800 Subject: [PATCH] open gui/launcher with the command on right arrow --- plugins/lua/hotkeys.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/lua/hotkeys.lua b/plugins/lua/hotkeys.lua index e83cf9586..921a1fd9b 100644 --- a/plugins/lua/hotkeys.lua +++ b/plugins/lua/hotkeys.lua @@ -126,11 +126,13 @@ function MenuScreen:onSelect(_, choice) end function MenuScreen:onSubmit(_, choice) + if not choice then return end self:dismiss() dfhack.run_command(choice.command) end function MenuScreen:onSubmit2(_, choice) + if not choice then return end self:dismiss() dfhack.run_script('gui/launcher', choice.command) end @@ -139,6 +141,9 @@ function MenuScreen:onInput(keys) if keys.LEAVESCREEN then self:dismiss() return true + elseif keys.STANDARDSCROLL_RIGHT then + self:onSubmit2(self.subviews.list:getSelected()) + return true end return self:inputToSubviews(keys) end