xam: disable keyboard input if left alt is down

This prevents the game from receiving erroneous inputs when trying to do ALT+ENTER.
This commit is contained in:
Hyper 2025-01-03 21:16:43 +00:00
parent 0613dc6337
commit b9cffba14d
2 changed files with 4 additions and 4 deletions

View file

@ -406,10 +406,10 @@ SWA_API uint32_t XamInputGetState(uint32_t userIndex, uint32_t flags, XAMINPUT_S
uint32_t result = hid::GetState(userIndex, state);
if (GameWindow::s_isFocused)
{
auto keyboardState = SDL_GetKeyboardState(NULL);
auto keyboardState = SDL_GetKeyboardState(NULL);
if (GameWindow::s_isFocused && !keyboardState[SDL_SCANCODE_LALT])
{
if (keyboardState[SDL_SCANCODE_W])
state->Gamepad.wButtons |= XAMINPUT_GAMEPAD_Y;
if (keyboardState[SDL_SCANCODE_A])

View file

@ -185,7 +185,7 @@ void GameWindow::Init(const char* sdlVideoDriver)
{
// Try matching the current window size with a known configuration.
if (def->Value < 0)
def->Value = GameWindow::FindNearestDisplayMode();
def->Value = FindNearestDisplayMode();
};
Config::WindowSize.ApplyCallback = [](ConfigDef<int32_t>* def)