diff options
Diffstat (limited to 'src/osd/modules/input/input_sdl.cpp')
-rw-r--r-- | src/osd/modules/input/input_sdl.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/osd/modules/input/input_sdl.cpp b/src/osd/modules/input/input_sdl.cpp index b54af499dbb..295935fda88 100644 --- a/src/osd/modules/input/input_sdl.cpp +++ b/src/osd/modules/input/input_sdl.cpp @@ -1859,6 +1859,11 @@ public: virtual void input_init(running_machine &machine) override { + auto &sdlopts = downcast<sdl_options const &>(*options()); + bool const sixaxis_mode = sdlopts.sixaxis(); + + if (!machine().options().debug && sdlopts.background_input()) + SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1"); SDL_SetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, "0"); init_joystick(); @@ -1867,8 +1872,6 @@ public: sdl_joystick_module_base::input_init(machine); - bool const sixaxis_mode = downcast<const sdl_options *>(options())->sixaxis(); - osd_printf_verbose("Joystick: Start initialization\n"); for (int physical_stick = 0; physical_stick < SDL_NumJoysticks(); physical_stick++) create_joystick_device(machine, physical_stick, sixaxis_mode); @@ -1947,11 +1950,13 @@ public: virtual void input_init(running_machine &machine) override { - SDL_SetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, "0"); - auto &sdlopts = downcast<sdl_options const &>(*options()); bool const sixaxis_mode = sdlopts.sixaxis(); + if (!machine().options().debuge() && sdlopts.background_input()) + SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1"); + SDL_SetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, "0"); + init_joystick(); if (!have_joystick()) return; |