Skip to content

Fix altitude loss detector key hold#14

Merged
omtoi101 merged 3 commits into
mainfrom
fix-altitude-loss-detector-key-hold
Sep 21, 2025
Merged

Fix altitude loss detector key hold#14
omtoi101 merged 3 commits into
mainfrom
fix-altitude-loss-detector-key-hold

Conversation

@omtoi101

Copy link
Copy Markdown
Owner

No description provided.

google-labs-jules Bot and others added 3 commits September 21, 2025 11:06
The `KeyHold` utility class was using static fields and methods, which caused issues when multiple key holds were active at the same time. This could lead to the key being held indefinitely.

This commit refactors the `KeyHold` class to be instance-based. Each call to `KeyHold.hold` now creates a new instance of the class, which manages its own state and lifecycle. The instance subscribes to the event bus on creation and unsubscribes on release, ensuring that the key is correctly released after the specified duration.
The `KeyHold` utility was interpreting the duration parameter as seconds instead of ticks, causing the altitude loss detector to be disabled for an extended period. This commit corrects the `KeyHold` class to interpret the duration as ticks, ensuring the detector resets correctly.

This also includes the previous fix that refactored `KeyHold` to be instance-based, preventing indefinite key holds.
@omtoi101 omtoi101 merged commit a976664 into main Sep 21, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant