Section Accessibility

Accessibility functions, mostly audio messages.

Summary

Return typeFunction and summary
booleanIsScreenReaderActive()
Is there a screen reader, a voice that assist visually impaired user?
booleanIsThemeSoundsActive()
Are interface sounds active in scripts using SMDialog and SMMenu?
 MuteScreenReader(int delay)
Temporarily mute the Screen Reader for a short delay.
 SMAlert(string msg)
Add accessibility to built-in Alert() function.
booleanSMConfirmation(string msg)
Add accessibility to built-in Confirmation() function.
 SMMessage(string msg, boolean skipVisual)
Add accessibility to built-in Message() function.
 ScreenReader(string text, boolean wait)
Say the text if text to speech is enable for visually impaired people (screen reader).
 UnMuteScreenReader()
After MuteScreenReader(...) and the massive actions that would have produced unaudible audio messages, unmute the Screen Reader.

Functions

IsThemeSoundsActive()

Are interface sounds active in scripts using SMDialog and SMMenu?

To set up screen reader, go to Scripts > Miscellaneous > Swiss knife menu, then Settings > Interface sounds.

Return
boolean: true if active, nil or false if not set up.

IsScreenReaderActive()

Is there a screen reader, a voice that assist visually impaired user?

The screen reader is set up by the script in Miscellaneous > Screen Reader setup. A call to ScreenReader("words to say") wil lsay nothing if not set up, or will say the words if a human voice is choosen.
If the words need time or resource to be build, you can optimize your code by calling IsScreenReaderActive() before this task.

To set up screen reader, go to Scripts > Miscellaneous > Swiss knife menu, then Settings > Accessibility.

Return
boolean: true if active, nil or false if not set up.
See
ScreenReader

MuteScreenReader(int delay)

Temporarily mute the Screen Reader for a short delay.

It may be useful, for optimization concerns, if next coming actions will call ScreenReader(...) multiple times in a very short delay.
If ScreenReader is not set up to active, then this has no effect.

ParameterTypeDefaultDescription
delayint1000Delay, in milliseconds.
See
UnMuteScreenReader

UnMuteScreenReader()

After MuteScreenReader(...) and the massive actions that would have produced unaudible audio messages, unmute the Screen Reader.

If ScreenReader is not set up to active, then this has no effect.

See
MuteScreenReader

ScreenReader(string text, boolean wait)

Say the text if text to speech is enable for visually impaired people (screen reader).

ParameterTypeDefaultDescription
textstring text
waitbooleanfalseWait until the text is fully said

SMAlert(string msg)

Add accessibility to built-in Alert() function.

ParameterTypeDefaultDescription
msgstring msg

SMConfirmation(string msg)

Add accessibility to built-in Confirmation() function.

ParameterTypeDefaultDescription
msgstring msg
Return
boolean: The same result than Confirmation(msg)

SMMessage(string msg, boolean skipVisual)

Add accessibility to built-in Message() function.

The Message(...) display msg and requires user to click 'Ok' button or press Enter key. If a screen reader is set (Scripts > Misc. > Swiss knife menu > Settings), msg is said by the TTS. An optional argument allow only vocal message (skip the dialog) if screen reader is active.

ParameterTypeDefaultDescription
msgstring msg
skipVisualbooleanfalseIf screen reader is active, say msg but skip the Message(...) dialog. Visually impaired user will hear the message and won't need to click the 'Ok' button.