diff options
author | 2010-06-06 05:56:47 +0000 | |
---|---|---|
committer | 2010-06-06 05:56:47 +0000 | |
commit | 631fd6601bcac8ec8d7d1319b2bb29f55ec520d2 (patch) | |
tree | 4fdff6227da44de56f77d9d74b23cfe38907b313 /src/emu/ui.c | |
parent | 2cad578c2106c971c01e42ea83cc1ee29298b3d8 (diff) |
Added ui_active to running_machine so that it can be accessed by the OSD input code. A clean compile is probably required. No whatsnew needed.
Brief explaination: ui_active is a variable which helps systems with keyboard input devices (mainly MESS computers, but it might be handy when MAME fully emulates games like Typing of the Dead) to determine if keys like 'P', 'TAB', 'ESC', etc. should be interpreted as UI actions (pause, enter menu, quit emu...) or as inputs in the emulated keyboard.
this change is to allow for additional OSD-specific inputs (which are defined osd/ sources) to check for ui_active before getting detected, in case they collide with emulated inputs
Diffstat (limited to 'src/emu/ui.c')
-rw-r--r-- | src/emu/ui.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/emu/ui.c b/src/emu/ui.c index 0e12e721389..439607f33c8 100644 --- a/src/emu/ui.c +++ b/src/emu/ui.c @@ -122,7 +122,6 @@ static rgb_t messagebox_backcolor; static slider_state *slider_list; static slider_state *slider_current; -static int ui_active; /* natural keyboard info */ static int ui_use_natural_keyboard; static UINT8 non_char_keys_down[(ARRAY_LENGTH(non_char_keys) + 7) / 8]; @@ -255,7 +254,6 @@ int ui_init(running_machine *machine) /* reset globals */ single_step = FALSE; ui_set_handler(handler_messagebox, 0); - ui_active = 0; /* retrieve options */ ui_use_natural_keyboard = options_get_bool(mame_options(), OPTION_NATURAL_KEYBOARD); @@ -1299,7 +1297,7 @@ static UINT32 handler_ingame(running_machine *machine, render_container *contain } /* determine if we should disable the rest of the UI */ - int ui_disabled = (input_machine_has_keyboard(machine) && !ui_active); + int ui_disabled = (input_machine_has_keyboard(machine) && !machine->ui_active); /* is ScrLk UI toggling applicable here? */ if (input_machine_has_keyboard(machine)) @@ -1308,10 +1306,10 @@ static UINT32 handler_ingame(running_machine *machine, render_container *contain if (ui_input_pressed(machine, IPT_UI_TOGGLE_UI)) { /* toggle the UI */ - ui_active = !ui_active; + machine->ui_active = !machine->ui_active; /* display a popup indicating the new status */ - if (ui_active) + if (machine->ui_active) { ui_popup_time(2, "%s\n%s\n%s\n%s\n%s\n%s\n", "Keyboard Emulation Status", |