Maniphest T79574

Incorrect key labels for keyboard shortcuts in menus
Closed, Archived

Assigned To
Richard Antalik (ISS)
Authored By
Liggliluff (Liggli)
Aug 6 2020, 2:28 AM
Tags
  • BF Blender
Subscribers
Liggliluff (Liggli)
Richard Antalik (ISS)

Description

System Information
Operating system: Windows 10 Pro (10.0.18362.900)

Blender Version
Broken: 2.83.4

Short description of error
Key labels are always displayed based on the US English keyboard, regardless of the keyboard used by the user.

Exact steps for others to reproduce the error

  1. Change the keyboard layout to German (you don't need an actual German keyboard)
  2. Launch Blender (to make sure it reads the latest keyboard)
  3. Go to Edit > Preferences > Keymaps
  4. Edit a keyboard shortcut, and press the keyboard key right of L

Expected symbol: ö
Actual symbol: `

Explanation

This is because the German key Ö (right of L) is VK_OEM_3, which is the ` key on the US layout. So Blender outputs the symbol ` for VK_OEM_3 regardless of what symbol is actually outputted.

Example of Blender drop down menu with keyboard shortcuts, with annotation of the correct German labels

Example of Visual Code, drop down menu with the correct German keyboard shortcuts – Notice the Ctrl+# close to the bottom, which wouldn't be valid on a US keyboard (it would say Ctrl+3 for that symbol). This keyboard shortcut would appear as Ctrl+/ when using a US keyboard layout.

What to fix
By Windows standard, VK_A through VK_Z should output A through Z, VK_0 through VK_9 should output 0 through 9. The remaining VK code should output the symbol of the unshifted state. These symbols should not be hardcoded like they are in Blender right now.

VK code

A VK_ code is a virtual key code, so you can request to press VK_Z, which will be the Z key regardless if you use QWERTY, AZERTY, QWERTZ, Dvorak or any other layout. But you can't read a litteral Z character because then Russian, Greek and other non-Latin keyboards won't work. The virtual key codes are not located at the same places across all keyboards. As stated above, the VK_OEM_3 is located to the right of L on a German keyboard (key Ö), and located to the left of 1 on an American keyboard (key ` ).

Related Objects

Event Timeline

Liggliluff (Liggli) created this task.Aug 6 2020, 2:28 AM
Richard Antalik (ISS) closed this task as Archived.Aug 6 2020, 6:46 AM
Richard Antalik (ISS) claimed this task.
Richard Antalik (ISS) added a subscriber: Richard Antalik (ISS).

This is not a bug, but it is a TODO listed here T68884

So I will close this report