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,45 @@
|
||||
// Copyright (c) 2026 Storm Dragon
|
||||
// Authors: Storm Dragon, Angus Kola
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package app
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.stormux.org/storm/cthulhu/internal/input"
|
||||
)
|
||||
|
||||
func runCopyFeedback(ctx context.Context, changes <-chan struct{}, source any, speech speechEnqueuer, live *liveSettings, ocr *ocrSession) <-chan struct{} {
|
||||
done := make(chan struct{})
|
||||
go func() {
|
||||
defer close(done)
|
||||
var announced uint64
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case _, ok := <-changes:
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
activity := recentInput(source)
|
||||
if ocr != nil && ocr.Reviewing() {
|
||||
if activity.Clipboard == input.CopyAction {
|
||||
announced = activity.Sequence
|
||||
}
|
||||
continue
|
||||
}
|
||||
if live != nil && live.Load().Reading.AutomaticallyReadClipboardChanges {
|
||||
continue
|
||||
}
|
||||
if activity.Clipboard != input.CopyAction || activity.Sequence == 0 || activity.Sequence == announced {
|
||||
continue
|
||||
}
|
||||
announced = activity.Sequence
|
||||
speech.Enqueue(speechRequest{Text: "copied to clipboard", Role: "system", Cause: "clipboard"})
|
||||
}
|
||||
}
|
||||
}()
|
||||
return done
|
||||
}
|
||||
Reference in new issue
Block a user