From d5eb1cc0361fe4eae5edc1c8a140a4e94800db3d Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Wed, 17 Feb 2021 19:08:10 +0100 Subject: [PATCH] Fix dead key handling This fixes deadkey handling on at least US International on Linux. --- src/openrct2-ui/UiContext.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/openrct2-ui/UiContext.cpp b/src/openrct2-ui/UiContext.cpp index fad17f5223..76c09aae80 100644 --- a/src/openrct2-ui/UiContext.cpp +++ b/src/openrct2-ui/UiContext.cpp @@ -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)); }