summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/windows/winmain.c
diff options
context:
space:
mode:
author David Haywood <mamehaze@users.noreply.github.com>2015-09-14 02:08:12 +0100
committer David Haywood <mamehaze@users.noreply.github.com>2015-09-14 02:08:12 +0100
commitf93c013f8b464050a962fd881f14e2c094909240 (patch)
tree8c50efc90c60389d09253884fc23281851afbae2 /src/osd/windows/winmain.c
parent884e4460ae32fbe78f75412cbb104019eea7eea3 (diff)
added 'global_inputs' (disabled by default) to allow MAME to read inputs even when it doesn't have the focus [Scrooge McClunk]
SailorSat made it possible to run multiple instances of MAME for link games, but the problem is that you can only control one MAME instance at a time (the window that has focus). Because win32 MAME supports RawInput, we can make linked games playable with global inputs that will poll simultaneously regardless of whether that MAME instance has focus. In win32 MAME using RawInput, keyboards were already registered for global inputs (RIDEV_INPUTSINK), but the polling code checks if the window has focus, so it wasn't taking advantage of it. I thought it'd be a good idea to add an option for global inputs to win32 MAME with RawInput. The WINOPTION is the "global_inputs" boolean. The option is disabled by default because this is an uncommon use case for MAME. The option is also disabled when forcing direct input and debugging. If the RawInput initialization code fails for whatever reason, the option will not be enabled. If the option is disabled, keyboards are no longer registered for global inputs (dwFlags set to 0 instead of RIDEV_INPUTSINK), because they won't work globally with the screen focus check anyway.
Diffstat (limited to 'src/osd/windows/winmain.c')
-rw-r--r--src/osd/windows/winmain.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/osd/windows/winmain.c b/src/osd/windows/winmain.c
index 74317eb30aa..406cb18c3ec 100644
--- a/src/osd/windows/winmain.c
+++ b/src/osd/windows/winmain.c
@@ -373,6 +373,7 @@ const options_entry windows_options::s_option_entries[] =
// input options
{ NULL, NULL, OPTION_HEADER, "INPUT DEVICE OPTIONS" },
+ { WINOPTION_GLOBAL_INPUTS ";global_inputs", "0", OPTION_BOOLEAN, "enable global inputs" },
{ WINOPTION_DUAL_LIGHTGUN ";dual", "0", OPTION_BOOLEAN, "enable dual lightgun input" },
{ NULL }