Voiceover with external keyboard

Hello,

we have a custom pop-up menu created as a child UIViewController in the same UIWindow as the rest of the app. We would like to provide the same experience for users with Voice Over and external keyboard as they have with UIContextMenu - when menu is open, pressing ESC key closes menu (not pop UIViewController).

Is it possible to locally disable popping UIViewController when ESC key is pressed and Voice Over is on?

Thank you

Accepted Answer

Hey there, what you're seeing is likely coming from the system's default behavior for accessibilityPerformEscape, which is a common VoiceOver gesture to "go back" or "escape" the from current context.

This is available as API for you to override in custom classes you write. Depending on the behavior you're looking for, you can try overriding the accessibilityPerformEscape method to have custom logic run before you return. Keep in mind that VoiceOver users are very familiar with the escape gesture both when interfacing with a keyboard (pressing the Escape key) but also when using touch on the display (2-finger scrub gesture), so changing the behavior in your app to differ greatly from the system's default behavior is not necessarily recommended

Here's a link to the accessibilityPerformEscape API if you're interested in learning more: https://developer.apple.com/documentation/objectivec/nsobject/1615091-accessibilityperformescape

Voiceover with external keyboard
 
 
Q