-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Support text attributes with VoiceOver #1114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
VoiceOver can announce text formatting, such as bold font, italics, underline, font, etc., as well as whether text is misspelled. For this, it needs the AXAttributedStringForRange attribute supported. This commit does exactly that. Testing can be done in this way (VO stands for Ctrl-Option): * first interact with the text (VO-Shift-down arrow when standing on the text element) * to announce text attributes for character after cursor, press VO-T * to seek for next: * misspelled text: VO-Cmd-E * color change: VO-Cmd-K * underlined text: VO-Cmd-U * many more (see VO-H-H, "Find", close help with Esc) * to seek for previous *: just add Shift to the shortcut Some attributes remain to be supported (full list of attributes is available at: https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/Protocols/NSAccessibility_Protocol/Reference/Reference.html#//apple_ref/doc/uid/20000945-SW53). The misspelled text VoiceOver support can be used nicely with TextMate's spelling support: 1. the user finds next mistake with VO-Cmd-E, hears the misspelled word, perhaps reads it on a braille display 2. the user then presses Cmd-; to show the spelling menu for that word and chooses the desired resolution (apply suggested correction etc.) 3. go back to step 1. :-)
Forgot to add: I release both patches into the public domain. |
Also I would appreciate tips for situations (perhaps grammar bundles and the specific language construct that triggers the situation in that grammar) where following things happen in text (if they can happen in TextMate at all) - I have not found (met) any:
This would help me to add missing attributes / test existing attributes better. |
Thanks, I merged the 3 commits into 2108810 with just some minor code style changes (about when/where to use spaces). As for your questions: There is only one underline style in addition to the squiggly underline used for misspelled words. There is no use of strikethrough, superscript, or subscript. Links, which can be opened with enter (⌅) or fn-return should (in the normal case) have a scope prefix of
Though getting the destination of the link is not possible. That is, there is a command in the Hyperlink Helper bundle that simply use the document content and sends that to the
I assume for the attribute, the URL destination is needed. As for bold, italic, and underline: These are both styles that the theme can apply, but there are also
These styles can be toggled with ⌘B and ⌘I. In practice it might be better to only use the bold and italic accessibility attributes for these scopes, since a theme making e.g. keywords bold, I would assume, is unnecessary information for a blind person. This can be tested similarly to the I hope that answered your questions, otherwise let me know. |
Thanks for your explanation (and sorry for my delayed answer):
So I would stay (at least for now) on the "conservative" path when reporting these text attributes - report them as they are displayed.
Thanks again for having answered my questions. |
Still I got links working (with the expected limitations) and will be submitting them in the next couple of days :-) |
VoiceOver can announce text formatting, such as bold font, italics,
underline, font, etc., as well as whether text is misspelled. For this, it
needs the AXAttributedStringForRange attribute supported. This commit does
exactly that.
Testing can be done in this way (VO stands for Ctrl-Option):
on the text element)
Some attributes remain to be supported (full list of attributes is
available at:
https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/Protocols/NSAccessibility_Protocol/Reference/Reference.html#//apple_ref/doc/uid/20000945-SW53).
The misspelled text VoiceOver support can be used nicely with TextMate's
spelling support:
perhaps reads it on a braille display
and chooses the desired resolution (apply suggested correction etc.)
Also the user can turn on announcements of attribute changes:
Then when moving in the text with arrows (e.g. arrow down), VoiceOver beeps
(or speaks text attributes) whenever text attributes change.