summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend/mame/ui
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2021-06-24 23:52:57 +1000
committer Vas Crabb <vas@vastheman.com>2021-06-24 23:52:57 +1000
commitc13dd1446be251f6dc278dbd537a6783da9db43d (patch)
treeaa7db9bab93ba84fe7012c149d063e8dfc3b7503 /src/frontend/mame/ui
parent50da25ae5bd89c625c64d75d8a7c43c04b7cd618 (diff)
frontend: On input mapping menus, use UI left/right to switch between setting and appending to an input sequence.
Diffstat (limited to 'src/frontend/mame/ui')
-rw-r--r--src/frontend/mame/ui/inputmap.cpp10
-rw-r--r--src/frontend/mame/ui/menu.cpp6
-rw-r--r--src/frontend/mame/ui/menu.h13
3 files changed, 18 insertions, 11 deletions
diff --git a/src/frontend/mame/ui/inputmap.cpp b/src/frontend/mame/ui/inputmap.cpp
index 5b63ec0bc0f..1f07a0d098d 100644
--- a/src/frontend/mame/ui/inputmap.cpp
+++ b/src/frontend/mame/ui/inputmap.cpp
@@ -224,7 +224,7 @@ void menu_input_specific::populate(float &customtop, float &custombottom)
if (!data.empty())
populate_sorted(customtop, custombottom);
else
- item_append(_("This machine has no input map."), FLAG_DISABLE, nullptr);
+ item_append(_("This machine has no configurable inputs."), FLAG_DISABLE, nullptr);
item_append(menu_item_type::SEPARATOR);
}
@@ -335,7 +335,7 @@ void menu_input::handle()
bool invalidate = false;
// process the menu
- const event *const menu_event = process((pollingitem != nullptr) ? PROCESS_NOKEYS : 0);
+ const event *const menu_event = process(pollingitem ? PROCESS_NOKEYS : PROCESS_LR_ALWAYS);
if (pollingitem)
{
// if we are polling, handle as a special case
@@ -413,6 +413,12 @@ void menu_input::handle()
record_next = false;
seqchangeditem = &item;
break;
+
+ case IPT_UI_LEFT: // flip between set and append
+ case IPT_UI_RIGHT: // not very discoverable, but with the prompt it isn't opaque
+ if (record_next || !item.seq.empty())
+ record_next = !record_next;
+ break;
}
// if the selection changed, reset the "record next" flag
diff --git a/src/frontend/mame/ui/menu.cpp b/src/frontend/mame/ui/menu.cpp
index c53736b2ab4..8eb1eab47c9 100644
--- a/src/frontend/mame/ui/menu.cpp
+++ b/src/frontend/mame/ui/menu.cpp
@@ -995,7 +995,7 @@ void menu::handle_keys(uint32_t flags, int &iptkey)
}
// bail out
- if ((flags & PROCESS_ONLYCHAR))
+ if (flags & PROCESS_ONLYCHAR)
return;
// hitting cancel also pops the stack
@@ -1010,8 +1010,8 @@ void menu::handle_keys(uint32_t flags, int &iptkey)
validate_selection(1);
// swallow left/right keys if they are not appropriate
- bool ignoreleft = ((selected_item().flags & FLAG_LEFT_ARROW) == 0);
- bool ignoreright = ((selected_item().flags & FLAG_RIGHT_ARROW) == 0);
+ bool ignoreleft = !(flags & PROCESS_LR_ALWAYS) && !(selected_item().flags & FLAG_LEFT_ARROW);
+ bool ignoreright = !(flags & PROCESS_LR_ALWAYS) && !(selected_item().flags & FLAG_RIGHT_ARROW);
if ((m_items[0].flags & FLAG_UI_DATS))
ignoreleft = ignoreright = false;
diff --git a/src/frontend/mame/ui/menu.h b/src/frontend/mame/ui/menu.h
index 8cd0057fc58..bb99e84f0ad 100644
--- a/src/frontend/mame/ui/menu.h
+++ b/src/frontend/mame/ui/menu.h
@@ -139,12 +139,13 @@ protected:
// flags to pass to process
enum
{
- PROCESS_NOKEYS = 1,
- PROCESS_LR_REPEAT = 2,
- PROCESS_CUSTOM_ONLY = 4,
- PROCESS_ONLYCHAR = 8,
- PROCESS_NOINPUT = 16,
- PROCESS_NOIMAGE = 32
+ PROCESS_NOKEYS = 1 << 0,
+ PROCESS_LR_ALWAYS = 1 << 1,
+ PROCESS_LR_REPEAT = 1 << 2,
+ PROCESS_CUSTOM_ONLY = 1 << 3,
+ PROCESS_ONLYCHAR = 1 << 4,
+ PROCESS_NOINPUT = 1 << 5,
+ PROCESS_NOIMAGE = 1 << 6
};
// options for reset