-
Notifications
You must be signed in to change notification settings - Fork 0
Unicode text input #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When viewer and presenter have different keyboard layouts (e.g., QWERTZ vs QWERTY), typed characters now appear correctly. The implementation uses a hybrid approach: - TextInput event captures actual Unicode characters for regular typing - KeyDown/KeyUp events still used for shortcuts (Ctrl+X, Alt+X) and special keys This ensures special characters like ö, ä, ü, ß, é work correctly regardless of keyboard layout differences between viewer and presenter. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace IsCharacterProducingKey and HasShortcutModifier with single ShouldDeferToTextInput check that relies on KeySymbol for printable character detection. Add text length validation to prevent DoS. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
@greptile |
Greptile SummaryThis PR adds Unicode text input support to enable cross-layout keyboard compatibility by introducing a separate text input path that handles printable characters using Avalonia's
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant ViewerView as ViewerView.axaml.cs
participant ViewerService as ViewerConnectionService
participant SignalR as SignalR Hub
participant Connection as Connection (Presenter)
participant PresenterService as PresenterConnectionService
participant InputInjection as WindowsInputInjectionService
participant OS as Windows OS
User->>ViewerView: Type character (e.g., "é")
alt Printable character (KeySymbol check)
ViewerView->>ViewerView: KeyDown event → ShouldDeferToTextInput() = true
ViewerView->>ViewerView: Defer to TextInput event
ViewerView->>ViewerView: TextInput event fires
ViewerView->>ViewerView: Validate: IsInputEnabled && length ≤ 100
ViewerView->>ViewerService: SendTextInputAsync(text)
ViewerService->>ViewerService: Serialize TextInputMessage
ViewerService->>SignalR: Send message (MessageTypes.Input.TextInput)
SignalR->>Connection: Route input message
Connection->>Connection: Deserialize TextInputMessage
Connection->>PresenterService: HandleTextInput(senderClientId, text)
PresenterService->>PresenterService: Validate: length ≤ 1000, check input blocking
PresenterService->>InputInjection: InjectText(text, connectionId, ct)
InputInjection->>InputInjection: CheckAndReleaseStuckModifiers()
InputInjection->>OS: Keyboard.TextEntry(text)
OS->>OS: Unicode text injected
else Special key (Escape, F11, Arrow, etc.)
ViewerView->>ViewerView: KeyDown event → ShouldDeferToTextInput() = false
ViewerView->>ViewerService: SendKeyDownAsync(keyCode, modifiers)
Note over ViewerService,OS: Traditional key event flow (existing)
end
|
Greptile found no issues!From now on, if a review finishes and we haven't found any issues, we will not post anything, but you can confirm that we reviewed your changes in the status check section. This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR". |
No description provided.