-ui/selmenu.cpp: Don't ignore character input when no pointer is active.
Some checks failed
CI (Linux) / build-linux (-U_FORTIFY_SOURCE, gcc, gcc, g++, mametiny, tiny) (push) Has been cancelled
CI (Linux) / build-linux (clang, clang, clang++, mame, mame) (push) Has been cancelled
CI (macOS) / build-macos (push) Has been cancelled
CI (Windows) / build-windows (clang, clang, clang++, mametiny, tiny) (push) Has been cancelled
CI (Windows) / build-windows (gcc, gcc, g++, mame, mame) (push) Has been cancelled
XML/JSON validation / validate (push) Has been cancelled

-ui/menu.cpp: Handle menus resetting items from custom pointer handlers better.
This commit is contained in:
Vas Crabb 2024-10-30 04:35:10 +11:00
parent 31d5a50e8a
commit 09877a4f62
2 changed files with 3 additions and 2 deletions

View file

@ -1177,13 +1177,14 @@ std::pair<int, bool> 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)
{

View file

@ -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))