diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-05-09 19:28:54 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-05-09 19:28:54 +0200 |
commit | 6bca6beea3e1212ad1eb22ffe8630ea25c7e92c2 (patch) | |
tree | f8bd79189341d30e34fd2eac578c4e6c5c086140 /core/input/input_event.cpp | |
parent | f20061d2d91ee8150082026a43e20dafd78cffa4 (diff) | |
parent | 8e7afec479b29bfe7f6d33ca9bce70c9d1abf7cf (diff) | |
download | redot-engine-6bca6beea3e1212ad1eb22ffe8630ea25c7e92c2.tar.gz |
Merge pull request #76878 from RedworkDE/tests-fix-errors
Fix various errors when running the unit tests
Diffstat (limited to 'core/input/input_event.cpp')
-rw-r--r-- | core/input/input_event.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/input/input_event.cpp b/core/input/input_event.cpp index 46f07fe041..19e4d6182a 100644 --- a/core/input/input_event.cpp +++ b/core/input/input_event.cpp @@ -484,7 +484,10 @@ Ref<InputEventKey> InputEventKey::create_reference(Key p_keycode, bool p_physica ie->set_keycode(p_keycode & KeyModifierMask::CODE_MASK); } - ie->set_unicode(char32_t(p_keycode & KeyModifierMask::CODE_MASK)); + char32_t ch = char32_t(p_keycode & KeyModifierMask::CODE_MASK); + if (ch < 0xd800 || (ch > 0xdfff && ch <= 0x10ffff)) { + ie->set_unicode(ch); + } if ((p_keycode & KeyModifierMask::SHIFT) != Key::NONE) { ie->set_shift_pressed(true); |