-
-
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
TextEdit uses wrong copy/paste shortcuts on Mac in HTML5 build #68653
Comments
That's a tricky problem to solve because macOS/iOS-specific overrides for this kind of shortcut are defined at build time for the target platform (macOS and iOS native builds). The Web platform is cross-platform and thus doesn't use those overrides. We'd need significant refactoring to make the Apple-style hotkeys not a compile-time decision but something overridden at runtime, also taking into account the host platform for Web builds. |
For the most part we are using |
Completely untested mockup - https://github.com/bruvzg/godot/tree/web_mac_keys |
Won't that create issues in other code that use that feature thinking they are on OSX native while being in the web version? Maybe a dedicate feature is better? |
Yeah I think we might have to use a dedicated feature so that users can still perform different logic on macOS native and Web on macOS, e.g.: if OS.has_feature("macos"):
OS.execute("open", ["godot"]) should/can obviously not run on the Web. Maybe we can define new features for each web+host combinations?
Then we could set Duplicating all those overrides would be tedious however, so we can also special case it in diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index bc186c7a16..20968f4729 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -1459,7 +1459,10 @@ void ED_SHORTCUT_OVERRIDE_ARRAY(const String &p_path, const String &p_feature, c
// Only add the override if the OS supports the provided feature.
if (!OS::get_singleton()->has_feature(p_feature)) {
- return;
+ // Special case for "macos" overrides we want to use for Web on macOS/iOS.
+ if (!(p_feature == "macos" && (OS::get_singleton()->has_feature("web_macos") || OS::get_singleton()->has_feature("web_ios"))) {
+ return;
+ }
}
Array events; That only covers the editor shortcuts - we'd also need to do something similar in And finally, some more changes might be needed to handle the
So that it uses and displays Cmd on those platforms. |
Godot version
3.5.1 stable official
System information
macOS 12.1
Issue description
TextEdit uses wrong copy/paste shortcuts on Mac in htmpl5 build
Steps to reproduce
Create any projects with TextEdit, run as HTML on macOS. Right-click to see shortcuts being ctrl+C ctrl+v instead of using Command
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: