Changed binding to toggle touch screen mode.
This commit is contained in:
1 parent
03066b2abe
commit
89043dc58b
3 files changed
+29
-3
No files matched your search
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user