mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-05-04 09:19:13 -05:00
Fix controller input lingering when unfocused (#210)
This commit is contained in:
@@ -68,7 +68,7 @@ public:
|
||||
|
||||
bool CanPoll()
|
||||
{
|
||||
return controller && (GameWindow::s_isFocused || Config::AllowBackgroundInput);
|
||||
return controller;
|
||||
}
|
||||
|
||||
void PollAxis()
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#include "hid.h"
|
||||
#include <ui/game_window.h>
|
||||
#include <user/config.h>
|
||||
|
||||
hid::EInputDevice hid::g_inputDevice;
|
||||
hid::EInputDevice hid::g_inputDeviceController;
|
||||
@@ -11,6 +13,11 @@ void hid::SetProhibitedButtons(uint16_t wButtons)
|
||||
hid::g_prohibitedButtons = wButtons;
|
||||
}
|
||||
|
||||
bool hid::IsInputAllowed()
|
||||
{
|
||||
return GameWindow::s_isFocused || Config::AllowBackgroundInput;
|
||||
}
|
||||
|
||||
bool hid::IsInputDeviceController()
|
||||
{
|
||||
return hid::g_inputDevice != hid::EInputDevice::Keyboard &&
|
||||
|
||||
@@ -41,6 +41,7 @@ namespace hid
|
||||
uint32_t SetState(uint32_t dwUserIndex, XAMINPUT_VIBRATION* pVibration);
|
||||
uint32_t GetCapabilities(uint32_t dwUserIndex, XAMINPUT_CAPABILITIES* pCaps);
|
||||
|
||||
bool IsInputAllowed();
|
||||
bool IsInputDeviceController();
|
||||
std::string GetInputDeviceName();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user