On Aug 22, 2014, at 12:31 AM, Josh Scotland <
email@hidden> wrote:
Hey Nick,
Thanks for putting the project up — I did a deeper investigation last night. The code looks correct.
One tip is to return a non-mutable attributed string for the NSAccessibilityAttributedStringForRangeParameterizedAttribute.
thanks, that works! At least to the point of after interacting with the text field, links are announced in the text field, and when VO cursor is on the links after interacting with the text field and moving through its words, VO-Space and VO-Shift-U work!
Only thing that does not work is searching for links using VO-Cmd-L: when interacting with the text field, no next link is found and when looking for previous link, it jumps to a link in the preceding text view. If not interacting with the text field, the whole text field is found as a link (after the links in the text view), VO-Space does not work on it but VO-Shift-U reads the address of the first link (the address is "
http://en.wikipedia.org” of the link with title “Looks”).
If I change the range of the first link in the text field to be NSMakeRange(1, 4) instead of NSMakeRange(0, 5), VO-Cmd-L does not find the link when not interacting with the text field.
This is on latest (public) Mavericks.
A bit related question inspired by your suggestion - generally (not only for the discussed example), would you recommend returning non-mutable types (when they are specified as return types by NSAccessibility API) as a rule of thumb? Like for AXChildren, returning NSArray instead of NSMutableArray, or NSString * instead of NSMutableString * for AXValue/AXDescription etc.?
Thanks,
Boris
When I use an NSTextView instead of an NSTextField, your code works. Please file a bug about adding AXLink support for NSTextFields.
Josh
On Aug 20, 2014, at 1:46 PM, Nick Kocharhook <
email@hidden> wrote:
Absolutely, here it is:
Thanks for the link. I immediately noticed all the accessibilityArray* methods. It’s a bummer to learn that implementing those doesn’t fix the problem. :-(
Happy to accept pull requests, as well. I really appreciate you taking the time to suggest solutions. I’m glad to know that this has been done before and that I’ll eventually get to the bottom of it!
-Nick
On Aug 20, 2014, at 19:36, Boris Dušek <
email@hidden> wrote:
I did hide `NSAccessibilityLinkTextAttribute ` there under `TATTR(Link)`, TATTR is a macro… :-)
I implemented links there as custom objects as well (subclass of NSObject).
I tried to implement most of the differences between my code mentioned above and your sample code (i.e. implementing the accessibilityArray* and accessibilityIndexOfChild: methods on the TextFieldCell, implementing accessibilityHitTest: and accessibilityFocusedUIElement
on the LinkProxyObject, implementing position and size properly for LinkProxyObject etc.), all to no avail.
One thing I wanted to suggest/ask - would it be possible for you (and would you be willing) to put the sample code on github? So that the progress is tracked properly and I could submit pull requests with my improvements? (There is always possibility to
send a link to download zipped version of any commit for GitHub repositories -
https://github.com/<user>/<repo>/archive/<commit-sha1>.zip)