UI Accessibility Plugin  Version 1.1.1
Make your UI accessible for visually impaired users
UAP_AccessibilityManager Class Reference

This is the main object to handle all the accessibility in an app. Please use the premade Accessibility Manager prefab. More...

Inheritance diagram for UAP_AccessibilityManager:

Public Types

enum  ESDirection { EUp = 0, EDown, ELeft, ERight }
 

Public Member Functions

delegate void OnPauseToggleCallbackFunc ()
 
delegate void OnTapEvent ()
 
delegate void OnSwipeEvent ()
 
delegate void OnAccessibilityModeChanged (bool enabled)
 
void OnSwipe (ESDirection dir, int fingerCount)
 

Static Public Member Functions

static void SetLanguage (string language)
 Change the plugin's language, this will reload the localization table for all plugin related strings. On first app start, the plugin will try to detect the system's language. If the language is not supported, the plugin will use the first language in the localization table (English). More...
 
static bool ShouldUseBuiltInKeyboard ()
 Internal use for text edit boxes Returns whether the system native keyboard or the plugin's own virtual on-screen keyboard should be used More...
 
static void PauseAccessibility (bool pause, bool forceRepeatCurrentItem=false)
 Temporarily suspend the core accessibility features. This is useful if your game requires direct touch input for gameplay. You can call this function regardless of whether the accessibility mode is enabled or not (if it is not, it will NOT enable it). There is no need to query the state of the plugin with IsEnabled() first. When accessibility is suspended but not disabled, the plugin will continue to listen to magic gestures (unless that is disabled in the Settings). Please see the documentation for a more thorough explanation. To turn off the accessibility completely, use EnableAccessibility() instead. More...
 
static void BlockInput (bool block, bool stopSpeakingOnBlock=true)
 This function temporarily blocks input from users to the Accessibility System. Use this to have the accessibility plugin ignore any input from users, but keep the touch blocker active that prevents blind users from accidentally hitting any of your UI elements.

This function is useful if you have a native dialog open, if you want to wait for a sound or animation to finish, or need an announcement to be done before you accept user input again.

If the Accessibility Plugin is inactive or paused, or is not set to handle UI this will have no effect.
This will not stop speech from playing, so you can still use the TTS functionality. Use this instead of ::PauseAccessibility if you still need speech. More...
 
static void ElementRemoved (AccessibleUIGroupRoot.Accessible_UIElement element)
 
static void ActivateContainer (AccessibleUIGroupRoot container, bool activate)
 Called by a UI container to make its content (un-)available for interaction. You don't need to call this function from your own code unless you write a custom implementation of AccessibleUIGroupRoot class. More...
 
static void ResetCurrentContainerFocus ()
 
static bool IsEnabled ()
 Returns whether Accessibility mode is enabled or not. This does not consider paused state. If the Accessibility mode is active, but currently paused, this function will still return true. If you need to know whether the mode is active, query IsActive() instead. More...
 
static new string GetInstanceID ()
 
static bool IsActive ()
 Returns whether Accessibility mode is enabled and unpaused. If the plugin is enabled, but currently paused, this function will return true. Please use IsEnabled() if you want to query whether the plugin is enabled at all. More...
 
static bool IsCurrentPlatformSupported ()
 Convenience function to check whether the current platform is officially supported. Has no further effect on the plugin. More...
 
static void EnableMagicGestures (bool enable)
 
static bool IsMagicGesturesEnabled ()
 
static void EnableAccessibility (bool enable, bool readNotification=false)
 Use this to completely enable/disable the accessibility plugin. If accessibility is disabled, there will be no reaction to any user input, calls to Say() will be ignored, and calls to PauseAccessibility() will have no effect.
Use this to turn on/off accessibility via your app's menu.
You can also use the Plugin Toggle component to do this automatically. See Plugin Toggle Documentation. More...
 
static void ToggleAccessibility ()
 
static void FinishCurrentInteraction ()
 
