Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use physical key for shortcuts inside the Editor #6245

Closed
hakro opened this issue Feb 6, 2023 · 3 comments
Closed

Use physical key for shortcuts inside the Editor #6245

hakro opened this issue Feb 6, 2023 · 3 comments

Comments

@hakro
Copy link

hakro commented Feb 6, 2023

Describe the project you are working on

Currently, when using shortcuts to select, move, rotate and scale object, we can respectively use Q, W, E and R.

2023-02-06_18-09

This works fine when using a QWERTY layout, and it makes sense, since those keys are contiguous, and thus easy to remember and get used to.

However, it not as practical when using other layouts, including AZERTY. The shortcuts become all over the place, and hard to get used to, as they are not aligned with the buttons on the editor, nor do they have a resemblance to the action itself (think G to Grab, S to Scale, R to Rotate)

Describe the problem or limitation you are having in your project

This is just a minor annoyance, but that can be avoided, when you want to rely on shortcuts and have a keyboard layout that is not QWERTY
I theory, this won't have an impact on people using QWERTY keyboards, but would be useful for other layouts.

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

I mentioned this to @akien-mga this W.E while in Fosdem, and he suggested using physical keys for the shortcuts instead of the key values, which sounds like a good solution.
That way, the four first letter of the keyboard will always map to the correct actions, regardless of keyboard layout.
This proposal's purpose, is to follow up on that discussion.

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

Nothing much to say; "just" need to update the shortcuts to use physical key input.
The double quotes around "just", is because I don't know exactly how to do that yet, but I'll definitely have a look to see if it's a quick fix

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

This a QoL improvement on the editor.
It could be possible to manually change the shortcuts in the Editor preferences, but some people, including myself, would rather have an out of the box coherent experience

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

This is related to the editor, there is no point to have as a separate add-on, if that's even possible.

@Calinou
Copy link
Member

Calinou commented Feb 6, 2023

Duplicate of godotengine/godot#11777 (this is considered a bug).

@Calinou Calinou closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2023
@hakro
Copy link
Author

hakro commented Feb 21, 2023

This can now easily be fixed if godotengine/godot#73651 is merged.

Just by adding the p_physical = true parameter here :

https://github.com/godotengine/godot/blob/662d0b188dc2bd6ca50ea0c3b3b9accb8255acfc/editor/plugins/node_3d_editor_plugin.cpp#L8051

like this :

tool_button[TOOL_MODE_SELECT]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_select", TTR("Select Mode"), Key::Q, true));

However, there is something wrong with the button tooltip in the editor. It will say : Select Mode (Q(Physical))
which is quite confusing an not very user friendly IMHO, especially for non-QWERTY users, where the real shortcut would be A

2023-02-21_12-31

On the tooltip display code, using as_text_keycode() instead of in the as_text() prints (Unset). This is the normal behavior according to the InputEventKey documentation which states the following :

2023-02-21_12-24

So as_text_keycode() only works when an event is received, which is not the case when displaying the tooltip.

@Calinou, @EricEzaM, any idea on how to make this more user friendly ?

@Calinou
Copy link
Member

Calinou commented Feb 21, 2023

I don't think we can access every keyboard layout out there, so there is no way to display the actual key you should press on your current keyboard layout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants