summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/uiinput.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2021-03-12 01:15:08 +1100
committer Vas Crabb <vas@vastheman.com>2021-03-12 01:15:08 +1100
commit4cf96da22c09651c1da2b27ee61028d558e7af49 (patch)
tree4482cdc706be33b29d050fb8b0f84c457ba20ba9 /src/emu/uiinput.cpp
parentb38a77bca54c007f995b9bb47687354d154b6be5 (diff)
-A few incremental UI code improvements:
* Simplified message when toggling UI controls. * Show actual configured UI toggle key, not misleading hard-coded text. * Push window activated/deactivated events to UI manager. * Simplified SDL window event handling code - events are pretty precise. -Miscellaneous code cleanup.
Diffstat (limited to 'src/emu/uiinput.cpp')
-rw-r--r--src/emu/uiinput.cpp42
1 files changed, 34 insertions, 8 deletions
diff --git a/src/emu/uiinput.cpp b/src/emu/uiinput.cpp
index 497ce3e7030..d1398591687 100644
--- a/src/emu/uiinput.cpp
+++ b/src/emu/uiinput.cpp
@@ -295,11 +295,37 @@ g_profiler.stop();
}
/*-------------------------------------------------
+ push_window_focus_event - pushes a focus
+ event to the specified render_target
+-------------------------------------------------*/
+
+void ui_input_manager::push_window_focus_event(render_target *target)
+{
+ ui_event event = { ui_event::type::NONE };
+ event.event_type = ui_event::type::WINDOW_FOCUS;
+ event.target = target;
+ push_event(event);
+}
+
+/*-------------------------------------------------
+ push_window_defocus_event - pushes a defocus
+ event to the specified render_target
+-------------------------------------------------*/
+
+void ui_input_manager::push_window_defocus_event(render_target *target)
+{
+ ui_event event = { ui_event::type::NONE };
+ event.event_type = ui_event::type::WINDOW_DEFOCUS;
+ event.target = target;
+ push_event(event);
+}
+
+/*-------------------------------------------------
push_mouse_move_event - pushes a mouse
move event to the specified render_target
-------------------------------------------------*/
-void ui_input_manager::push_mouse_move_event(render_target* target, s32 x, s32 y)
+void ui_input_manager::push_mouse_move_event(render_target *target, s32 x, s32 y)
{
ui_event event = { ui_event::type::NONE };
event.event_type = ui_event::type::MOUSE_MOVE;
@@ -314,7 +340,7 @@ void ui_input_manager::push_mouse_move_event(render_target* target, s32 x, s32 y
mouse leave event to the specified render_target
-------------------------------------------------*/
-void ui_input_manager::push_mouse_leave_event(render_target* target)
+void ui_input_manager::push_mouse_leave_event(render_target *target)
{
ui_event event = { ui_event::type::NONE };
event.event_type = ui_event::type::MOUSE_LEAVE;
@@ -327,7 +353,7 @@ void ui_input_manager::push_mouse_leave_event(render_target* target)
down event to the specified render_target
-------------------------------------------------*/
-void ui_input_manager::push_mouse_down_event(render_target* target, s32 x, s32 y)
+void ui_input_manager::push_mouse_down_event(render_target *target, s32 x, s32 y)
{
ui_event event = { ui_event::type::NONE };
event.event_type = ui_event::type::MOUSE_DOWN;
@@ -342,7 +368,7 @@ void ui_input_manager::push_mouse_down_event(render_target* target, s32 x, s32 y
down event to the specified render_target
-------------------------------------------------*/
-void ui_input_manager::push_mouse_up_event(render_target* target, s32 x, s32 y)
+void ui_input_manager::push_mouse_up_event(render_target *target, s32 x, s32 y)
{
ui_event event = { ui_event::type::NONE };
event.event_type = ui_event::type::MOUSE_UP;
@@ -357,7 +383,7 @@ push_mouse_down_event - pushes a mouse
down event to the specified render_target
-------------------------------------------------*/
-void ui_input_manager::push_mouse_rdown_event(render_target* target, s32 x, s32 y)
+void ui_input_manager::push_mouse_rdown_event(render_target *target, s32 x, s32 y)
{
ui_event event = { ui_event::type::NONE };
event.event_type = ui_event::type::MOUSE_RDOWN;
@@ -372,7 +398,7 @@ push_mouse_down_event - pushes a mouse
down event to the specified render_target
-------------------------------------------------*/
-void ui_input_manager::push_mouse_rup_event(render_target* target, s32 x, s32 y)
+void ui_input_manager::push_mouse_rup_event(render_target *target, s32 x, s32 y)
{
ui_event event = { ui_event::type::NONE };
event.event_type = ui_event::type::MOUSE_RUP;
@@ -387,7 +413,7 @@ void ui_input_manager::push_mouse_rup_event(render_target* target, s32 x, s32 y)
a mouse double-click event to the specified
render_target
-------------------------------------------------*/
-void ui_input_manager::push_mouse_double_click_event(render_target* target, s32 x, s32 y)
+void ui_input_manager::push_mouse_double_click_event(render_target *target, s32 x, s32 y)
{
ui_event event = { ui_event::type::NONE };
event.event_type = ui_event::type::MOUSE_DOUBLE_CLICK;
@@ -401,7 +427,7 @@ void ui_input_manager::push_mouse_double_click_event(render_target* target, s32
push_char_event - pushes a char event
to the specified render_target
-------------------------------------------------*/
-void ui_input_manager::push_char_event(render_target* target, char32_t ch)
+void ui_input_manager::push_char_event(render_target *target, char32_t ch)
{
ui_event event = { ui_event::type::NONE };
event.event_type = ui_event::type::IME_CHAR;