Developer Framework TextInput Component does QWERTZ wrong for UNDO and REDO shortcuts, even in Next Gen Explorer

Description

 

Basically, when I press Z it triggers Y.

This video shows old (Qt behavior) and new behavior.

This probably relates to an old post I made here. And now I finally remember the issue.

It was for things like these.

Or well, you just have to detect QWERTY or QWERTZ and swap Y and Z out.

 

game:GetService("UserInputService").InputBegan:Connect(function(inputObject) print(inputObject.KeyCode) end)

Basically, if I click Z it will trigger KeyCode.Y. The same goes for ContextActionService. While that’s its intended behavior, maybe Roblox didn’t forsee this problem.

Look at JavaScript. https://www.toptal.com/developers/keycode

It does also say that it detects the same KeyCode, yes. But you’re able to see which event.key :thinking:

SpecialKeyPressed probably can be compared to event.key.

While you don’t on UserInputService or ContextActionService…

But there’s some more additional info.

 

If I swap to an QWERTZ Keyboard Layout, like German. If I click Z it will tell me that I clicked KeyY and z. And if I click Y it will tell me I clicked KeyZ and y.

There’s also some other issues with… UserInputService but…

print(game:GetService("UserInputService"):GetStringForKeyCode(Enum.KeyCode.Y))

This would return Z for me. And if you’re on a US Layout, then it returns Y.

But this function won’t update if you change your keyboard layout while Roblox Studio is open, so it’s also gonna give you different information. (A different bug)

 

Re-production Steps

If you’re on Windows, you can add multiple Keyboard Layouts to the thing at the bottom right next to the thing that shows the current time! Somewhere in the settings.

Make sure you add a QWERTZ layout, like German.

  1. Locate the Explorer Search Text Box or any Developer Framework TextInput Component
  2. Type in something
  3. Do CTRL + [DEFINE_1] where DEFINE_1 is the letter after T on your keyboard. QWERTZ. So here I’d press Z. If you’re on QWERTY, you have to press Y. Because your Y now does “strings” as Z.
  4. Observe

 

Expected Result

When I do CTRL + Z on QWERTZ, I expect it to do UNDO and handle my keypress as CTRL + Z.

That what I see on my keyboard, is what I get.

Other applications do this right. e.g. Google Chrome, Qt. etc.

Actual Result

When I click CTRL + Z on QWERTZ. It will intercept it as CTRL + Y and call it the day.

That what I see on my keyboard is not what I get…

3 Likes

This is intended behavior.

This is also intended behavior.
The Roblox input system is designed to keep consistent positions of the key bindings, not letters/symbols. Using the US layout as a reference.
This is a valid approach as otherwise, people with Russian layout as an example wouldn’t be able to do anything in-game because Latin letters don’t exist on it.
Listening to keyboard input for text input is one thing, listening to keyboard input for key bindings is another, and you can’t treat these the same way

Yeah, I was inaccurate with the comparisons, I will edit it. The intended behavior was mentioned to explain why KeyCode.Z is at Y for me, for instance.

I am pretty sure they’d of have want to have it consistently CTRL + Z for everyone (as written, not KeyCode position).

I haven’t ever looked into how popular Software deal with this issue for keyboard layouts.

 

So, I’ve done some research and apparently they’re called Keyboard Accelerators.

There’s Key Codes and then there’s Virtual Key Codes.