Changed binding to toggle touch screen mode.

This commit is contained in:
Storm Dragon committed 2026-11-24 19:30:07 -05:00
1 parent 03066b2abe
commit 89043dc58b
3 files changed
+29 -3

No files matched your search

+1 -1
View File
@@ -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,
+26
View File
@@ -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)
}
}
}
}
}