-
-
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
Allow shortcuts to have any number of input events assigned to them. #51273
Allow shortcuts to have any number of input events assigned to them. #51273
Conversation
I am not sure if #51215 should be merged before or after this... Probably before? |
feed3d7
to
1ade5c6
Compare
Either way works for me, but I'd need someone to approve it to merge ;) |
41617e6
to
a42c556
Compare
Needs a rebase. |
a42c556
to
46ca88a
Compare
Rebased. Also had to make some changes to fix the inspector refresh bug. I follow what was done in #52082, which is basically just making the backing field and Anyway, it all appears to be working as expected. |
df23d3d
to
6961f40
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.
Looks good to me, couple small nitpicks but nothing major.
6961f40
to
b7974b4
Compare
b7974b4
to
ad30b0a
Compare
Thanks! |
Closes godotengine/godot-proposals#2875
Supersedes / Closes #48009
This is based on discussion on Rocket chat as well as feedback in the above proposal and PR.
Summary:
Shortcut
can now have manyInputEvent
s assigned to it (related; Shortcut: Renameshortcut
property toevent
#51215)Node
rather than being aControl
. This is becauseEditorSettingsDialog
needed to be the node which theTree
drag was forwarded to, but asWindow
is not aControl
, I had to change this toNode
.The the editor settings shows up to 2 shortcuts in-line, and the additional amount in parentheses. The next tree level then shows all shortcuts, where they can be edited or removed. The user can drag and drop shortcuts to determine which one is the "primary" one. The primary shortcut is what is displayed in the UI, for example in
PopupMenu
s with items that have shortcuts, or inButton
tooltips, as shown in the video. In the video, any shortcut (E, Ctrl+R, Ctrl+Shit+T) could be used to select the rotate mode.shortcut_changing.mp4
For users, the shortcuts resource now includes an array, which accepts any
InputEvent
derived resource. Please note when editing this in the inspector, this is affected by the new "inspector refresh" system, as described here: #49817. To test this PR properly and be able to drop down the array item selector, change your inspector refresh interval in your settings to a high value (e.g. 5 seconds). P.S. yes, the button in the video should say "press S", its just a typo :)shortcuts.showcase.mp4
And for serialization of shortcut editor settings, a bit simpler now: