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

@ -43,6 +43,8 @@ void usb_device_buzz::control_transfer(u8 bmRequestType, u8 bRequest, u16 wValue
}
}
extern bool is_input_allowed();
void usb_device_buzz::interrupt_transfer(u32 buf_size, u8* buf, u32 /*endpoint*/, UsbTransfer* transfer)
{
transfer->fake = true;
@ -60,6 +62,11 @@ void usb_device_buzz::interrupt_transfer(u32 buf_size, u8* buf, u32 /*endpoint*/
buf[3] = 0x00;
buf[4] = 0xf0;
if (!is_input_allowed())
{
return;
}
std::lock_guard lock(pad::g_pad_mutex);
const auto handler = pad::get_current_handler();
const auto& pads = handler->GetPads();