diff options
author | 2019-11-20 03:55:28 +1100 | |
---|---|---|
committer | 2019-11-20 03:55:28 +1100 | |
commit | e87447e37d80a26df102a85dcc5e46bdafd5571d (patch) | |
tree | d307738d5d751442549684f28b7bc6c43c462997 /src/frontend/mame/ui/inputmap.cpp | |
parent | 593b3d9fe1d8fe301b55463f1d7f1d1521f88199 (diff) |
UI: when modifying an input mapping, only cycle default/none if UI_CANCEL is the first thing pressed
(nw) It's annoying that if you accidentally start to change an input, there's no way to
back out at all. You need to press something before it will do anything. Also, if you
go to add an additional "or" combination and press the wrong thing, you can't back out
just the change - hitting UI_CANCEL takes you back to the default. This at least
partially addresses it: if you hit UI_SELECT to modify an input then hit UI_CANCEL
immediately, it will cycle default/none; however if you press any other input first and
then hit UI_CANCEL, it will just back out the change. The implementation is a bit
whacky at the moment, but doing better would require another emu.h change which I don't
want to do right now.
Diffstat (limited to 'src/frontend/mame/ui/inputmap.cpp')
-rw-r--r-- | src/frontend/mame/ui/inputmap.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/frontend/mame/ui/inputmap.cpp b/src/frontend/mame/ui/inputmap.cpp index 16c91c5cb89..a740fcfc720 100644 --- a/src/frontend/mame/ui/inputmap.cpp +++ b/src/frontend/mame/ui/inputmap.cpp @@ -295,9 +295,16 @@ void menu_input::handle() { // if UI_CANCEL is pressed, abort pollingitem = nullptr; - record_next = false; - toggle_none_default(item->seq, starting_seq, *item->defseq); - seqchangeditem = item; + if (machine().input().seq_poll_final() == init_poll_seq) + { + record_next = false; + toggle_none_default(item->seq, starting_seq, *item->defseq); + seqchangeditem = item; + } + else + { + invalidate = true; + } } else if (machine().input().seq_poll()) { @@ -319,6 +326,7 @@ void menu_input::handle() lastitem = item; starting_seq = item->seq; machine().input().seq_poll_start((item->type == INPUT_TYPE_ANALOG) ? ITEM_CLASS_ABSOLUTE : ITEM_CLASS_SWITCH, record_next ? &item->seq : nullptr); + init_poll_seq = machine().input().seq_poll_final(); invalidate = true; break; |