From d944c6622ad9f0eac930787750529e8ef3af029a Mon Sep 17 00:00:00 2001 From: MikePehel Date: Sat, 30 May 2026 07:44:24 -0700 Subject: [PATCH] feat(input): gate auto-align toggle on Shift+A MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bare A overlapped the WASDEQ camera-strafe set in scene.c, so every camera-left touch flipped takeoff alignment on/off as a side effect. The toggle is now modifier-gated: only fires when Shift is held with A. - main.c: IsKeyDown(KEY_LEFT_SHIFT) || IsKeyDown(KEY_RIGHT_SHIFT) required alongside IsKeyPressed(KEY_A). - main.c: comment on takeoff_aligned state updated to "Shift+A". - hud_help.c: legend entry rewritten as "Sh+A" → "Takeoff alignment". Verified by running ./hawkeye --replay against the Lucky Seven swarm: bare A only strafes the camera; Shift+A toggles auto-align with the expected toast and seek-to-takeoff behavior. --- src/hud_help.c | 2 +- src/main.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/hud_help.c b/src/hud_help.c index 09c9c89..4a421f2 100644 --- a/src/hud_help.c +++ b/src/hud_help.c @@ -70,7 +70,7 @@ void hud_draw_help(Font font_value, Font font_label, {"Sh+B", "Delete current marker"}, {"[ / ]", "Jump to prev/next marker"}, {"Sh+[ / ]", "Track from marker"}, - {"A", "Takeoff alignment"}, + {"Sh+A", "Takeoff alignment"}, }; int counts[3] = { diff --git a/src/main.c b/src/main.c index 0e0aab0..e5131f1 100644 --- a/src/main.c +++ b/src/main.c @@ -281,7 +281,7 @@ int main(int argc, char *argv[]) { } } - // ── Takeoff alignment state (toggled by A key) ── + // ── Takeoff alignment state (toggled by Shift+A) ── bool takeoff_aligned = false; if (is_replay && num_replay_files > 1) { // Set multi-file CONF for each source (always available) @@ -1049,8 +1049,11 @@ int main(int argc, char *argv[]) { markers[i].current = -1; } } - // A key: toggle takeoff time alignment - if (IsKeyPressed(KEY_A) && num_replay_files > 1) { + // Shift+A: toggle takeoff time alignment. Modifier-gated so + // bare A stays free for the WASDEQ camera-left strafe in scene.c + // (without the gate, every camera-left touch flipped auto-align). + bool shift_held = IsKeyDown(KEY_LEFT_SHIFT) || IsKeyDown(KEY_RIGHT_SHIFT); + if (shift_held && IsKeyPressed(KEY_A) && num_replay_files > 1) { takeoff_aligned = !takeoff_aligned; const float takeoff_buffer = 5.0f; for (int i = 0; i < nrf; i++) {