From daad4aed62bfa471421f960179f0ac0fd78e8040 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Sun, 11 Dec 2022 01:21:22 +0200 Subject: Cleanup and unify keyboard input. - Unify keycode values (secondary label printed on a key), remove unused hardcoded Latin-1 codes. - Unify IME behaviour, add inline composition string display on Windows and X11. - Add key_label (localized label printed on a key) value to the key events, and allow mapping actions to the unshifted Unicode events. - Add support for physical keyboard (Bluetooth or Sidecar) handling on iOS. - Add support for media key handling on macOS. Co-authored-by: Raul Santos --- tests/core/input/test_input_event_key.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/core/input/test_input_event_key.h b/tests/core/input/test_input_event_key.h index 697215bab7..3317941fad 100644 --- a/tests/core/input/test_input_event_key.h +++ b/tests/core/input/test_input_event_key.h @@ -106,11 +106,11 @@ TEST_CASE("[InputEventKey] Key correctly converts itself to text") { // Key is None without a physical key. none_key.set_keycode(Key::NONE); - CHECK(none_key.as_text() == " (Physical)"); + CHECK(none_key.as_text() == "(Unset)"); // Key is none and has modifiers. none_key.set_ctrl_pressed(true); - CHECK(none_key.as_text() == "Ctrl+ (Physical)"); + CHECK(none_key.as_text() == "Ctrl+(Unset)"); // Key is None WITH a physical key AND modifiers. none_key.set_physical_keycode(Key::ENTER); @@ -144,8 +144,7 @@ TEST_CASE("[InputEventKey] Key correctly converts itself to text") { TEST_CASE("[InputEventKey] Key correctly converts its state to a string representation") { InputEventKey none_key; - // Set physical to true. - CHECK(none_key.to_string() == "InputEventKey: keycode=0 (), mods=none, physical=true, pressed=false, echo=false"); + CHECK(none_key.to_string() == "InputEventKey: keycode=(Unset), mods=none, physical=false, pressed=false, echo=false"); // Set physical key to Escape. none_key.set_physical_keycode(Key::ESCAPE); CHECK(none_key.to_string() == "InputEventKey: keycode=4194305 (Escape), mods=none, physical=true, pressed=false, echo=false"); -- cgit v1.2.3