-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Use macOS shortcuts in LineEdit and TextEdit when the host platform is macOS on HTML5 #3754
Comments
Currently Godot handles the differences at compile time via a |
We moved away from preprocessor directives in the editor and use platform suffixes now. godotengine/godot#51280 So probably should do the same for scene files. Then it should be possible to hack something for the html platform to detect native platform. |
Oh I see, it's a bit worse then I expected actually, we'll have to review the |
See also godotengine/godot#47619 (although this was done before the input refactoring). |
We have also encountered this issue. I think the root error is here: #ifdef APPLE_STYLE_KEYS
union {
bool command;
bool meta; //< windows/mac key
};
bool control;
#else
union {
bool command; //< windows/mac key
bool control;
};
bool meta; //< windows/mac key
#endif If the union is removed, then the system can begin to start to detect and alter behaviour based on platform. A function can be introduced get_command_or_control() (or something better named) that returns true if its an apple platform, and command is pressed, or control is pressed. That function can be used across the system where get_command() and get_control() are used. It is suprising to me that The refactor towards a runtime check of platform will require careful examination of each use of get_command() and get_control() to make sure they are not within A simple solution until a refactor can be done is to use |
Will this issue move forward, is there anything planned? For me this is beyond frustrating :( |
This cannot really be addressed in 3.x because the root of the issue is in how shortcuts are bound for each platform. In 4.0 however we can have multiple shortcuts and in fact the editor ones are now modified using feature suffixes and not precompile instructions. So it should be solvable for Godot 4. But I don't think anyone volunteered to work in this yet. |
Implemented by godotengine/godot#91887. |
Describe the project you are working on
Not anything in particular
Describe the problem or limitation you are having in your project
Shortcuts in the TextEdit and LineEdit nodes such as Command+C copy, Command+V paste, CTRL+E go to end of the line are not working on macOS when exporting for the web. They work when run on the macOS export, but when exporting for web, copying as an example works with the Control key and not with the Command key, which is pretty annoying if you are used to using the Command key for almost everything.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Make it so these shortcuts work on the web as well.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
If a macOS user agent is detected, Godot should use these shortcuts.
If this enhancement will not be used often, can it be worked around with a few lines of script?
I guess you could implement these for your self, but it would take time, especially if you want to include all of the shortcuts.
Is there a reason why this should be core and not an add-on in the asset library?
This would improve the web export on Mac devices.
The text was updated successfully, but these errors were encountered: