input: add background input option

Adds an option to disable background input to the IO tab in the settings dialog.
This will disable pad input as well as ps move and overlays input when the window is unfocused.
This commit is contained in:
Megamouse 2022-07-05 21:47:05 +02:00
parent c8c035eeef
commit 4823d4c32a
16 changed files with 196 additions and 92 deletions

View file

@ -21,6 +21,8 @@
LOG_CHANNEL(input_log, "Input");
extern bool is_input_allowed();
namespace pad
{
atomic_t<pad_thread*> g_current = nullptr;
@ -251,7 +253,7 @@ void pad_thread::operator()()
{
while (thread_ctrl::state() != thread_state::aborting)
{
if (!pad::g_enabled || Emu.IsPaused())
if (!pad::g_enabled || Emu.IsPaused() || !is_input_allowed())
{
thread_ctrl::wait_for(10'000);
continue;
@ -267,7 +269,7 @@ void pad_thread::operator()()
while (thread_ctrl::state() != thread_state::aborting)
{
if (!pad::g_enabled || Emu.IsPaused())
if (!pad::g_enabled || Emu.IsPaused() || !is_input_allowed())
{
thread_ctrl::wait_for(10000);
continue;