static bool GetSpeakDisabledInteractables ()
 
static void SetFocusToTopOfPage ()
 Forces the focus to jump to the first element on the page. This is used when doing the 'Read From Top' gesture, or can be requested by the game. More...
 
static void ReadFromCurrent ()
 Starts automatically reading everything on screen, starting with the selected item. More...
 
static void ReadFromTop ()
 Starts automatically reading everything on screen, starting with the first item. The first item is determined as the top-most item (or the item with the smallest manual traversal order) in the first UI Group (with the highest priority). More...
 
static void Say (string textToSay, bool canBeInterrupted=true, bool allowVoiceOver=true, UAP_AudioQueue.EInterrupt interrupts=UAP_AudioQueue.EInterrupt.Elements)
 Say something using platform independent Text To Speech. If you disabled TTS in the settings, or TTS is not available on the current platform, the call will be ignored. More...
 
static void SaySkippable (string textToSay)
 Will only trigger if no sound is playing. Other skippable sounds will not prevent this from playing. Try to only use this when your text doesn't contain vital information, or if the information is also conveyed by sound, or can be obtained another way later. More...
 
static void SayAs (string textToSay, UAP_AudioQueue.EAudioType sayAs, UAP_AudioQueue.UAP_GenericCallback callback=null)
 
static bool IsSpeaking ()
 This function returns whether there is currently voice audio playing. This includes Text-To-Speech voice or pre-recorded audio clips, if those were provided. It does not include sound effects.

Apps can use this if they want to wait for everything to be finished before triggering more audio. Works especially well in combination with temporary preventing input via ::BlockInput during the wait, to make sure not further voice output is started.

Please note that the function is not 100% exact. Depending on the TTS system, it isn't always possible to find out whether the voice is still speaking. So instead the system estimates an approximate speaking duration. More...
 
static bool IsTalkBackEnabledAndTouchExploreActive ()
 
static bool IsTalkBackEnabled ()
 Is Google TalkBack activated (on or suspended). It is impossible to tell whether TalkBack is currently suspended, as the system still reports it as active in that case. More...
 
static void RegisterOnPauseToggledCallback (OnPauseToggleCallbackFunc func)
 Register to be notified when the user made the Pause gesture / Magic Tap. The magic tap is a two finger double tap. See the documentation on Magic Gestures. More...
 
static void UnregisterOnPauseToggledCallback (OnPauseToggleCallbackFunc func)
 Unregister from notifications when the user made the Pause gesture / Magic Tap. See the documentation on Magic Gestures. More...
 
static void RegisterOnBackCallback (OnTapEvent func)
 Register to receive a callback when the user made the gesture for Back. See the documentation on Magic Gestures. More...
 
static void UnregisterOnBackCallback (OnTapEvent func)
 Unregister from notifications when the user made the gesture for Back. See the documentation on Magic Gestures. More...
 
static void RegisterOnTwoFingerSingleTapCallback (OnTapEvent func)
 Register to be notified when the user tapped the screen once with two fingers. Using this callback ensures that the user did not intend to do a magic tap (two finger double tap). It is fired only after the double tap threshold time is up. More...
 
static void UnregisterOnTwoFingerSingleTapCallback (OnTapEvent func)
 Unregister from callback for two finger single taps. More...
 
static void RegisterOnThreeFingerSingleTapCallback (OnTapEvent func)
 Register to be notified when the user tapped the screen once with three fingers. Using this callback ensures that the user did not intend to do a three finger double or triple tap. It is fired only after the double tap threshold time is up. More...
 
static void UnregisterOnThreeFingerSingleTapCallback (OnTapEvent func)
 Unregister from callback for three finger single taps. More...
 
static void RegisterOnThreeFingerDoubleTapCallback (OnTapEvent func)
 Register to be notified when the user tapped the screen twice with three fingers. Using this callback ensures that the user did not intend to do a three finger triple tap. It is fired only after the double tap threshold time is up. More...
 
