Fix various errors when running the unit tests

Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
This commit is contained in:
RedworkDE
2023-05-09 15:50:48 +02:00
parent 668cf3c66f
commit 8e7afec479
9 changed files with 22 additions and 21 deletions

View File

@@ -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);