talonvoice / talon

Issue Tracker for the main Talon app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LegacyIAccessiblePattern.select() API appears to be broken

C-Loftus opened this issue · comments

No matter how I call this function I always get an error from the underlying Python library. I suspect the binding isn't passing in the arugment properly or something analogous. I don't have any errors in my editor or from the top level API.

I have tried

root = ui.active_window().element
ax.LegacyIAccessiblePattern.select(root.legacyiaccessible_pattern, flags=2)

or

root = ui.active_window().element
root.legacyiaccessible_pattern.select(flags=2)

and both throw errors. I have also tried many different permutations of different flag numbers or ways of passing other arguments in just to check. Nothing seems to work with this specific function but the element.legacyiaccessible_pattern.do_default_action() works fine without issue. (I just would like to ideally have greater control and use the select function if possible.

2024-02-26 15:02:43.545 ERROR user.sight-free-talon.utils.access-focus (c:\users\cloftus\appdata\roaming\talon\user\sight-free-talon\utils\access-focus.py) import failed
   17:                                threading.py:1002* # cron thread
   16:                                threading.py:1045* 
   15:                                threading.py:982 * 
   14:                               talon\cron.py:153 | 
   13:                     talon\scripting\rctx.py:235 | # 'cron' main:Cron.interval.<locals>.call()
   12:                               talon\cron.py:181 | 
   11:                                 talon\fs.py:62  | 
   10:                                 talon\fs.py:58  | 
    9:                     talon\scripting\rctx.py:235 | # 'fs' main:Loader.on_change()
    8:                     app\resources\loader.py:750 | 
    7:                     app\resources\loader.py:715 | 
    6:                     app\resources\loader.py:425 | # [stack splice]
    5:                       importlib\__init__.py:126 | 
    4:                     app\resources\loader.py:240 | 
    3:                     app\resources\loader.py:235 | 
    2: user\sight-free-talon\utils\access-focus.py:76  | root.legacyiaccessible_pattern.select(..
    1:                         talon\windows\ax.py:578 | 
TypeError: WindowsAxProxyPython.iaccessible_select() missing 1 required positional argument: 'flags'

To clarify, the function described above doesn't seem to be an accessibility issue. It always throws a type error for the function arguments no matter the context or application or the arguments passed in. I don't think the underlying code matches the .pyi API or something doesn't match up.

And for context, I have confirmed the accessibility patterns work as expected, I tested in VSCode for context, not anything I created. Also, Talon's API for LegacyIAccessiblePattern does work as intended within VSCode and other applications generally with do_default_action() just not select() that always has the aforementioned type error

I see, should be fixed in the next beta, thanks!