mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Merge pull request #73651 from hakro/editor-freelook-physical-shortcuts
Use physical shortcuts for freelook navigation in the editor
This commit is contained in:
@@ -474,10 +474,15 @@ String InputEventKey::to_string() {
|
||||
return vformat("InputEventKey: keycode=%s, mods=%s, physical=%s, pressed=%s, echo=%s", kc, mods, physical, p, e);
|
||||
}
|
||||
|
||||
Ref<InputEventKey> InputEventKey::create_reference(Key p_keycode) {
|
||||
Ref<InputEventKey> InputEventKey::create_reference(Key p_keycode, bool p_physical) {
|
||||
Ref<InputEventKey> ie;
|
||||
ie.instantiate();
|
||||
ie->set_keycode(p_keycode & KeyModifierMask::CODE_MASK);
|
||||
if (p_physical) {
|
||||
ie->set_physical_keycode(p_keycode & KeyModifierMask::CODE_MASK);
|
||||
} else {
|
||||
ie->set_keycode(p_keycode & KeyModifierMask::CODE_MASK);
|
||||
}
|
||||
|
||||
ie->set_unicode(char32_t(p_keycode & KeyModifierMask::CODE_MASK));
|
||||
|
||||
if ((p_keycode & KeyModifierMask::SHIFT) != Key::NONE) {
|
||||
|
||||
@@ -195,7 +195,7 @@ public:
|
||||
virtual String as_text() const override;
|
||||
virtual String to_string() override;
|
||||
|
||||
static Ref<InputEventKey> create_reference(Key p_keycode_with_modifier_masks);
|
||||
static Ref<InputEventKey> create_reference(Key p_keycode_with_modifier_masks, bool p_physical = false);
|
||||
|
||||
InputEventKey() {}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user