From c15b5b9bc5fafd8241f7c3689fbc9494327f37e5 Mon Sep 17 00:00:00 2001 From: pablohc Date: Thu, 7 May 2026 14:10:17 +0200 Subject: [PATCH] fix: short-press power action triggered after screenshot combo release (#1853) When Power+Down is released with a slight stagger (Down before Power), the Power release event leaked through to the activity loop, triggering short-press Power actions like clip selection. Add a screenshotComboActive flag that suppresses all input processing until Power is fully released after a screenshot combo. ## Summary * **What is the goal of this PR?** (e.g., Implements the new feature for file uploading.) * **What changes are included?** ## Additional Context * Add any other information that might be helpful for the reviewer (e.g., performance implications, potential risks, specific areas to focus on). --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? _**YES**_ --- src/main.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 8258a57c..80602529 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -381,7 +381,9 @@ void loop() { } static bool screenshotButtonsReleased = true; + static bool screenshotComboActive = false; if (gpio.isPressed(HalGPIO::BTN_POWER) && gpio.isPressed(HalGPIO::BTN_DOWN)) { + screenshotComboActive = true; if (screenshotButtonsReleased) { screenshotButtonsReleased = false; { @@ -390,8 +392,16 @@ void loop() { } } return; - } else { + } + if (screenshotComboActive) { + if (gpio.isPressed(HalGPIO::BTN_POWER)) return; + if (gpio.wasReleased(HalGPIO::BTN_POWER)) { + screenshotButtonsReleased = true; + screenshotComboActive = false; + return; + } screenshotButtonsReleased = true; + screenshotComboActive = false; } const unsigned long sleepTimeoutMs = SETTINGS.getSleepTimeoutMs();