From 09877a4f62d6473ccfea350f7ad754660d442498 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Wed, 30 Oct 2024 04:35:10 +1100 Subject: [PATCH] -ui/selmenu.cpp: Don't ignore character input when no pointer is active. -ui/menu.cpp: Handle menus resetting items from custom pointer handlers better. --- src/frontend/mame/ui/menu.cpp | 3 ++- src/frontend/mame/ui/selmenu.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/frontend/mame/ui/menu.cpp b/src/frontend/mame/ui/menu.cpp index 740a310e2f5..76f77261ea0 100644 --- a/src/frontend/mame/ui/menu.cpp +++ b/src/frontend/mame/ui/menu.cpp @@ -1177,13 +1177,14 @@ std::pair menu::handle_pointer_update(uint32_t flags, ui_event const // give derived class a chance to handle it if ((track_pointer::IDLE == m_pointer_state) || (track_pointer::CUSTOM == m_pointer_state)) { + bool const wascustom(track_pointer::CUSTOM == m_pointer_state); auto const [key, take, redraw] = custom_pointer_updated(changed, uievt); if (take) { m_pointer_state = track_pointer::CUSTOM; return std::make_pair(key, redraw); } - else if (track_pointer::CUSTOM == m_pointer_state) + else if (wascustom) { if (uievt.pointer_buttons) { diff --git a/src/frontend/mame/ui/selmenu.cpp b/src/frontend/mame/ui/selmenu.cpp index 1c1933721db..e06103db3d0 100644 --- a/src/frontend/mame/ui/selmenu.cpp +++ b/src/frontend/mame/ui/selmenu.cpp @@ -1733,7 +1733,7 @@ bool menu_select_launch::handle_events(u32 flags, event &ev) // text input goes to the search field unless there's an error message displayed case ui_event::type::IME_CHAR: - if (!pointer_idle()) + if (have_pointer() && !pointer_idle()) break; if (exclusive_input_pressed(ev.iptkey, IPT_UI_FOCUS_NEXT, 0) || exclusive_input_pressed(ev.iptkey, IPT_UI_FOCUS_PREV, 0))