diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-09-02 12:37:48 +0300 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-09-07 18:45:35 +0200 |
commit | 6f4d233062d44bd46b2f03596e72f0bc9709d2b5 (patch) | |
tree | cbd85008acd264327074698cf2e25b5f98dede6d /tests/core/input | |
parent | 6b92dbfce2868f71926d2720014e45af999f21be (diff) |
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`).
Diffstat (limited to 'tests/core/input')
-rw-r--r-- | tests/core/input/test_input_event_key.h | 6 |
1 files changed, 5 insertions, 1 deletions
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") { |