From 8177be94a52fec4c150fdb3f078da43caf96466a Mon Sep 17 00:00:00 2001 From: Trey T Date: Fri, 17 Apr 2026 14:05:13 -0500 Subject: [PATCH] FramebufferUIView: give it a full UITextInputTraits implementation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .../VNCUI/Session/FramebufferUIView.swift | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Packages/VNCUI/Sources/VNCUI/Session/FramebufferUIView.swift b/Packages/VNCUI/Sources/VNCUI/Session/FramebufferUIView.swift index fd49985..bfa0afc 100644 --- a/Packages/VNCUI/Sources/VNCUI/Session/FramebufferUIView.swift +++ b/Packages/VNCUI/Sources/VNCUI/Session/FramebufferUIView.swift @@ -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? {