bc77cabb62
Rework the action cluster to a mic-above-bottom-row layout, add left/right handedness setting that swaps delete and return, and keep the screen awake during Flow recording sessions.
30 lines
904 B
Swift
30 lines
904 B
Swift
// HandednessPreference.swift
|
|
// OSGKeyboard · Shared
|
|
//
|
|
// Which hand the user holds the phone with — controls bottom-row key order
|
|
// on the keyboard (delete ↔ return swap for right-handed use).
|
|
|
|
import Foundation
|
|
|
|
public enum HandednessPreference: String, CaseIterable, Identifiable, Sendable, Codable {
|
|
case left
|
|
case right
|
|
|
|
public var id: String { rawValue }
|
|
|
|
public var labelKey: String {
|
|
switch self {
|
|
case .left: return "settings.handedness.left"
|
|
case .right: return "settings.handedness.right"
|
|
}
|
|
}
|
|
|
|
/// Right-handed preference places return on the left and delete on the right.
|
|
public var swapsActionKeys: Bool { self == .right }
|
|
|
|
public static func fromStored(_ raw: String?) -> HandednessPreference {
|
|
guard let raw, let value = HandednessPreference(rawValue: raw) else { return .left }
|
|
return value
|
|
}
|
|
}
|