Voice Over Performance for Complex Custom View
Voice Over Performance for Complex Custom View
- Subject: Voice Over Performance for Complex Custom View
- From: Xiang Cao <email@hidden>
- Date: Wed, 16 Sep 2009 13:35:02 -0700
- Thread-topic: Voice Over Performance for Complex Custom View
Title: Voice Over Performance for Complex Custom View
Hi All,
I’m working on making our app accessible to voice over on snow leopard. Our app has a very complicated custom view. Basically, the only standard thing is a NSWindow which holds a NSView which holds all the custom elements. So I created my own accessibility object from NSObject and fully comply with NSAccessibility protocol. Every thing works fine, except it’s a little slow.
For example, when I move the VO cursor with keyboard to from one deepest element to another, I have to wait almost a second. I think this may due our huge custom view hierarchy, although most of them are ignored.
I traced some logs on accessibilityAttributeValue and I found it’s being called TOO frequently. For example, if I move the VO cursor with keyboard to from one deepest element to another, the title attribute of one single element is being called three times. I wonder why the voice over need to fetch the attributes for multiple times for a single operation? And I also found no matter what kind operation I did with voice over (move, interact), the voice over will search the entire hierarchy from top level for children for N times (N>10).
I see there are three new functions are introduced with Snow Leopard:
- (NSUInteger)accessibilityArrayAttributeCount:(NSString *)attribute
- - (NSArray *)accessibilityArrayAttributeValues:(NSString *)attribute index:(NSUInteger)index maxCount:(NSUInteger)maxCount
- - (NSUInteger)accessibilityIndexOfChild:(id)child
It seems they are designed to make the attribute fetching more efficient. But I’m not sure how to implement them. After engaged these functions, the voice over cannot get the proper elements.
Another problem I encountered is with mouse moved VO cursor. When I set the VO cursor follows the mouse cursor, strange things happened. The hit test works great. It is enable to find the deepest element under my mouse. But when I move my mouse from one element to another, the voice over start to read the new element very quickly, but the vo cursor has not been moved to the new element. After 0.5 second of computing, the vo cursor finally moved to the new element but the voice over starts to read it again and the first reading is cut. So it sounds like a double hit every time. I’m not sure what I did wrong. Because other app does not behave like this.
Any ideas? Thanks.
Xiang
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden