mirror of
https://github.com/LCEMP/LCEMP.git
synced 2026-07-18 18:28:06 +00:00
fix: improve input and fix debug menu crash
This commit is contained in:
@@ -1185,6 +1185,25 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
||||
PIXBeginNamedEvent(0,"Input manager tick");
|
||||
InputManager.Tick();
|
||||
|
||||
// detect input mode
|
||||
if (InputManager.IsPadConnected(0))
|
||||
{
|
||||
bool controllerUsed = InputManager.ButtonPressed(0) ||
|
||||
InputManager.GetJoypadStick_LX(0, false) != 0.0f ||
|
||||
InputManager.GetJoypadStick_LY(0, false) != 0.0f ||
|
||||
InputManager.GetJoypadStick_RX(0, false) != 0.0f ||
|
||||
InputManager.GetJoypadStick_RY(0, false) != 0.0f;
|
||||
|
||||
if (controllerUsed)
|
||||
g_KBMInput.SetKBMActive(false);
|
||||
else if (g_KBMInput.HasAnyInput())
|
||||
g_KBMInput.SetKBMActive(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_KBMInput.SetKBMActive(true);
|
||||
}
|
||||
|
||||
PIXEndNamedEvent();
|
||||
PIXBeginNamedEvent(0,"Profile manager tick");
|
||||
// ProfileManager.Tick();
|
||||
|
||||
Reference in New Issue
Block a user