Skip to content

Commit 1b929fe

Browse files
committed
laptop16: Detect powerbutton short-press immediately
This works because there was a release. We immediately trigger on button release. Long-press to shut off still works because that triggers based on timeout without the need to release. Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent 0550524 commit 1b929fe

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/state_machine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,7 @@ pub fn start(
11621162

11631163
// Detect short press of power button
11641164
// Short press (or ESC) will exit and boot (skip all further checks)
1165-
let short_press = (!button_pressed && state.prev_pressed && long_press == 1)
1165+
let short_press = (!button_pressed && state.prev_pressed)
11661166
|| state.keypress == Some(Key::Special(ScanCode::ESCAPE));
11671167
match (short_press, state.frame.clone()) {
11681168
// Reboot

0 commit comments

Comments
 (0)