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: David Niemeijer <email@hidden>
- Date: Sun, 5 Oct 2003 15:42:13 +0200
Hi Bill,
> 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.
Custom highlighting UI elements is not a problem. However, in terms
of user experience it is much nicer if my app makes use of the
highlighting that is build into certain user interface elements. For
example, menu items are typically highlighted in blue on jaguar.
Using that built-in highlighting will be much more pleasant for the
user than putting a red (or even blue) overlay window above a menu
item. The overlay window approach makes especially sense for elements
that do not have a built-in highlighting.
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).
This part I have already under control. The only thing that is really
bugging me is that I do not have direct control over the highlighting
status of particular UI elements. Now I have to work, for example,
with the arrow keys to step through the menu bar or the items of a
menu. I need more control then the arrow keys can give me.
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.)
I still need to test this part of my code on Panther so I hope easier
does not imply that it will break my Jaguar code :-)
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.
Probably, or should I say hopefully ;-) I have not tried this yet as
I find access to the dock more important.
david.
_______________________________________________
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.