diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-11-12 23:39:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-12 23:39:17 +0100 |
commit | 5aae92f069b47c040d93e5edba2aad5b104fd1a5 (patch) | |
tree | e6d222c6488c1e4f1a9e4ffa68c1404473a00843 /editor/editor_settings.cpp | |
parent | 4f85cad013c5469a39287e9aa474735f950e302c (diff) | |
parent | 3c0fdcc8acfadb124fbfa914532868948561c351 (diff) |
Merge pull request #51684 from aaronfranke/enum-class
Diffstat (limited to 'editor/editor_settings.cpp')
-rw-r--r-- | editor/editor_settings.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 739fc0e4f5..613e0ba7a0 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -1482,7 +1482,7 @@ void ED_SHORTCUT_OVERRIDE(const String &p_path, const String &p_feature, Key p_k ERR_FAIL_COND_MSG(!sc.is_valid(), "Used ED_SHORTCUT_OVERRIDE with invalid shortcut: " + p_path + "."); PackedInt32Array arr; - arr.push_back(p_keycode); + arr.push_back((int32_t)p_keycode); ED_SHORTCUT_OVERRIDE_ARRAY(p_path, p_feature, arr); } @@ -1503,13 +1503,12 @@ void ED_SHORTCUT_OVERRIDE_ARRAY(const String &p_path, const String &p_feature, c #ifdef OSX_ENABLED // Use Cmd+Backspace as a general replacement for Delete shortcuts on macOS - if (keycode == KEY_DELETE) { - keycode = KEY_MASK_CMD | KEY_BACKSPACE; + if (keycode == Key::KEY_DELETE) { + keycode = KeyModifierMask::CMD | Key::BACKSPACE; } #endif - Ref<InputEventKey> ie; - if (keycode) { + if (keycode != Key::NONE) { ie = InputEventKey::create_reference(keycode); events.push_back(ie); } @@ -1522,7 +1521,7 @@ void ED_SHORTCUT_OVERRIDE_ARRAY(const String &p_path, const String &p_feature, c Ref<Shortcut> ED_SHORTCUT(const String &p_path, const String &p_name, Key p_keycode) { PackedInt32Array arr; - arr.push_back(p_keycode); + arr.push_back((int32_t)p_keycode); return ED_SHORTCUT_ARRAY(p_path, p_name, arr); } @@ -1534,13 +1533,13 @@ Ref<Shortcut> ED_SHORTCUT_ARRAY(const String &p_path, const String &p_name, cons #ifdef OSX_ENABLED // Use Cmd+Backspace as a general replacement for Delete shortcuts on macOS - if (keycode == KEY_DELETE) { - keycode = KEY_MASK_CMD | KEY_BACKSPACE; + if (keycode == Key::KEY_DELETE) { + keycode = KeyModifierMask::CMD | Key::BACKSPACE; } #endif Ref<InputEventKey> ie; - if (keycode) { + if (keycode != Key::NONE) { ie = InputEventKey::create_reference(keycode); events.push_back(ie); } |