summaryrefslogtreecommitdiff
path: root/core/os/keyboard.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-09-08 09:24:24 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-09-08 09:24:24 +0200
commit69233093d7e6479b5130bf2c39cbf464a6809c1b (patch)
tree8aae4dde5aaa7f0104afd2bb5b9eac317d780d68 /core/os/keyboard.cpp
parent7936b3cc4c657e4b273b376068f095e1e0e4d82a (diff)
parent6f4d233062d44bd46b2f03596e72f0bc9709d2b5 (diff)
Merge pull request #65241 from bruvzg/no_keymap_ambiguity
Fix key mapping changes when moving from macOS to other platform.
Diffstat (limited to 'core/os/keyboard.cpp')
-rw-r--r--core/os/keyboard.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/core/os/keyboard.cpp b/core/os/keyboard.cpp
index a592791d06..f3be495c8e 100644
--- a/core/os/keyboard.cpp
+++ b/core/os/keyboard.cpp
@@ -61,12 +61,16 @@ static const _KeyCodeText _keycodes[] = {
{Key::PAGEDOWN ,"PageDown"},
{Key::SHIFT ,"Shift"},
{Key::CTRL ,"Ctrl"},
-#ifdef MACOS_ENABLED
+#if defined(MACOS_ENABLED)
{Key::META ,"Command"},
+ {Key::ALT ,"Option"},
+#elif defined(WINDOWS_ENABLED)
+ {Key::META ,"Windows"},
+ {Key::ALT ,"Alt"},
#else
{Key::META ,"Meta"},
-#endif
{Key::ALT ,"Alt"},
+#endif
{Key::CAPSLOCK ,"CapsLock"},
{Key::NUMLOCK ,"NumLock"},
{Key::SCROLLLOCK ,"ScrollLock"},
@@ -437,6 +441,14 @@ String keycode_get_string(Key p_code) {
codestr += find_keycode_name(Key::ALT);
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
+ codestr += "+";
+ }
if ((p_code & KeyModifierMask::CTRL) != Key::NONE) {
codestr += find_keycode_name(Key::CTRL);
codestr += "+";