Keybinds use scancodes instead of keycodes

Unreal Editor on Linux uses scancodes instead of keycodes, meaning that if the user has swapped control and caps lock in Xorg, keybinds such as ‘Undo’ require the user to press control on the physical location on the keyboard instead of the actual location (the caps lock key). Using scancodes may also result in interpreting some non-en-US keys wrongly.

Just tried; European keys such as Ö, Ä and Å are not recognised at all.

We should be using keycodes. Could you log out what is received in SDL_KEYDOWN/SDL_KEYUP in LinuxApplication.cpp?

How do I do this? Do I need to compile a debug build?

Hey vihannes-

You do not need to compile a debug build for this. You should be able to print the values to the log. This is done by editing the LinuxApplication.cpp file and add UE_LOG(LogLinux, Log, ....).

If you’re unsure how to do this, please provide the steps for the test you’re using so that I can attempt to reproduce the results you’re seeing locally.

Hello Vihannes,

I was not able to reproduce this issue when changing my keyboard layout to German then pressing the physical location for Y while I had a textbox selected in the editor. I got a Z as expected.

I changed my keyboard layout by going to System Settings > Keyboard > Text Entry and adding the German input source.
I also had to set the current layout to German in the top right corner of Ubuntu.

More information on what steps you were using to reproduce this issue would be greatly appreciated.

also this wiki page contains more information on using the UE_LOG: A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums

Sorry for answering late and being inept, but I’m a bit confused. Don’t I need to compile the editor newly after changing LinuxApplication.cpp? I added some logging in both functions that handle SDL key down events but didn’t see anything in the log. I’m asking because I somewhere that Unreal uses C++ for scripting and I’m not sure how that works or if the editor even uses it like that.

You would need to recompile after editing the .cpp file, yes. However it does not specifically have to be a debug build. If possible, can you provide the setup and steps for the tests you’re running and how you’re getting the results you’re seeing so that I can try to reproduce the issue on my machine?