static void UnregisterOnThreeFingerDoubleTapCallback (OnTapEvent func)
 Unregister from callback for three finger double taps. More...
 
static void RegisterAccessibilityModeChangeCallback (OnAccessibilityModeChanged func)
 Get notified when the accessibility mode turns on/off. The Accessibility Plugin can be enabled by the user with a three finger triple tap at any time. In addition, if the app is resumed from suspension, and a screen reader is now detected and the plugin wasn't enabled yet, it will then enable itself as well. This serves as a safeguard for blind people that accidentally disable accessibility mode and exit and re-enter the app in hopes to restore accessibility mode.

More...
 
static void UnregisterAccessibilityModeChangeCallback (OnAccessibilityModeChanged func)
 Stop receiving notifications when the accessibility mode state changes. More...
 
static void SetTwoFingerSwipeUpHandler (OnTapEvent func)
 Overrides the regular two finger swipe up function, which is Read-From-Top. Use this to handle the gesture yourself. This will stop the Read-From-Top feature from working until ::ResetTwoFingerSwipeUpHandler is called.

This can be very useful during gameplay, if the gesture is used to read out stats or help instead. More...
 
static void ResetTwoFingerSwipeUpHandler ()
 
static void RegisterOnTwoFingerSwipeLeftCallback (OnTapEvent func)
 
static void UnregisterOnTwoFingerSwipeLeftCallback (OnTapEvent func)
 
static void RegisterOnTwoFingerSwipeRightCallback (OnTapEvent func)
 
static void UnregisterOnTwoFingerSwipeRightCallback (OnTapEvent func)
 
static void SetTwoFingerSwipeDownHandler (OnTapEvent func)
 Overrides the regular two finger swipe down function, which is Read-From-Current-Element. Use this to handle the gesture yourself. This will stop the Read-From-Current-Element feature from working until ::ResetTwoFingerSwipeDownHandler is called.

This can be very useful during gameplay, if the gesture is used to read out stats or help instead. More...
 
static void ResetTwoFingerSwipeDownHandler ()
 
static bool SelectElement (GameObject element, bool forceRepeatItem=false)
 
static bool MakeActiveContainer (AccessibleUIGroupRoot container, bool forceRepeatActiveItem=false)
 
static GameObject GetCurrentFocusObject ()
 Retrieve the GameObject containing the UI element that currently has the focus. This might be null. More...
 
static bool UseAndroidTTS ()
 
static bool UseiOSTTS ()
 
static bool UseWindowsTTS ()
 
static bool UseMacOSTTS ()
 
static bool UseWebGLTTS ()
 
static void RecalculateUIElementsOrder (GameObject parent=null)
 This function refreshes the internal order in which the UI elements are stepped through by their on screen position. You might want to call this function if you have an intro animation that builds up your menu screen and the animation moves the buttons, labels etc around. If you find the order in which the menu is traversed is wrong, this function should be called after the animation is done and it will recalculate the order based on the current positions of the elements.

You should provide the parent of the top most object that moved, to make sure to include all containers underneath. If you don't specify a parent, this function will recalculate ALL containers currently in the scene, which is considerably slower. More...
 
static int GetSpeechRate ()
 Get the current speech rate in the range from 1 to 100. The plugin will take care of loading and saving the speech rate. More...
 
static int SetSpeechRate (int speechRate)
 Set the speech rate in the range 1 to 100. Not supported on all platforms. The speech rate will not affect VoiceOver. If your app is only using VoiceOver, you don't need to touch this at all. If the rate is out of range, it will be clamped to a valid value. Function will return the new (capped) value. The plugin will take care of loading and saving the speech rate. More...
 
static void StopSpeaking ()
 
static string Localize (string key)
 This function is called from the Accessible UI component if the Is Localization Key checkbox is ticked. More...
 
static string Localize_Internal (string key)
 Localize a plugin related internal string, using the UAP localization table More...
 
static bool IsVoiceOverAllowed ()
 
