godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.14k stars 96 forks source link

Use symbols when displaying shortcuts #3010

Open timothyqiu opened 3 years ago

timothyqiu commented 3 years ago

Describe the project you are working on

Random game that uses the editor.

Describe the problem or limitation you are having in your project

The shortcut shown in (editor) menus are too long and sometimes longer than the menu item itself. This is especially true on macOS as there are lots of Commands.

For example:

Move Down             Alt+Down
Auto Complete    Control+Space
Undo           Shift+Command+Z

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Shorten the shortcut string by default so that they are short on menu items. It looks better.

The current way of formatting can be kept for easy debugging.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Conform to system standard format of displaying keys/shortcuts when formatting the shortcut.

On Windows, Control+Comma would be Ctrl + ,.

On macOS, symbols are used directly, Shift+Command+Z would be ⇧⌘Z.

Keys like "space" should be localized as they would normally be.

If this enhancement will not be used often, can it be worked around with a few lines of script?

Impossible, I think.

Is there a reason why this should be core and not an add-on in the asset library?

Because it's impossible to be implemented as add-on.

Calinou commented 3 years ago

This can be changed here: https://github.com/godotengine/godot/blob/b76dfde329592ecfd6f6b952082ae21859039e67/core/os/keyboard.cpp

However, be advised that these strings can be saved to configuration files and parsed from those, so changing the key names will break compatibility with existing projects.