DolphinQt: Give hotkeys their own "background input" setting.

This commit is contained in:
Jordan Woyak
2020-02-07 17:56:13 -06:00
parent a9dc4ac3f0
commit 903db48280
8 changed files with 19 additions and 8 deletions

View File

@ -12,4 +12,6 @@ const ConfigInfo<bool> MAIN_USE_DISCORD_PRESENCE{{System::Main, "General", "UseD
true};
const ConfigInfo<bool> MAIN_USE_GAME_COVERS{{System::Main, "General", "UseGameCovers"}, false};
const ConfigInfo<bool> MAIN_FOCUSED_HOTKEYS{{System::Main, "General", "HotkeysRequireFocus"}, true};
} // namespace Config

View File

@ -18,5 +18,6 @@ namespace Config
extern const ConfigInfo<bool> MAIN_USE_DISCORD_PRESENCE;
extern const ConfigInfo<bool> MAIN_USE_GAME_COVERS;
extern const ConfigInfo<bool> MAIN_FOCUSED_HOTKEYS;
} // namespace Config

View File

@ -1050,11 +1050,10 @@ void DoFrameStep()
}
}
void UpdateInputGate()
void UpdateInputGate(bool require_focus)
{
ControlReference::SetInputGate(
(SConfig::GetInstance().m_BackgroundInput || Host_RendererHasFocus()) &&
!Host_UIBlocksControllerState());
ControlReference::SetInputGate((!require_focus || Host_RendererHasFocus()) &&
!Host_UIBlocksControllerState());
}
} // namespace Core

View File

@ -112,6 +112,6 @@ void HostDispatchJobs();
void DoFrameStep();
void UpdateInputGate();
void UpdateInputGate(bool require_focus);
} // namespace Core

View File

@ -826,7 +826,7 @@ void Update(u64 ticks)
if (s_half_line_of_next_si_poll == s_half_line_count)
{
Core::UpdateInputGate();
Core::UpdateInputGate(!SConfig::GetInstance().m_BackgroundInput);
SerialInterface::UpdateDevices();
s_half_line_of_next_si_poll += 2 * SerialInterface::GetPollXLines();
}