-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Script editor ignores Alt + key shortcuts and inserts special character instead #63888
Comments
It's fixed in 4.0 - #56695, but not in 3.x. But we probably should remove all |
@bruvzg, |
We should still try to fix this issue for 3.x, even if it means changing some of the default shortcuts on macOS. |
Something probably should be done, but Godot uses a lot of shortcuts, it won't be that easy to ensure every one is fine and working in all conditions.
We can define different shortcuts for macOS and other platforms (we already do, when shortcut conflicts with OS default shortcut), we can do the same here. |
Would just like to add my experience to this. I just started playing around with Godot beta 4 and on my Swedish keyboard @ is option (alt)-2. Since the above "bug" is now fixed, this means that every time I tried to type @ in a script Godot would switch me out of the script editor. I agree with @bruvzg that for me as a macOS user in general shortcuts would be expected to be command-something, and in particular I think it's a bad idea to not interpret option/shift-character combinations as special characters when typing in a field editor, since a lot of languages use these kinds of special characters. So I think reverting to the previous behavior as I understand it from above, where alt-shortcuts would be used as character entry in text fields would be a good idea short-term, and longer term changing all default shortcuts you might want to use while text editing (like tab navigation) to control- or command- shortcuts to make sure they aren't in conflict with character entry. |
Another related inconsistency in Godot 4.0.beta4: On macOS I think a good convention is that command-keyboard shortcuts should never be interpreted as text entry, and the same probably goes for Control-keyboard on Windows. |
Godot version
3.4.5.stable.mono
System information
MacOS
Issue description
When you are in the editor, in the script editor, after pressing Alt + 1 (Opt + 1) – Open 2D Editor, or Alt + 2 – Open 3D editor, etc. Whatever combination that requires you to press Alt + number or letter (by the way, Alt + Space inserts space), it will insert a special characters.
I'd expect these shortcuts not to be ignored.
After a quick lookup in the codebase, when you press one of the shortcuts, it only hits:
void FindReplaceBar::_editor_text_changed()
from thecode_editor.cpp
file.These calls are being ignored (
editor_node.cpp
):I'm not a C++ guru neither not so familiar with the project. Therefore I assume it was implemented intentionally.
I can try to fix that, but at the moment, I don't understand why those shortcut calls have "less priority" than "text_changed event".
There are two workarounds:
Maybe there is also an option to disable it in macOS.
NB: It doesn't work only from the script editor. It works if you are on the 2D Editor and want to jump to the script editor (Alt + 3).
It might be a related issue: #23548
Steps to reproduce
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: