feat: configurable hotkey binding and ModifierKeyTracker

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 14:58:31 +02:00
co-authored by Claude Sonnet 5.5
parent 7eb3a156d4
commit 2c4b096850
5 changed files with 100 additions and 6 deletions
+12
View File
@@ -0,0 +1,12 @@
public struct ModifierKeyTracker {
private var isDown = false
public init() {}
/// Feed the current state of the bound modifier flag; returns an event only on a transition.
public mutating func process(isDown: Bool) -> HotkeyEvent? {
guard isDown != self.isDown else { return nil }
self.isDown = isDown
return isDown ? .pressed : .released
}
}