static string FormatNumberToCurrentLocale (ulong intNumber)
 Converts an integer number into a string and adds in separators between thousands to help the voice output read the numbers correctly. The separators are culture specific either commas or points.
Example: While the US uses commas to separate thousands (1,200.00), most European countries use dots (1.200,00). More...
 
static string FormatNumberToCurrentLocale (double floatNumber)
 

Public Attributes

bool m_DefaultState = false
 The state for accessibility on the very first launch of your app. Leave this at false unless this is an app purely for the sight impaired. More...
 
bool m_AutoTurnOnIfScreenReaderDetected = true
 Automatically turn on accessibility if active NVDA/VoiceOver/TalkBack is detected.
 
bool m_RecheckAutoEnablingOnResume = false
 
bool m_SaveEnabledState = false
 Turn accessibility mode on or off, depending on what it was when the app was last closed.
 
bool m_HandleUI = true
 If true (Default), the manager will block direct touch to the screen. The plugin listens for UI control gestures, such as left and right swipe. Buttons will not be selectable with single tap anymore. Set this to false if you don't want this part active.
 
bool m_HandleMagicGestures = true
 If true, will recognize magic gestures. for functions like Back, Exit and Pause, and call the appropriate callbacks. This can be active even if the UI handling is disabled.
 
bool m_ExploreByTouch = true
 Reads out the UI element that is under the user's finger. If m_HandleUI is false, this setting will be ignored. As this is a standard accessibility feature on smart phones, do not turn this off unless you have a good reason.
 
bool m_ReadDisabledInteractables = true
 Reads out disabled but visible interactive UI elements. This means buttons, toggles and sliders will be read out, even when they are disabled (but they must be visible). The plugin will read out "Disabled" after the name. Default is true, as this emulates the behavior from iOS VoiceOver. More...
 
bool m_CyclicMenus = false
 When reaching the last element on the screen, the focus will jump back around to the first element if this is set to true. By default, this is false, which triggers a sound effect when the border of the screen is reached. More...
 
bool m_AllowBuiltInVirtualKeyboard = true
 If true, the plugin will use it's own built-in virtual keyboard instead of the native on screen keyboard when handling text input for edit fields. If disabled, players will have to re-enable TalkBack when editing any text fields. On iOS, newer versions Unity often grabs the focus away from the keyboard and cause the text input to stop completely. The built-in keyboard solves both issues. This feature is only used on mobile. More...
 
bool m_DebugOutput = false
 
bool m_WindowsUseMouseSwipes = false
 
bool m_EditorOverride = false
 Quick way to enable/disable the plugin during development in Editor only. This variable will be ignored in any standalone builds. More...
 
bool m_EditorEnabledState = false
 
bool m_WebGLTTS = true
 
string m_GoogleTTSAPIKey = ""
 Google Cloud Text-To-Speech API key. Please see documentation for step-by-step instructions on how to get this value More...
 
bool m_WindowsTTS = true
 
int m_WindowsTTSVolume = 100
 
bool m_WindowsUseKeys = true
 
bool m_AndroidTTS = true
 
bool m_AndroidUseUpAndDownForElements = false
 
bool m_iOSTTS = true
 
bool m_MacOSTTS = true
 
AudioClip m_UINavigationClick = null
 SFX when the UI element is changed
 
AudioClip m_UIInteract = null
 SFX when a button is pressed
 
AudioClip m_UIFocusEnter = null
 SFX when an element receives exclusive focus, such as a slider
 
AudioClip m_UIFocusLeave = null
 SFX when an element loses exclusive focus, such as a slider
 
AudioClip m_UIBoundsReached = null
 SFX when navigation reaches the end of the screen
 
AudioClip m_UIPopUpOpen = null
 SFX when popup opens
 
AudioClip m_UIPopUpClose = null
 SFX when popup closes
 
AudioSource m_AudioPlayer = null
 
AudioSource m_SFXPlayer = null
 
RectTransform m_Frame = null
 
