sane-input-handler: fix unrecoverable terminal state
bonsai is prone to miss inputs during high CPU load.
This commit is contained in:
@@ -36,11 +36,14 @@ let
|
|||||||
in assert terminal -> events == []; events;
|
in assert terminal -> events == []; events;
|
||||||
|
|
||||||
# trigger ${button}_hold_N every `holdTime` ms until ${button} is released
|
# trigger ${button}_hold_N every `holdTime` ms until ${button} is released
|
||||||
recurseHold = button: { count ? 1, maxHolds ? 3, holdTime ? 1000 }@opts: lib.optionalAttrs (count <= maxHolds) {
|
recurseHold = button: { count ? 1, maxHolds ? 3, holdTime ? 1000 }@opts: {
|
||||||
"${button}_released".terminal = true; # end the hold -> back to root state
|
|
||||||
ms = holdTime;
|
|
||||||
trigger = "${button}_hold_${builtins.toString count}";
|
trigger = "${button}_hold_${builtins.toString count}";
|
||||||
|
ms = holdTime;
|
||||||
|
} // lib.optionalAttrs (count < maxHolds) {
|
||||||
timeout = recurseHold button (opts // { count = count+1; });
|
timeout = recurseHold button (opts // { count = count+1; });
|
||||||
|
# end the hold -> back to root state
|
||||||
|
# take care to omit this on the last hold though, so that there's always a strictly delay-driven path back to root
|
||||||
|
"${button}_released".terminal = true;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user