From 536ecccd455e598dfeba17a5dc089b08d73a9530 Mon Sep 17 00:00:00 2001 From: Nathan Woods Date: Sat, 12 Apr 2014 17:21:38 +0000 Subject: [PATCH] Swallowing shortcut keys the first time the menu comes up; now ESC in the F4 menu won't break out --- src/emu/ui/menubar.c | 4 +++- src/emu/ui/menubar.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/emu/ui/menubar.c b/src/emu/ui/menubar.c index bbc04d2e14d..2b5ab15cf68 100644 --- a/src/emu/ui/menubar.c +++ b/src/emu/ui/menubar.c @@ -65,6 +65,7 @@ ui_menubar::ui_menubar(running_machine &machine) m_mouse_y = -1; m_mouse_button = false; m_last_mouse_move = 0; + m_first_time = true; } @@ -239,7 +240,8 @@ bool ui_menubar::event_loop() if (!done) { bool navigation_input_pressed = poll_navigation_keys(); - poll_shortcut_keys(navigation_input_pressed); + poll_shortcut_keys(navigation_input_pressed || m_first_time); + m_first_time = false; done = true; } return done; diff --git a/src/emu/ui/menubar.h b/src/emu/ui/menubar.h index 84903ef5a83..57417e0f0e4 100644 --- a/src/emu/ui/menubar.h +++ b/src/emu/ui/menubar.h @@ -226,6 +226,7 @@ private: float m_checkmark_width; osd_ticks_t m_last_mouse_move; menubar_visibility_t m_menubar_visibility; + bool m_first_time; // selection walking bool walk_selection_previous();