Cthulhu is no longer a fork. Now it is a screen reader written in Golang.

This commit is contained in:
Storm Dragon committed 2026-10-14 00:16:34 -04:00
1 parent a998fe67de
commit 069fc674dc
708 files changed
+112482 -532

No files matched your search

+43
View File
@@ -0,0 +1,43 @@
// Copyright (c) 2026 Storm Dragon
// Authors: Storm Dragon, Angus Kola
// SPDX-License-Identifier: GPL-3.0-or-later
package input
import "testing"
func TestClipboardChordConsumesBothReleaseOrders(t *testing.T) {
for _, layout := range []KeyboardLayout{DesktopKeyboardLayout, LaptopKeyboardLayout} {
for _, modifierFirst := range []bool{false, true} {
router := NewCommandRouter([]uint32{0xff63}, DefaultCommandBindings(layout))
router.Handle(0xff63, 118, 0, true)
if consumed, command := router.Handle('c', 54, 1, true); !consumed || command != PresentClipboard {
t.Fatalf("layout %d: Cthulhu+Shift+C = %v %q", layout, consumed, command)
}
if consumed, command := router.Handle('c', 54, 1, true); !consumed || command != "" {
t.Fatalf("layout %d: repeated C = %v %q", layout, consumed, command)
}
if modifierFirst {
if consumed, command := router.Handle(0xff63, 118, 1, false); !consumed || command != "" {
t.Fatalf("layout %d: modifier release = %v %q", layout, consumed, command)
}
}
if consumed, command := router.Handle('c', 54, 1, false); !consumed || command != "" {
t.Fatalf("layout %d: C release = %v %q", layout, consumed, command)
}
if !modifierFirst {
if consumed, command := router.Handle(0xff63, 118, 0, false); !consumed || command != "" {
t.Fatalf("layout %d: modifier release = %v %q", layout, consumed, command)
}
}
}
}
}
func TestClipboardChordRequiresShift(t *testing.T) {
router := NewCommandRouter([]uint32{0xff63}, DefaultCommandBindings(DesktopKeyboardLayout))
router.Handle(0xff63, 118, 0, true)
if consumed, command := router.Handle('c', 54, 0, true); consumed || command != "" {
t.Fatalf("unshifted C = %v %q", consumed, command)
}
}