feat: configurable hotkey binding and ModifierKeyTracker
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user