GameObject m_FrameTemplate = null
 
GameObject m_TouchBlocker = null
 
Text m_DebugOutputLabel = null
 
bool m_AllowVoiceOverGlobal = true
 
bool m_DetectVoiceOverAtRuntime = true
 

Static Public Attributes

static string PluginVersion = "1.1.1"
 
static float PluginVersionAsFloat = 1.11f
 

Properties

bool WindowsUseExploreByTouch [get]
 
static string GoogleTTSAPIKey [get]
 

Detailed Description

This is the main object to handle all the accessibility in an app. Please use the premade Accessibility Manager prefab.

Member Function Documentation

static void UAP_AccessibilityManager.ActivateContainer ( AccessibleUIGroupRoot  container,
bool  activate 
)
static

Called by a UI container to make its content (un-)available for interaction. You don't need to call this function from your own code unless you write a custom implementation of AccessibleUIGroupRoot class.

Parameters
containerThe UI container containing the accessible UI elements.
activateWhether to enable or disable the elements.
static void UAP_AccessibilityManager.BlockInput ( bool  block,
bool  stopSpeakingOnBlock = true 
)
static

This function temporarily blocks input from users to the Accessibility System. Use this to have the accessibility plugin ignore any input from users, but keep the touch blocker active that prevents blind users from accidentally hitting any of your UI elements.

This function is useful if you have a native dialog open, if you want to wait for a sound or animation to finish, or need an announcement to be done before you accept user input again.

If the Accessibility Plugin is inactive or paused, or is not set to handle UI this will have no effect.
This will not stop speech from playing, so you can still use the TTS functionality. Use this instead of ::PauseAccessibility if you still need speech.

Parameters
blocktrue if you want to suspend the input, false to restore
static void UAP_AccessibilityManager.EnableAccessibility ( bool  enable,
bool  readNotification = false 
)
static

Use this to completely enable/disable the accessibility plugin. If accessibility is disabled, there will be no reaction to any user input, calls to Say() will be ignored, and calls to PauseAccessibility() will have no effect.
Use this to turn on/off accessibility via your app's menu.
You can also use the Plugin Toggle component to do this automatically. See Plugin Toggle Documentation.

Note that the user can still turn on accessibility via the three finger triple tap. Disable this Magic Gesture individually if your want this to be disabled too. This is inadvisable though, as it leaves blind users who accidentally turn off accessibility with no option of turning it back on.

Parameters
enablewheter to enable or disable plugin
readNotificationif true, the plugin will announce the state change via TTS, so that the user gets audio confirmation
static string UAP_AccessibilityManager.FormatNumberToCurrentLocale ( ulong  intNumber)
static

Converts an integer number into a string and adds in separators between thousands to help the voice output read the numbers correctly. The separators are culture specific either commas or points.
Example: While the US uses commas to separate thousands (1,200.00), most European countries use dots (1.200,00).

Parameters
intNumber
Returns
static GameObject UAP_AccessibilityManager.GetCurrentFocusObject ( )
static

Retrieve the GameObject containing the UI element that currently has the focus. This might be null.

Returns
static int UAP_AccessibilityManager.GetSpeechRate ( )
static

Get the current speech rate in the range from 1 to 100. The plugin will take care of loading and saving the speech rate.

Returns
speech rate
static bool UAP_AccessibilityManager.IsActive ( )
static

Returns whether Accessibility mode is enabled and unpaused. If the plugin is enabled, but currently paused, this function will return true. Please use IsEnabled() if you want to query whether the plugin is enabled at all.

Returns
true if plugin is enabled and unpaused
static bool UAP_AccessibilityManager.IsCurrentPlatformSupported ( )
static

Convenience function to check whether the current platform is officially supported. Has no further effect on the plugin.

Returns
static bool UAP_AccessibilityManager.IsEnabled ( )
static

Returns whether Accessibility mode is enabled or not. This does not consider paused state. If the Accessibility mode is active, but currently paused, this function will still return true. If you need to know whether the mode is active, query IsActive() instead.

