summaryrefslogtreecommitdiffstats
path: root/core/input/input_event.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-05-09 19:28:54 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-05-09 19:28:54 +0200
commit6bca6beea3e1212ad1eb22ffe8630ea25c7e92c2 (patch)
treef8bd79189341d30e34fd2eac578c4e6c5c086140 /core/input/input_event.cpp
parentf20061d2d91ee8150082026a43e20dafd78cffa4 (diff)
parent8e7afec479b29bfe7f6d33ca9bce70c9d1abf7cf (diff)
downloadredot-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.cpp5
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);