diff --git a/docs/touch-support.md b/docs/touch-support.md index 7318a39..078d702 100644 --- a/docs/touch-support.md +++ b/docs/touch-support.md @@ -35,7 +35,7 @@ Integrated into `testing` from Chase Cichorz's three-commit touch patch. - Setting: `enable-touch-screen` in `[profiles..presentation.reading]`, default off. Preferences checkbox "Use the touch screen with gestures" and quick toggle "Touch screen". -- Keyboard: `toggle-touch-screen`, Cthulhu+Ctrl+Alt+T (as NVDA+Ctrl+Alt+T), +- Keyboard: `toggle-touch-screen`, Cthulhu+Ctrl+Shift+T, flips the quick toggle for the session and says "Touch screen on" or "off". Saving speech settings keeps it. @@ -238,7 +238,7 @@ are failures and cancellation closes an outstanding command connection. Before pushing, build from testing and check on the touchscreen: -1. Toggle with Cthulhu+Ctrl+Alt+T; explore, tap, double tap, rotate, and flick +1. Toggle with Cthulhu+Ctrl+Shift+T; explore, tap, double tap, rotate, and flick through each mode. Check speech and Braille, including window boundaries. 2. Unplug/reconnect or enable before connecting the device. It should become available after the retry interval. Toggle off/on; a double tap must not diff --git a/internal/input/commands.go b/internal/input/commands.go index 3aa9071..bd7cbf2 100644 --- a/internal/input/commands.go +++ b/internal/input/commands.go @@ -220,7 +220,7 @@ func DefaultCommandBindings(layout KeyboardLayout) CommandBindings { {Symbol: upKeySymbol, Modifiers: 1, CthulhuModifier: true}: PresentCurrentLine, {Symbol: 's', Modifiers: controlModifier | 1, CthulhuModifier: true}: SaveSpeechSettings, {Symbol: 't', CthulhuModifier: true}: PresentTime, - {Symbol: 't', Modifiers: controlModifier | altModifier, CthulhuModifier: true}: ToggleTouchScreen, + {Symbol: 't', Modifiers: controlModifier | 1, CthulhuModifier: true}: ToggleTouchScreen, {Symbol: 'c', Modifiers: 1, CthulhuModifier: true}: PresentClipboard, {Symbol: 'h', Modifiers: controlModifier, CthulhuModifier: true}: ShowSpeechHistory, {Symbol: 'd', Modifiers: 1, CthulhuModifier: true}: ToggleSpeechMonitor, diff --git a/internal/input/commands_test.go b/internal/input/commands_test.go index 738aa40..fc7e714 100644 --- a/internal/input/commands_test.go +++ b/internal/input/commands_test.go @@ -358,3 +358,29 @@ func TestSpeechSettingBindings(t *testing.T) { } } } + +func TestTouchScreenShortcut(t *testing.T) { + for _, layout := range []KeyboardLayout{DesktopKeyboardLayout, LaptopKeyboardLayout} { + for _, browse := range []bool{false, true} { + bindings, err := ResolveCommandBindings(layout, browse, nil) + if err != nil { + t.Fatal(err) + } + for _, tc := range []struct { + modifiers uint16 + want Command + }{ + {controlModifier | 1, ToggleTouchScreen}, + {controlModifier | altModifier, ""}, + {0, PresentTime}, + } { + router := NewCommandRouter([]uint32{0xff63}, bindings) + router.Handle(0xff63, 118, 0, true) + consumed, command := router.Handle('t', 28, tc.modifiers, true) + if command != tc.want || consumed != (tc.want != "") { + t.Fatalf("layout %v browse %v modifiers %d: got %v %q, want %q", layout, browse, tc.modifiers, consumed, command, tc.want) + } + } + } + } +}