Returns
true if the plugin is active, false otherwise
static bool UAP_AccessibilityManager.IsSpeaking ( )
static

This function returns whether there is currently voice audio playing. This includes Text-To-Speech voice or pre-recorded audio clips, if those were provided. It does not include sound effects.

Apps can use this if they want to wait for everything to be finished before triggering more audio. Works especially well in combination with temporary preventing input via ::BlockInput during the wait, to make sure not further voice output is started.

Please note that the function is not 100% exact. Depending on the TTS system, it isn't always possible to find out whether the voice is still speaking. So instead the system estimates an approximate speaking duration.

Returns
static bool UAP_AccessibilityManager.IsTalkBackEnabled ( )
static

Is Google TalkBack activated (on or suspended). It is impossible to tell whether TalkBack is currently suspended, as the system still reports it as active in that case.

Returns
Returns true if TalkBack is either active or currently suspended, and false if it is inactive.
static string UAP_AccessibilityManager.Localize ( string  key)
static

This function is called from the Accessible UI component if the Is Localization Key checkbox is ticked.

If NGUI support is enabled, this function will use NGUI's inhouse localization function to localize the text. In all other cases, you can use this function to hook up your own localization system/plugin and make the appropriate call.

Parameters
key
Returns
static string UAP_AccessibilityManager.Localize_Internal ( string  key)
static

Localize a plugin related internal string, using the UAP localization table

Parameters
key
Returns
static void UAP_AccessibilityManager.PauseAccessibility ( bool  pause,
bool  forceRepeatCurrentItem = false 
)
static

Temporarily suspend the core accessibility features. This is useful if your game requires direct touch input for gameplay. You can call this function regardless of whether the accessibility mode is enabled or not (if it is not, it will NOT enable it). There is no need to query the state of the plugin with IsEnabled() first. When accessibility is suspended but not disabled, the plugin will continue to listen to magic gestures (unless that is disabled in the Settings). Please see the documentation for a more thorough explanation. To turn off the accessibility completely, use EnableAccessibility() instead.

Parameters
pausetrue to pause, false to resume
static void UAP_AccessibilityManager.ReadFromCurrent ( )
static

Starts automatically reading everything on screen, starting with the selected item.

static void UAP_AccessibilityManager.ReadFromTop ( )
static

Starts automatically reading everything on screen, starting with the first item. The first item is determined as the top-most item (or the item with the smallest manual traversal order) in the first UI Group (with the highest priority).

static void UAP_AccessibilityManager.RecalculateUIElementsOrder ( GameObject  parent = null)
static

This function refreshes the internal order in which the UI elements are stepped through by their on screen position. You might want to call this function if you have an intro animation that builds up your menu screen and the animation moves the buttons, labels etc around. If you find the order in which the menu is traversed is wrong, this function should be called after the animation is done and it will recalculate the order based on the current positions of the elements.

You should provide the parent of the top most object that moved, to make sure to include all containers underneath. If you don't specify a parent, this function will recalculate ALL containers currently in the scene, which is considerably slower.

Parameters
parent
static void UAP_AccessibilityManager.RegisterAccessibilityModeChangeCallback ( OnAccessibilityModeChanged  func)
static

Get notified when the accessibility mode turns on/off. The Accessibility Plugin can be enabled by the user with a three finger triple tap at any time. In addition, if the app is resumed from suspension, and a screen reader is now detected and the plugin wasn't enabled yet, it will then enable itself as well. This serves as a safeguard for blind people that accidentally disable accessibility mode and exit and re-enter the app in hopes to restore accessibility mode.

Parameters
funcfunction to receive the callback
static void UAP_AccessibilityManager.RegisterOnBackCallback ( OnTapEvent  func)
static

Register to receive a callback when the user made the gesture for Back. See the documentation on Magic Gestures.

