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

@ -1,8 +1,8 @@
#include "stdafx.h"
#include "Emu/IdManager.h"
#include "Emu/system_config.h"
#include "Emu/Cell/PPUModule.h"
#include "Emu/Cell/lv2/sys_process.h"
#include "Emu/Io/pad_types.h"
#include "Input/pad_thread.h"
#include "Input/product_info.h"
@ -11,6 +11,8 @@
extern void libio_sys_config_init();
extern void libio_sys_config_end();
extern bool is_input_allowed();
LOG_CHANNEL(sys_io);
template<>
@ -197,7 +199,7 @@ void pad_get_data(u32 port_no, CellPadData* data)
const auto setting = config.port_setting[port_no];
bool btnChanged = false;
if (rinfo.ignore_input)
if (rinfo.ignore_input || !is_input_allowed())
{
// Needed for Hotline Miami and Ninja Gaiden Sigma after dialogs were closed and buttons are still pressed.
// Gran Turismo 6 would keep registering the Start button during OSK Dialogs if this wasn't cleared and if we'd return with len as CELL_PAD_LEN_NO_CHANGE.