Run keyboard command processing on every key event to make sure none are missed.

This commit is contained in:
mjbudd77 2021-03-25 04:50:31 -04:00
parent b810164759
commit 739dc2a16d
1 changed files with 4 additions and 2 deletions

View File

@ -1183,13 +1183,15 @@ UpdatePhysicalInput ()
keyModifier = event.key.keysym.mod;
g_keyState[SDL_SCANCODE_LSHIFT] = ( event.key.keysym.mod & KMOD_LSHIFT ) ? 1 : 0;
g_keyState[SDL_SCANCODE_RSHIFT] = ( event.key.keysym.mod & KMOD_RSHIFT ) ? 1 : 0;
g_keyState[SDL_SCANCODE_LALT] = ( event.key.keysym.mod & KMOD_LALT ) ? 1 : 0;
g_keyState[SDL_SCANCODE_LALT] = ( event.key.keysym.mod & KMOD_LALT ) ? 1 : 0;
g_keyState[SDL_SCANCODE_RALT] = ( event.key.keysym.mod & KMOD_RALT ) ? 1 : 0;
g_keyState[SDL_SCANCODE_LCTRL] = ( event.key.keysym.mod & KMOD_LCTRL ) ? 1 : 0;
g_keyState[SDL_SCANCODE_LCTRL] = ( event.key.keysym.mod & KMOD_LCTRL ) ? 1 : 0;
g_keyState[SDL_SCANCODE_RCTRL] = ( event.key.keysym.mod & KMOD_RCTRL ) ? 1 : 0;
g_keyState[ event.key.keysym.scancode ] = (event.type == SDL_KEYDOWN) ? 1 : 0;
KeyboardCommands();
break;
case SDL_JOYDEVICEADDED:
AddJoystick( event.jdevice.which );