static void UAP_AccessibilityManager.RegisterOnPauseToggledCallback ( OnPauseToggleCallbackFunc  func)
static

Register to be notified when the user made the Pause gesture / Magic Tap. The magic tap is a two finger double tap. See the documentation on Magic Gestures.

The plugin can only detect that the gesture was triggered. It does not maintain your app's paused state (because you might have other things/buttons trigger a pause). That's why there is no bool parameter to the callback function Do not forget to call UnregisterOnPauseToggledCallback() when your object gets destroyed.

Parameters
funcMember function to call when the gesture is detected.
static void UAP_AccessibilityManager.RegisterOnThreeFingerDoubleTapCallback ( OnTapEvent  func)
static

Register to be notified when the user tapped the screen twice with three fingers. Using this callback ensures that the user did not intend to do a three finger triple tap. It is fired only after the double tap threshold time is up.

Parameters
funcMember function to call when the gesture is detected.
static void UAP_AccessibilityManager.RegisterOnThreeFingerSingleTapCallback ( OnTapEvent  func)
static

Register to be notified when the user tapped the screen once with three fingers. Using this callback ensures that the user did not intend to do a three finger double or triple tap. It is fired only after the double tap threshold time is up.

Parameters
funcMember function to call when the gesture is detected.
static void UAP_AccessibilityManager.RegisterOnTwoFingerSingleTapCallback ( OnTapEvent  func)
static

Register to be notified when the user tapped the screen once with two fingers. Using this callback ensures that the user did not intend to do a magic tap (two finger double tap). It is fired only after the double tap threshold time is up.

Parameters
funcMember function to call when the gesture is detected.
static void UAP_AccessibilityManager.Say ( string  textToSay,
bool  canBeInterrupted = true,
bool  allowVoiceOver = true,
UAP_AudioQueue.EInterrupt  interrupts = UAP_AudioQueue.EInterrupt.Elements 
)
static

Say something using platform independent Text To Speech. If you disabled TTS in the settings, or TTS is not available on the current platform, the call will be ignored.

Parameters
textToSaystring to speak using Text-to-Speech
canBeInterruptedYou can prevent interuption and force this line to be finished, regardless of what the user does. Generally not recommended.
allowVoiceOveriOS only - whether regular VoiceOver (if enabled) should speak the text. This should only be set to false if you also offer speech settings. It can make sense to suppress VoiceOver if you really (really!) need to prevent the game audio volume being temporarily lowered for the speech. Don't touch this otherwise, as blind users much prefer to be able to use their own, custom VoiceOver voice and speech settings. (Did I stress this point enough?)
interruptsBy default, this call will interrupt regular UI announcements, but not previous calls to this Say() function from within your own code. Change to ALL to interrupt everything.
static void UAP_AccessibilityManager.SaySkippable ( string  textToSay)
static

Will only trigger if no sound is playing. Other skippable sounds will not prevent this from playing. Try to only use this when your text doesn't contain vital information, or if the information is also conveyed by sound, or can be obtained another way later.

Parameters
textToSaytext string to speak
static void UAP_AccessibilityManager.SetFocusToTopOfPage ( )
static

Forces the focus to jump to the first element on the page. This is used when doing the 'Read From Top' gesture, or can be requested by the game.

static void UAP_AccessibilityManager.SetLanguage ( string  language)
static

Change the plugin's language, this will reload the localization table for all plugin related strings. On first app start, the plugin will try to detect the system's language. If the language is not supported, the plugin will use the first language in the localization table (English).

static int UAP_AccessibilityManager.SetSpeechRate ( int  speechRate)
static

Set the speech rate in the range 1 to 100. Not supported on all platforms. The speech rate will not affect VoiceOver. If your app is only using VoiceOver, you don't need to touch this at all. If the rate is out of range, it will be clamped to a valid value. Function will return the new (capped) value. The plugin will take care of loading and saving the speech rate.

Returns
new speech rate
static void UAP_AccessibilityManager.SetTwoFingerSwipeDownHandler ( OnTapEvent  func)
static

