mirror of
https://github.com/holub/mame
synced 2025-04-23 08:49:55 +03:00
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
This commit is contained in:
parent
2cad578c21
commit
631fd6601b
@ -1269,6 +1269,7 @@ running_machine::running_machine(const game_driver *driver)
|
||||
priority_bitmap(NULL),
|
||||
sample_rate(0),
|
||||
debug_flags(0),
|
||||
ui_active(0),
|
||||
mame_data(NULL),
|
||||
cpuexec_data(NULL),
|
||||
timer_data(NULL),
|
||||
|
@ -259,6 +259,9 @@ public:
|
||||
/* debugger-related information */
|
||||
UINT32 debug_flags; /* the current debug flags */
|
||||
|
||||
/* UI-related */
|
||||
int ui_active; /* ui active or not (useful for games / systems with keyboard inputs) */
|
||||
|
||||
/* generic pointers */
|
||||
generic_pointers generic; /* generic pointers */
|
||||
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user