-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Make GridMap shortcuts editable and not conflict with other plugins #79529
Conversation
When using editor shortcuts, we notice that most of the shortcuts of the gridmap are inaccessible because they are conflicting with the 3D Editor shortcuts:
However, I found a way to prevent forwarding the shortcuts events to the node_3d_editor_plugin by iterating on all the menu item shortcuts in I wonder if it's the right way to do it. Looking forward (no pun intended) for a review. |
1df8f35
to
22224d9
Compare
The implementation looks alright, but the physical shortcuts are questionable. We don't use physical keys for shortcuts (see godotengine/godot-proposals#7303). Also your choice of physical keys is rather arbitrary; at best it only helps users with a specific layout (I assume AZERTY or similar).
I don't remember seeing menu shortcuts iterated like this before, but it looks correct. |
Physicals are used because I'm assuming theses keys are meant to be in close physical proximity. QWE (floors and clear rotation) Are clearly meant to be grouped together. I agree that making all of them (rather than cherry-picked ones) physical would make more sense. You're right I'm using azerty! |
f5248f1
to
e9d8ced
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation looks alright.
I still think that physical keys shouldn't be used. CC @Calinou
@KoBeWi Here is what the keyboard shortcuts look like on a QWERTY keyboard: Notice how they are nicely laid out.
Here it what it looks like in AZERTY: It's super confusing! I agree with you that physical keycodes should be avoided most of the time but I think this feature, just like the FreeCam, justify their use. What do you think? |
f3a0e31
to
9ac814b
Compare
I borrowed your idea to open another PR (#80317) and actually discovered a bug that also exists in your code. You can use Ref<InputEventKey> k = p_event;
if (k.is_valid() && k->is_pressed() && !k->is_echo()) { You should do the same. |
Co-authored-by: Tomek <kobewi4e@gmail.com>
9ac814b
to
f80f4eb
Compare
I think physical keys make sense here. The criterion is simple:
So here the shortcuts seem to be positioned as an equivalent to the NumPad and they should stay there, not move around arbitrarily based on the keyboard layout (AZERTY is a common issue, but test DVORAK...). |
Thanks! |
This allows users to change shortcuts for the gridmap and also makes them more discoverable.
It now uses physical keycodes, where appropriate, to make the tool more accessible to non-qwerty keyboard users.
This also prevents shortcut events to be forwarded to the 3D editor plugin, avoiding conflicts.
fixes: #67497.
supersedes: #79377
supersedes: #75243
Closes: godotengine/godot-proposals#3839