Cthulhu is no longer a fork. Now it is a screen reader written in Golang.
This commit is contained in:
1 parent
a998fe67de
commit
069fc674dc
708 files changed
+112482
-532
No files matched your search
@@ -0,0 +1,24 @@
|
||||
// Copyright (c) 2026 Storm Dragon
|
||||
// Authors: Storm Dragon, Angus Kola
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package app
|
||||
|
||||
import "git.stormux.org/storm/cthulhu/internal/input"
|
||||
|
||||
// titleInputPolicy follows the latest accepted presentation, including the
|
||||
// period after SPEAK returns while the synthesizer is still speaking it.
|
||||
// Only automatic titles ignore repeats. Normal reading keeps its input policy.
|
||||
// The speech worker's mutex owns this state.
|
||||
type titleInputPolicy struct {
|
||||
protectRepeats bool
|
||||
}
|
||||
|
||||
func (policy *titleInputPolicy) observe(request speechRequest) {
|
||||
policy.protectRepeats = request.Cause == "window-title" && request.Text != ""
|
||||
}
|
||||
|
||||
func (policy *titleInputPolicy) preserves(event input.Event) bool {
|
||||
return policy.protectRepeats && event.Repeat && event.Pressed &&
|
||||
event.Name != "Control_L" && event.Name != "Control_R" && event.Name != "Escape"
|
||||
}
|
||||
Reference in new issue
Block a user