Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

How to tell a screen reader programmatically to read an Entry character by character?

JohnHardmanJohnHardman GBUniversity admin

Screen readers (such as VoiceOver, TalkBack, and Windows Narrator) are getting much better. However, sometimes they need a bit of help, such as using AutomationProperties.NameProperty to wrap a string, or part of a string, in single quotes. For example replacing "Value is No" by "Value is ''No'" so that it is then read as written, rather than being read as "Value is Number".

I have one particular Entry View that when its Text property is read aloud, it needs to be read character by character (rather than trying to read it as one or more words), ideally using the phonetic alphabet for alphabetic characters. The user could use screen reader controls to make the screen reader do this (on some platforms at least). However, it would be better if the app could tell the screen reader to do it for this one Entry. How can this be done for Android, iOS and UWP? Is there some way that I can tell the screen reader using NameProperty, or will it require custom Entry renderers for each platform?

Best Answers

  • JohnHardmanJohnHardman GBUniversity admin
    Accepted Answer

    Thanks @Jarvan, that gave me the direction to go. I'll bind NameProperty to the appropriate ViewModel property and (if the user has configured it to do so) use a ValueConverter to separate/delimit the characters.

Answers

  • JohnHardmanJohnHardman GBUniversity admin
    Accepted Answer

    Thanks @Jarvan, that gave me the direction to go. I'll bind NameProperty to the appropriate ViewModel property and (if the user has configured it to do so) use a ValueConverter to separate/delimit the characters.

  • JohnHardmanJohnHardman GBUniversity admin

    That does do what I originally asked. Unfortunately, I missed one important piece from the question - when reading, the screen reader needs to distinguish between upper and lower case alphabetic characters, as case is significant for this particular piece of text. I could make the ValueConverter explicitly add (localised forms of) " upper case " or " lower case" for each character, but I'm not sure that's the best way of doing it. I'll investigate the three main screen readers a bit more to see whether they provide the user a way of doing this under user control, although I suspect that I'll end up doing the additional work in the ValueConverter.

  • JohnHardmanJohnHardman GBUniversity admin
    edited November 9

    One extra thing to consider - whilst the above works when having a screen reader speak the text, it isn't what somebody using a Braille device would want. For Braille, it seems likely that the original text would be the ideal, rather than a decorated or delimited version of the text. Such differing requirements are why I would prefer to leave such things to the o/s wherever possible.

  • JohnHardmanJohnHardman GBUniversity admin
    edited November 15

    Ok, further investigation suggests this will need to go platform-specific to get the desired result.
    For example, on iOS, it appears that using a NSMutableAttributedString with accessibilitySpeechSpellOut, accessibilitySpeechIPANotation and/or accessibilitySpeechPunctuation may be the way to go (not that I've worked out how to do that yet).

Sign In or Register to comment.