diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-11-14 16:27:26 +0200 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2023-04-11 10:58:54 +0300 |
commit | a5009f4d3cc36974a5897c3c819e61c3e0783b0d (patch) | |
tree | 3321f8bcc561b450f518e93efd682e4d51b2063c /core/os/keyboard.cpp | |
parent | c3ed7af12347aa04a3d3bb91bc726170e894758e (diff) | |
download | redot-engine-a5009f4d3cc36974a5897c3c819e61c3e0783b0d.tar.gz |
[Web] Detect host OS and use macOS keys on mac hosts.
Diffstat (limited to 'core/os/keyboard.cpp')
-rw-r--r-- | core/os/keyboard.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/os/keyboard.cpp b/core/os/keyboard.cpp index 25a4b320cd..1e32e6e096 100644 --- a/core/os/keyboard.cpp +++ b/core/os/keyboard.cpp @@ -367,11 +367,11 @@ String keycode_get_string(Key p_code) { codestr += "+"; } if ((p_code & KeyModifierMask::CMD_OR_CTRL) != Key::NONE) { -#ifdef MACOS_ENABLED - codestr += find_keycode_name(Key::META); -#else - codestr += find_keycode_name(Key::CTRL); -#endif + if (OS::get_singleton()->has_feature("macos") || OS::get_singleton()->has_feature("web_macos") || OS::get_singleton()->has_feature("web_ios")) { + codestr += find_keycode_name(Key::META); + } else { + codestr += find_keycode_name(Key::CTRL); + } codestr += "+"; } if ((p_code & KeyModifierMask::CTRL) != Key::NONE) { |