-
-
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
Remove hardcoded shortcuts from /scene and instead use the input action system to allow them to be customised. #43663
Remove hardcoded shortcuts from /scene and instead use the input action system to allow them to be customised. #43663
Conversation
21b1a10
to
c23cb4d
Compare
c23cb4d
to
a3ac092
Compare
Requesting review from @Paulb23 as we had quite the dialog about this PR in the associated proposal thread, and I believe he is fairly well acquainted with this part of the code. |
For the reference, here's the list of default actions in the InputMap as of this PR. I know #42600 might refine this further but this might still be worth a discussion on whether all of those should really be configurable (like caret up/right bound to Up/Right), or if they should be renamed/better sorted to make it more obvious what is being affected by those. My main concern seeing this list is that it's huge for something that most users won't even want to configure. On the other hand the same can likely be said of some of the original So IMO it's most important to ensure that the InputMap editor in the Project Settings will be as user-friendly as possible, even more so than the Editor Settings' shortcut configuration tab which is more advanced / less critical to each project. Again, this might be handled in #42600 already but discussion there seemed to focus on the Editor Settings. I'll give it a try to see. User-defined actions and advanced UI configuration should probably be separated so that users can focus on their game actions first and foremost, and cater to fine tuning of Control actions only when they needed it (very rare cases IMO). |
@akien-mga yes that pr deals with that issue, see below Gif |
@akien-mga There should also be a full list at input_map.cpp @ line 267 Here I put the builtin action display names, for cases where they need to be displayed in a popup menu (like cut, copy paste, etc).
|
Hmm those descriptions will also need a |
a156bee
to
1242b2e
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.
Code looks fine to me, I think this level of configuration is okay, mainly comes down to having a suitable UX, which is easier said then done. The other point is needing someway to document or as perhaps as part of the UX, that appending .OSX
overrides it for apple keyboards. Though similar to Aiken suggestion in #42600, it might be worth doing the UX changes as a separate proposal / PR so we don't get bogged down here.
Needs a hefty rebase after #41100, which also adds a new shortcut ui_swap_input_direction = KEY_QUOTELEFT
to LineEdit
and TextEdit
.
Lastly, found #22927 which this should close.
1242b2e
to
3e3ff29
Compare
Rebased. This should include all changes from the #41100 PR. |
7b60e5a
to
a132e89
Compare
Thanks! |
It's in! How exciting! I'm really happy with how this simplifies the logic in gui input for text and line edit |
@EricEzaM Thanks for the work here. |
@christinoleo Thanks for pointing this out! Perhaps a new action needs to be created, specifically for accepting auto-complete options, which only includes tab, enter and kp_enter. |
How should we implement this for use in the editor? Having to edit project-specific settings to tweak autocompletion to your liking sounds bad, since you don't want to commit that to version control for your whole team. Personally, I'd prefer to have only Tab accept suggestions, but I understand most people want Enter to accept suggestions as well. |
@Calinou never mind actually - it is a very easy fix. For some reason I check for both Lines 3262 to 3266 in ed2f51b
|
I tried the latest release candidate (rc3) but my modified "cut" hotkey still is ignored |
Which shortcut have you modified, and what exactly are you trying to do to test it? |
Oh, i just realised that there is a seperate "cut" command for the scene tree. I did not find it at first since i use the german version of the editor and unlike "ui_cut", the "scene tree cut" has already been translated into german. However i find it a bit weird that "ui_undo" and "ui_redo" can affect the scene tree as expected, while "ui_cut" is specific to the text editor. Anyways, at least my issue is solved now. |
gui_input
with things likeif (k->is_pressed() && k->get_keycode() == KEY_C && k->get_command() == true){ /* copy */}
godot/scene/gui/text_edit.cpp
Lines 2876 to 2945 in 07112b9
Quite hard to follow in my opinion. This logic now looks like this, except the following logic can use any key combination, not just the left arrow key.
The keys used to perform these actions are defined in InputMap:
Added Utility Method
Added static methods
::create_reference
on InputEventKey and JoypadButton which is a one-line way to do:The above code is used in many places with Buttons and Keys, so moving it to a utility one-liner saves A LOT of lines of code, at least a couple hundred lines.
Unified definitions of the same shortcuts
Moved builtin input actions away from being defined twice in ProjectSettings and EditorSettings to only being defined once in InputMap. Project/Editor Settings instead just get the builtin actions and loop through them to add them to their settings list. Reduces code duplication.
Closes #17927
Closes #29490
Closes #12164
Closes #42139
Closes #26854
Closes godotengine/godot-proposals#1532
This is the fourth PR of a larger series based on #42600.