diff options
author | 2023-02-18 06:18:45 +1100 | |
---|---|---|
committer | 2023-02-18 06:18:45 +1100 | |
commit | d4589e0b29d6085072ff635d87c3d95c21813a58 (patch) | |
tree | c0d3283ecdd99bd380fc155f4e09b7f4bd573116 /plugins/commonui/init.lua | |
parent | 20d7135179ffe9959f4bfb759a0e5735b7aaaf15 (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/commonui/init.lua')
-rw-r--r-- | plugins/commonui/init.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/commonui/init.lua b/plugins/commonui/init.lua index 064d87c2c5e..5219e7dbb9e 100644 --- a/plugins/commonui/init.lua +++ b/plugins/commonui/init.lua @@ -106,7 +106,7 @@ function commonui.input_selection_menu(action, title, filter) function menu:handle(index, event) local selection - if (event == 'cancel') or ((index == input_item_cancel) and (event == 'select')) then + if (event == 'back') or ((index == input_item_cancel) and (event == 'select')) then action(nil) return true elseif event == 'select' then @@ -177,16 +177,18 @@ function commonui.switch_polling_helper(starting_sequence) if uiinput:pressed(cancel) then -- UI_CANCEL pressed, abort machine:popmessage() + uiinput:reset() if (not poller.modified) or (modified_ticks == emu.osd_ticks()) then -- cancelled immediately - self.sequence = nil - return true -- TODO: communicate this better? + self.sequence = nil -- TODO: communicate this better? + return true else -- entered something before cancelling self.sequence = nil return true end elseif poller:poll() then + uiinput:reset() if poller.valid then -- valid sequence entered machine:popmessage() |