Respect Cthulhu key echo settings for Wine typing
Wine editor insertion events previously reached speech and Braille without checking the user's typing echo preferences. Turning off key echo or an individual character category therefore left Wine typing feedback enabled. Read the live settings for each insertion and reuse the native text presentation policy for alphabetic, numeric, punctuation, symbol, space and diacritical input. Honor character echo and the master key echo switch; apply the action-key setting to the helper's tab and new-line labels. Reject unexpected multi-character insertion labels rather than treating these ordered character events as paste notifications. Preserve navigation, selection and deletion feedback when typing echo is disabled. Retain repeated characters, case, uppercase/custom voice routing, focus ordering and the existing stale-source/password protections. Add regression coverage for live disable/re-enable, independent categories, Unicode, character-echo overrides, and unaffected editor actions. Extend the private D-Bus test to exercise settings changes through the real Wine service signature. Document behavior, current word/sentence echo limits, and live Notepad acceptance checks in the README. Validation: - Reproduced disabled typing reaching output with the new test before fixing. - Full go test -race ./... -count=1 passed outside the socket-restricted sandbox. - Private-session TestNativeSessionBusWineEvents passed with -race. - Focused typing/editor regressions passed, including a fresh pre-commit run. - go vet passed for internal/app, presentation, remote and wine. - Reader and BrlAPI helper builds passed; reader --version succeeded. - gofmt and git diff --check passed; independent review found no blockers. Live audible speech, physical keyboard and physical Braille acceptance remain pending. No running reader was replaced. Changes target deedra.
This commit is contained in:
1 parent
6754c8ef6c
commit
15d527c619
5 files changed
+183
-3
No files matched your search
@@ -7,7 +7,11 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"git.stormux.org/storm/cthulhu/internal/atspi"
|
||||
"git.stormux.org/storm/cthulhu/internal/config"
|
||||
"git.stormux.org/storm/cthulhu/internal/presentation"
|
||||
"git.stormux.org/storm/cthulhu/internal/remote"
|
||||
)
|
||||
|
||||
@@ -40,6 +44,24 @@ func newWineEventPresenter(present func(string) bool) *wineEventPresenter {
|
||||
return &wineEventPresenter{present: present}
|
||||
}
|
||||
|
||||
// wineTypingEchoEnabled applies the native insertion policy to the helper's
|
||||
// character labels. Navigation and deletion do not pass through this filter.
|
||||
func wineTypingEchoEnabled(text string, settings config.Settings) bool {
|
||||
switch text {
|
||||
case "tab", "new line":
|
||||
return settings.EnableKeyEcho && settings.EnableActionKeys
|
||||
case "space":
|
||||
text = " "
|
||||
}
|
||||
// The helper sends one accepted character per insertion. Do not treat an
|
||||
// unexpected label as a multi-character paste, which has a different policy.
|
||||
if utf8.RuneCountInString(text) != 1 {
|
||||
return false
|
||||
}
|
||||
event := atspi.Event{Type: atspi.TextInsertedEvent, Payload: text}
|
||||
return presentation.EventTextWithOptions(event, presentationSettingsFromConfig(settings, false)) != ""
|
||||
}
|
||||
|
||||
func (owner *wineEventPresenter) Present(event remote.AccessibleEvent) bool {
|
||||
return owner.present_event(event, nil)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user