FramebufferUIView: give it a full UITextInputTraits implementation

Class-level UIKeyInput conformance without UITextInputTraits means iOS
falls back to default traits — autocorrect on, predictive on, smart
quotes/dashes on. The suggestion engine was swallowing most keystrokes
before insertText() could forward them (the "1 in 6 chars" symptom).

Declaring all the traits as @objc stored properties with permissive
(autocorrect=.no, etc.) values turns every suggestion layer off so each
key tap produces exactly one insertText() and hits the remote.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Trey T
2026-04-17 14:05:13 -05:00
parent 0f1d2fa6f6
commit 8177be94a5

View File

@@ -7,6 +7,23 @@ final class FramebufferUIView: UIView,
UIGestureRecognizerDelegate,
UIPointerInteractionDelegate,
UIKeyInput {
// MARK: - UITextInputTraits disable every kind of autocomplete, so
// each keystroke produces exactly one insertText() call and nothing
// is swallowed by the suggestion/predictive engine.
@objc var autocorrectionType: UITextAutocorrectionType = .no
@objc var autocapitalizationType: UITextAutocapitalizationType = .none
@objc var spellCheckingType: UITextSpellCheckingType = .no
@objc var smartQuotesType: UITextSmartQuotesType = .no
@objc var smartDashesType: UITextSmartDashesType = .no
@objc var smartInsertDeleteType: UITextSmartInsertDeleteType = .no
@objc var keyboardType: UIKeyboardType = .asciiCapable
@objc var keyboardAppearance: UIKeyboardAppearance = .dark
@objc var returnKeyType: UIReturnKeyType = .default
@objc var enablesReturnKeyAutomatically: Bool = false
@objc var isSecureTextEntry: Bool = false
@objc var passwordRules: UITextInputPasswordRules?
@objc var textContentType: UITextContentType? = UITextContentType(rawValue: "")
weak var controller: SessionController?
var inputMode: InputMode = .touch
var selectedScreen: RemoteScreen? {