summaryrefslogtreecommitdiffstatshomepage
path: root/plugins/inputmacro/inputmacro_menu.lua
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2023-02-18 06:18:45 +1100
committer Vas Crabb <vas@vastheman.com>2023-02-18 06:18:45 +1100
commitd4589e0b29d6085072ff635d87c3d95c21813a58 (patch)
treec0d3283ecdd99bd380fc155f4e09b7f4bd573116 /plugins/inputmacro/inputmacro_menu.lua
parent20d7135179ffe9959f4bfb759a0e5735b7aaaf15 (diff)
Input refactoring:
osd/modules/input, emu/inpttype.cpp: Made most default joystick assignments supplied by input modules. Input modules take available controls into consideration when generating default assignments. emu/inpttype.ipp: Added a separate "Back" UI input separate from Cancel. You may want an easier to hit combination for moving to the previous menu than for exiting or cancelling input. They both default to Escape. emu/inpttype.ipp: Added a UI Help control. Currently only used by analog inputs menu emu/inpttype.h: Moved I/O port field type enum to its own header and sorted UI controls so they appear in a more logical order. ui: Don't use UI Select to restore defaults - people should be getting used to the UI Clear input by now. UI Select cycles multi-value items instead. ui/inputmap.cpp: Don't use immediate cancel to cycle between clearing and restoring default assignment (use UI Clear instead). osd: Reduced the number of files needing to include the dreaded emu.h. Got some implementation out of headers.
Diffstat (limited to 'plugins/inputmacro/inputmacro_menu.lua')
-rw-r--r--plugins/inputmacro/inputmacro_menu.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/inputmacro/inputmacro_menu.lua b/plugins/inputmacro/inputmacro_menu.lua
index 3ef5aa3f6e7..48fef405d0f 100644
--- a/plugins/inputmacro/inputmacro_menu.lua
+++ b/plugins/inputmacro/inputmacro_menu.lua
@@ -160,6 +160,8 @@ local function handle_edit_items(index, event)
end
edit_name_buffer = nil
return true
+ elseif event == 'back' then
+ return true -- swallow back while editing text
elseif event == 'cancel' then
edit_name_buffer = nil
return true
@@ -434,7 +436,7 @@ local function handle_add(index, event)
local handled, selection = handle_edit_items(index, event)
if handled then
return true, selection
- elseif event == 'cancel' then
+ elseif event == 'back' then
edit_current_macro = nil
edit_menu_active = false
edit_items = nil
@@ -458,7 +460,7 @@ local function handle_edit(index, event)
local handled, selection = handle_edit_items(index, event)
if handled then
return true, selection
- elseif (event == 'cancel') or ((index == edit_item_exit) and (event == 'select')) then
+ elseif (event == 'back') or ((index == edit_item_exit) and (event == 'select')) then
edit_current_macro = nil
edit_menu_active = false
edit_items = nil