-
-
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
Editor defined shortcut access via script. #78072
Comments
For support questions and help please first turn to the other community channels, this is for bug reporting, not a help desk. I'd argue this is an improvement proposal, best served over at proposals, be sure to follow the instructions. Edit: can you try |
Actually is_shortcut () tests an InputEvent against a shortcut, eg. "Script Editor/Find" which is exactly what I want. As for get_editor_interface ().get_editor_settings ().shortcuts, I can't find that anywhere. No mention in the documentation. |
Yes, but you asked about retrieving it, and I know it's not documented, but it is a property, and I asked if you could test if it works as I'm not by my computer atm, try if that will return a list of shortcuts In either case I'd suggest opening a proposal for adding this feature as it's not necessarily a bug that it isn't available, and would need some working out of the specifics |
I only wanted to retrieve the property to test against an InputEvent, eg. in _shortcut_input () or one of the other _input () type functions. I tried what you suggested and an error is issued because no "shortcut" property exists. You may be getting confused with the "Shortcuts" TAB in the Editor Settings dialog in the Editor which lists the shortcuts. I just want to test an InputEvent against an Editor shortcut in script. |
No I'm not confusing anything here, I'm talking about a property that exists in this class but not sure if it's accessible in GDScript, try also Then this is probably best served by a proposal to add this functionality to the engine, go ahead and open one if you like, because missing functionality isn't a bug as such |
That returns a dictionary with some shortcuts. Thankyou very much. Might be a good idea to put that in the documentation. |
Agreed, but still room for improvement, so feel free to open a proposal I'm not sure we should add this property to the documentation as I'm not sure it's safe. There's even a comment with "do not edit" next to it, and it's not exposed so there's probably a reason for that, so adding proper functionality would be better |
This can probably be closed, and a proposal opened for the desired features |
Please open a dedicated proposal for additional functionality, I'd be up for looking into making the implementation myself However I don't think it's a good idea to expose or direct users to this property especially as it's only partially accessible, and it's not part of the public API so not reliable |
I believe this is already covered by godotengine/godot-proposals#2024 and godotengine/godot-proposals#4112, and is going to be resolved either by #58585 or by a new PR that supersedes it. There are some issues with the implementation of #58585 and I need to find some time to review it for 4.2. But feel free to try and salvage it yourself, addressing the concerns (see latest comments). |
Looking forward to an implementation that provides access to all the Editor shortcuts because get ("shortcuts") only provides 3 shortcuts for some reason and of course, none of which I need for what I am doing. I'll just have to piggyback on another control that uses the shortcut I want until then... |
Godot version
v4.0.3.stable.official [5222a99]
System information
Windows 11, AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx 2.10 GHz
Issue description
Is there a way of retrieving the Editor shortcut values stored in the "command palette" ? Only functions that modify are available, none to query the contents ? I see in the source that there is a is_shortcut () method via the EditorSettings singleton that can do this, but it isn't exposed. For plugins that use shortcuts, access to this information ensures they can be updated when the user makes changes in this regard.
Steps to reproduce
N/A
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: