mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
Fix gamepad hot-plug detection
This commit is contained in:
parent
bda3b1078a
commit
515c22f50d
|
|
@ -1806,23 +1806,16 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
||||||
InputManager.Tick();
|
InputManager.Tick();
|
||||||
|
|
||||||
// Detect KBM vs controller input mode
|
// Detect KBM vs controller input mode
|
||||||
if (InputManager.IsPadConnected(0))
|
const bool controllerUsed = InputManager.ButtonPressed(0) ||
|
||||||
{
|
InputManager.GetJoypadStick_LX(0, false) != 0.0f ||
|
||||||
const bool controllerUsed = InputManager.ButtonPressed(0) ||
|
InputManager.GetJoypadStick_LY(0, false) != 0.0f ||
|
||||||
InputManager.GetJoypadStick_LX(0, false) != 0.0f ||
|
InputManager.GetJoypadStick_RX(0, false) != 0.0f ||
|
||||||
InputManager.GetJoypadStick_LY(0, false) != 0.0f ||
|
InputManager.GetJoypadStick_RY(0, false) != 0.0f;
|
||||||
InputManager.GetJoypadStick_RX(0, false) != 0.0f ||
|
|
||||||
InputManager.GetJoypadStick_RY(0, false) != 0.0f;
|
|
||||||
|
|
||||||
if (controllerUsed)
|
if (controllerUsed)
|
||||||
g_KBMInput.SetKBMActive(false);
|
g_KBMInput.SetKBMActive(false);
|
||||||
else if (g_KBMInput.HasAnyInput())
|
else if (g_KBMInput.HasAnyInput())
|
||||||
g_KBMInput.SetKBMActive(true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
g_KBMInput.SetKBMActive(true);
|
g_KBMInput.SetKBMActive(true);
|
||||||
}
|
|
||||||
|
|
||||||
if (!g_KBMInput.IsMouseGrabbed())
|
if (!g_KBMInput.IsMouseGrabbed())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue