1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Fix dead key handling

This fixes deadkey handling on at least US International on Linux.
This commit is contained in:
Gymnasiast
2021-02-17 19:08:10 +01:00
committed by Ted John
parent 2b14fe9d7f
commit d5eb1cc036

View File

@@ -531,6 +531,21 @@ public:
ie.DeviceKind = InputDeviceKind::Keyboard;
ie.Modifiers = e.key.keysym.mod;
ie.Button = e.key.keysym.sym;
// Handle dead keys
if (ie.Button == SDLK_SCANCODE_MASK)
{
switch (e.key.keysym.scancode)
{
case SDL_SCANCODE_APOSTROPHE:
ie.Button = '\'';
break;
case SDL_SCANCODE_GRAVE:
ie.Button = '`';
break;
default:
break;
}
}
ie.State = InputEventState::Down;
_inputManager.QueueInputEvent(std::move(ie));
}