Re: How to use the Accessibility API to highlight something?
Re: How to use the Accessibility API to highlight something?
- Subject: Re: How to use the Accessibility API to highlight something?
- From: Bill Cheeseman <email@hidden>
- Date: Sun, 05 Oct 2003 06:10:35 -0400
on 03-10-05 2:50 AM, David Niemeijer at email@hidden wrote:
>
I would like to know whether it is somehow possible to use the
>
Accessibility API to highlight something, such as a menu item or a
>
button in the Dock without actually pressing or picking it (which
>
obviously will do more than just highlighting)?
PreFab UI Browser 1.2 (not yet released publicly) adapts the overlay window
example code in UI Element Inspector to highlight UI elements. It is quite
easy to implement.
The question you pose presents a user interface issue: how to let the user
identify which UI element to highlight. In the case of UI Browser, I use our
browser window as a surrogate for the target application's entire user
interface, to let the user browse all UI elements and select one without
actually opening or executing any of them. In the case of UI Element
Inspector, it reads the element currently under the mouse (UI Browser does
that, too).
In your case, I think you might want to try a third alternative: let the
user hit a key or click a button to enter a mode where clicking the key or
button again repeatedly (or perhaps use a timer with a regulatable cycle
frequency, so the user doesn't have to manipulate the hardware) would
advance the highlighting systematically through every UI element in the
target application (activating the target application so the highlighted
element is clearly identifiable), with another key or button designated to
select the currently highlighted element. In the case of menus and submenus,
you would have to "open" them temporarily so the highlighted menu item is
visible, but there is Accessibility API for that (pick a menu instead of a
menu item; you can try it in UI Browser's Actions drawer with a menu
selected).
You can get an idea of how this would feel in UI Browser 1.2 beta. Turn
highlighting on by clicking the Highlight checkbox; then select a UI element
in the browser window; then hit the up or down arrow key repeatedly to cycle
through other UI elements at the same level, or the left and right arrow key
to move to the next level -- every time you hit an arrow key, the
highlighting shifts to the next UI element.
The Accessibility API (and the Mac OS, for that matter) treats menus quite
differently in Panther. You will find it easier to do what you're doing in
Panther with respect to menus, I think. (Note that submenu items can still
be highlighted in the wrong location unless the submenu has been opened.)
As to the Dock, that's your other question and I don't know the answer. You
will also want to tackle the menu extras at the right end of the menu bar. I
think that is doable by setting SystemUIServer as the target application.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
accessibility-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/accessibility-dev
Do not post admin requests to the list. They will be ignored.