Add global command bypass with Cthulhu+Z

This commit is contained in:
ak47 committed 2026-11-07 22:07:03 -05:00
1 parent d01965c00d
commit 4c95c9f278
26 files changed
+657 -18

No files matched your search

+8 -1
View File
@@ -15,6 +15,8 @@ type CommandListener struct {
ocrPending atomic.Bool
browse atomic.Bool
browseApplied atomic.Bool
bypass atomic.Bool
bypassApplied atomic.Bool
nativeButtonFocus atomic.Bool
nativeButtonApplied atomic.Bool
grabActive atomic.Bool
@@ -82,6 +84,11 @@ func NewCommands(modifiers []string, layout input.KeyboardLayout) *CommandListen
// complete chords, preserving every key release during a mode transition.
func (listener *CommandListener) SetBrowseNavigation(enabled bool) { listener.browse.Store(enabled) }
// SetCommandBypass retains only the bypass shortcut after held keys release.
func (listener *CommandListener) SetCommandBypass(enabled bool) { listener.bypass.Store(enabled) }
func (listener *CommandListener) CommandBypassEnabled() bool { return listener.bypassApplied.Load() }
// SetNativeButtonFocus leaves Return to a standard button with real DOM focus.
// Virtual browse targets elsewhere still use Cthulhu's document activation.
func (listener *CommandListener) SetNativeButtonFocus(focused bool) {
@@ -94,7 +101,7 @@ func (listener *CommandListener) SetCommandGrabs(enabled bool) {
// BrowseNavigationEnabled reports whether requested browse grabs have reached X11.
func (listener *CommandListener) BrowseNavigationEnabled() bool {
return !listener.ocrApplied.Load() && !listener.secure.Load() && listener.browse.Load() && listener.browseApplied.Load() && listener.commandsApplied.Load()
return !listener.bypass.Load() && !listener.ocrApplied.Load() && !listener.secure.Load() && listener.browse.Load() && listener.browseApplied.Load() && listener.commandsApplied.Load()
}
func (listener *CommandListener) CommandGrabsEnabled() bool {