Files
sst/Sources/SstCore/FnKeyTracker.swift
2026-10-01 09:44:23 +02:00

13 lines
355 B
Swift

public struct FnKeyTracker {
private var isDown = false
public init() {}
/// Feed the current Fn flag state; returns an event only on a transition.
public mutating func process(fnDown: Bool) -> HotkeyEvent? {
guard fnDown != isDown else { return nil }
isDown = fnDown
return fnDown ? .pressed : .released
}
}