From 6f4d233062d44bd46b2f03596e72f0bc9709d2b5 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Fri, 2 Sep 2022 12:37:48 +0300 Subject: Fix key mapping changes when moving from macOS to other platform Removes separate `Command` key (use `Meta` instead). Adds an event flag to automatically remap `Command` <-> `Control` (cannot be set alongside `Control` or `Meta`). --- tests/core/input/test_input_event_key.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/core') diff --git a/tests/core/input/test_input_event_key.h b/tests/core/input/test_input_event_key.h index 5d4ca55a35..4c9cd2002c 100644 --- a/tests/core/input/test_input_event_key.h +++ b/tests/core/input/test_input_event_key.h @@ -148,7 +148,7 @@ TEST_CASE("[InputEventKey] Key correctly converts its state to a string represen CHECK(none_key.to_string() == "InputEventKey: keycode=0 (), mods=none, physical=true, pressed=false, echo=false"); // Set physical key to Escape. none_key.set_physical_keycode(Key::ESCAPE); - CHECK(none_key.to_string() == "InputEventKey: keycode=16777217 (Escape), mods=none, physical=true, pressed=false, echo=false"); + CHECK(none_key.to_string() == "InputEventKey: keycode=4194305 (Escape), mods=none, physical=true, pressed=false, echo=false"); InputEventKey key; @@ -167,7 +167,11 @@ TEST_CASE("[InputEventKey] Key correctly converts its state to a string represen // Press Ctrl and Alt. key.set_ctrl_pressed(true); key.set_alt_pressed(true); +#ifdef MACOS_ENABLED + CHECK(key.to_string() == "InputEventKey: keycode=32 (Space), mods=Ctrl+Option, physical=false, pressed=true, echo=true"); +#else CHECK(key.to_string() == "InputEventKey: keycode=32 (Space), mods=Ctrl+Alt, physical=false, pressed=true, echo=true"); +#endif } TEST_CASE("[InputEventKey] Key is correctly converted to reference") { -- cgit v1.2.3