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
@@ -11,6 +11,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"git.stormux.org/storm/cthulhu/internal/config"
|
||||
"git.stormux.org/storm/cthulhu/internal/remote"
|
||||
"github.com/godbus/dbus/v5"
|
||||
)
|
||||
@@ -32,7 +33,10 @@ func TestNativeSessionBusWineEvents(t *testing.T) {
|
||||
t.Skip("set CTHULHU_NATIVE_DBUS_TEST=1 inside a private session bus")
|
||||
}
|
||||
output := &wineTestOutput{speech: make(chan speechRequest, 32), braille: make(chan string, 32)}
|
||||
handler := remoteSpeech{speech: output, braille: output}
|
||||
settings := config.DefaultSettings()
|
||||
live := &liveSettings{}
|
||||
live.Store(settings)
|
||||
handler := remoteSpeech{speech: output, braille: output, live: live}
|
||||
owner := newWineEventPresenter(func(message string) bool {
|
||||
return handler.presentMessage(message, "wine-accessible-event")
|
||||
})
|
||||
@@ -71,6 +75,19 @@ func TestNativeSessionBusWineEvents(t *testing.T) {
|
||||
for _, text := range []string{"A", "a", "É", "é"} {
|
||||
send(remote.AccessibleEvent{SourceID: "42:text", EventType: "text", Name: text, States: "start=1 end=1 kind=8"}, true)
|
||||
}
|
||||
settings.EnableKeyEcho = false
|
||||
live.Store(settings)
|
||||
for _, text := range []string{"A", "space", "tab", "new line"} {
|
||||
send(remote.AccessibleEvent{SourceID: "42:text", EventType: "text", Name: text, States: "kind=8"}, false)
|
||||
}
|
||||
send(remote.AccessibleEvent{SourceID: "42:text", EventType: "text", Name: "e", States: "kind=7"}, true)
|
||||
settings.EnableKeyEcho = true
|
||||
settings.EnableAlphabeticKeys = false
|
||||
live.Store(settings)
|
||||
send(remote.AccessibleEvent{SourceID: "42:text", EventType: "text", Name: "A", States: "kind=8"}, false)
|
||||
settings.EnableAlphabeticKeys = true
|
||||
live.Store(settings)
|
||||
send(remote.AccessibleEvent{SourceID: "42:text", EventType: "text", Name: "A", States: "kind=8"}, true)
|
||||
send(remote.AccessibleEvent{SourceID: "check", EventType: "focus", Name: "Option", Role: "check box", States: "not checked"}, true)
|
||||
owner.flush()
|
||||
send(remote.AccessibleEvent{SourceID: "check", EventType: "name", Name: "Renamed", Role: "check box", States: "not checked"}, true)
|
||||
@@ -87,7 +104,7 @@ func TestNativeSessionBusWineEvents(t *testing.T) {
|
||||
send(remote.AccessibleEvent{SourceID: "no", EventType: "focus", Name: "No", Role: "client"}, true)
|
||||
owner.flush()
|
||||
owner.Close()
|
||||
for _, want := range []string{"edit, hello", "l", "l", "e selected", "e deleted", "A", "a", "É", "é", "Option, check box, not checked", "Renamed, check box, not checked", "Renamed, check box, checked, unavailable", "Yes", "No"} {
|
||||
for _, want := range []string{"edit, hello", "l", "l", "e selected", "e deleted", "A", "a", "É", "é", "e", "A", "Option, check box, not checked", "Renamed, check box, not checked", "Renamed, check box, checked, unavailable", "Yes", "No"} {
|
||||
select {
|
||||
case request := <-output.speech:
|
||||
if request.Text != want || !request.Append {
|
||||
|
||||
Reference in new issue
Block a user