Overrides the regular two finger swipe down function, which is Read-From-Current-Element. Use this to handle the gesture yourself. This will stop the Read-From-Current-Element feature from working until ::ResetTwoFingerSwipeDownHandler is called.

This can be very useful during gameplay, if the gesture is used to read out stats or help instead.

Parameters
funcMember function to call when the gesture is detected.
static void UAP_AccessibilityManager.SetTwoFingerSwipeUpHandler ( OnTapEvent  func)
static

Overrides the regular two finger swipe up function, which is Read-From-Top. Use this to handle the gesture yourself. This will stop the Read-From-Top feature from working until ::ResetTwoFingerSwipeUpHandler is called.

This can be very useful during gameplay, if the gesture is used to read out stats or help instead.

Parameters
funcMember function to call when the gesture is detected.
static bool UAP_AccessibilityManager.ShouldUseBuiltInKeyboard ( )
static

Internal use for text edit boxes Returns whether the system native keyboard or the plugin's own virtual on-screen keyboard should be used

static void UAP_AccessibilityManager.UnregisterAccessibilityModeChangeCallback ( OnAccessibilityModeChanged  func)
static

Stop receiving notifications when the accessibility mode state changes.

Parameters
functhe callback function that should no longer receive calls
static void UAP_AccessibilityManager.UnregisterOnBackCallback ( OnTapEvent  func)
static

Unregister from notifications when the user made the gesture for Back. See the documentation on Magic Gestures.

static void UAP_AccessibilityManager.UnregisterOnPauseToggledCallback ( OnPauseToggleCallbackFunc  func)
static

Unregister from notifications when the user made the Pause gesture / Magic Tap. See the documentation on Magic Gestures.

Parameters
funcMember function that was registered.
static void UAP_AccessibilityManager.UnregisterOnThreeFingerDoubleTapCallback ( OnTapEvent  func)
static

Unregister from callback for three finger double taps.

Parameters
funcMember function that was registered.
static void UAP_AccessibilityManager.UnregisterOnThreeFingerSingleTapCallback ( OnTapEvent  func)
static

Unregister from callback for three finger single taps.

Parameters
funcMember function that was registered.
static void UAP_AccessibilityManager.UnregisterOnTwoFingerSingleTapCallback ( OnTapEvent  func)
static

Unregister from callback for two finger single taps.

Parameters
funcMember function that was registered.

Member Data Documentation

bool UAP_AccessibilityManager.m_AllowBuiltInVirtualKeyboard = true

If true, the plugin will use it's own built-in virtual keyboard instead of the native on screen keyboard when handling text input for edit fields. If disabled, players will have to re-enable TalkBack when editing any text fields. On iOS, newer versions Unity often grabs the focus away from the keyboard and cause the text input to stop completely. The built-in keyboard solves both issues. This feature is only used on mobile.

bool UAP_AccessibilityManager.m_CyclicMenus = false

When reaching the last element on the screen, the focus will jump back around to the first element if this is set to true. By default, this is false, which triggers a sound effect when the border of the screen is reached.

bool UAP_AccessibilityManager.m_DefaultState = false

The state for accessibility on the very first launch of your app. Leave this at false unless this is an app purely for the sight impaired.

bool UAP_AccessibilityManager.m_EditorOverride = false

Quick way to enable/disable the plugin during development in Editor only. This variable will be ignored in any standalone builds.

string UAP_AccessibilityManager.m_GoogleTTSAPIKey = ""

Google Cloud Text-To-Speech API key. Please see documentation for step-by-step instructions on how to get this value

bool UAP_AccessibilityManager.m_ReadDisabledInteractables = true

Reads out disabled but visible interactive UI elements. This means buttons, toggles and sliders will be read out, even when they are disabled (but they must be visible). The plugin will read out "Disabled" after the name. Default is true, as this emulates the behavior from iOS VoiceOver.


The documentation for this class was generated from the following file: