Section Accessibility
Accessibility functions, mostly audio messages.
Summary
| Return type | Function and summary |
|---|---|
| boolean | IsScreenReaderActive() Is there a screen reader, a voice that assist visually impaired user? |
| boolean | IsThemeSoundsActive() 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. | |
| boolean | SMConfirmation(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:
trueif active,nilorfalseif 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:
trueif active,nilorfalseif 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.
| Parameter | Type | Default | Description |
|---|---|---|---|
| delay | int | 1000 | Delay, in milliseconds. |
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.
ScreenReader(string text, boolean wait)
Say the text if text to speech is enable for visually impaired people (screen reader).
| Parameter | Type | Default | Description |
|---|---|---|---|
| text | string | text | |
| wait | boolean | false | Wait until the text is fully said |
SMAlert(string msg)
Add accessibility to built-in Alert() function.
| Parameter | Type | Default | Description |
|---|---|---|---|
| msg | string | msg |
SMConfirmation(string msg)
Add accessibility to built-in Confirmation() function.
| Parameter | Type | Default | Description |
|---|---|---|---|
| msg | string | 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.
| Parameter | Type | Default | Description |
|---|---|---|---|
| msg | string | msg | |
| skipVisual | boolean | false | If 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. |