SDL: Ignore unused key modifiers

This commit is contained in:
Connor McLaughlin 2020-05-27 00:27:52 +10:00
parent 445bd02cad
commit eb6b490c76

View file

@ -472,8 +472,7 @@ void SDLHostInterface::HandleSDLEvent(const SDL_Event* event)
{ {
if (!ImGui::GetIO().WantCaptureKeyboard && event->key.repeat == 0) if (!ImGui::GetIO().WantCaptureKeyboard && event->key.repeat == 0)
{ {
const HostKeyCode code = static_cast<HostKeyCode>(static_cast<u32>(event->key.keysym.sym) | const HostKeyCode code = static_cast<HostKeyCode>(SDLKeyNames::KeyEventToInt(event));
static_cast<u32>(event->key.keysym.mod) << 16);
const bool pressed = (event->type == SDL_KEYDOWN); const bool pressed = (event->type == SDL_KEYDOWN);
HandleHostKeyEvent(code, pressed); HandleHostKeyEvent(code, pressed);
} }