Files
stablyai--orca/native/computer-use-macos/Sources/OrcaComputerUseMacOSCore/KeyboardInputSafety.swift
T
2026-07-13 13:05:33 +08:00

14 lines
454 B
Swift

public enum KeyboardInputSafety {
public enum FocusFailure: Equatable {
case targetNotFocused
case targetNotFocusedAfterRestore
}
public static func syntheticInputFocusFailure(targetWindowFocused: Bool, restoreWindowRequested: Bool) -> FocusFailure? {
guard !targetWindowFocused else {
return nil
}
return restoreWindowRequested ? .targetNotFocusedAfterRestore : .targetNotFocused
}
}