Web fixes.

This commit is contained in:
Storm Dragon
2026-07-18 15:10:43 -04:00
parent 394d814ad0
commit 3e97c1ce33
4 changed files with 89 additions and 13 deletions
+2 -2
View File
@@ -254,6 +254,8 @@ class AXUtilitiesEvent:
reason = TextEventReason.SELECT_ALL
elif mgr.last_event_was_primary_click_or_release():
reason = TextEventReason.MOUSE_PRIMARY_BUTTON
elif mgr.last_event_was_tab_navigation():
reason = TextEventReason.FOCUS_CHANGE
elif AXUtilitiesState.is_editable(obj) or AXUtilitiesRole.is_terminal(obj):
if mgr.last_event_was_backspace():
reason = TextEventReason.BACKSPACE
@@ -273,8 +275,6 @@ class AXUtilitiesEvent:
reason = TextEventReason.UNSPECIFIED_COMMAND
elif mgr.last_event_was_printable_key():
reason = TextEventReason.TYPING
elif mgr.last_event_was_tab_navigation():
reason = TextEventReason.FOCUS_CHANGE
elif AXObject.find_ancestor(obj, AXUtilitiesRole.children_are_presentational):
reason = TextEventReason.UI_UPDATE
return reason
+1 -1
View File
@@ -24,4 +24,4 @@
# Cthulhu project: https://git.stormux.org/storm/cthulhu
version = "2026.07.18"
codeName = "master"
codeName = "testing"
+5 -7
View File
@@ -60,6 +60,7 @@ from cthulhu.scripts import default
from cthulhu.ax_object import AXObject
from cthulhu.ax_text import AXText
from cthulhu.ax_utilities import AXUtilities
from cthulhu.ax_utilities_event import AXUtilitiesEvent, TextEventReason
from .bookmarks import Bookmarks
from .braille_generator import BrailleGenerator
@@ -2104,6 +2105,7 @@ class Script(default.Script):
debug.printMessage(debug.LEVEL_INFO, msg, True)
return False
reason = AXUtilitiesEvent.get_text_event_reason(event)
obj, offset = self.utilities.getCaretContext(document, False, False)
tokens = ["WEB: Context: ", obj, ", ", offset, "(focus: ", cthulhu_state.locusOfFocus, ")"]
debug.printTokens(debug.LEVEL_INFO, tokens, True)
@@ -2156,14 +2158,10 @@ class Script(default.Script):
self.updateBraille(event.source)
return True
if self.utilities.lastInputEventWasTab():
msg = "WEB: Last input event was Tab."
if reason == TextEventReason.FOCUS_CHANGE:
msg = "WEB: Event ignored: Caret moved due to focus change."
debug.printMessage(debug.LEVEL_INFO, msg, True)
if self.utilities.isDocument(event.source):
msg = "WEB: Event ignored: Caret moved in document due to Tab."
debug.printMessage(debug.LEVEL_INFO, msg, True)
return True
return True
if self.utilities.inFindContainer():
msg = "WEB: Event handled: Presenting find results"