You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Experimental plugin, feel free to contribute or report any issues to improve compatibility with more web browsers and screen readers.
3
+
3
4
# Godot-ARIA
4
5
A plugin for creating accessible rich internet applications with godot.
5
6
6
-
Screen Reader | Browsers | Compatibility
7
-
| --- | --- | --- |
8
-
| NVDA | Firefox, Chrome, Edge | Yes
7
+
For more information about screen readers and browsers compatibility please see: [current live region behaviour](https://tetralogical.com/blog/2024/05/01/why-are-my-live-regions-not-working/#current-live-region-behaviour).
9
8
10
9
11
-
For information about other screen readers or browsers, please see: [current live region behaviour](https://tetralogical.com/blog/2024/05/01/why-are-my-live-regions-not-working/#current-live-region-behaviour).
10
+
### Features
11
+
- Accessible html page template.
12
+
- Notifiy changes or important alerts to screen readers.
13
+
- Restore or gain focus with tab / shift + tab navigation.
14
+
- Focus can leave the canvas element to navigate other content on the web page.
15
+
- Accessibility module for Node2D.
12
16
13
17
## Installation
14
18
Just add the addons folder to your project and enable the plugin.
15
19
16
20
See: [Installing a plugin](https://docs.godotengine.org/en/stable/tutorials/plugins/editor/installing_plugins.html#installing-a-plugin)
17
21
18
-
## Custom html page
22
+
## Export configuration
19
23
> [!warning]
20
24
> The default godot web export HTML page has accessibility [issues](https://github.com/btzr-io/godot-aria/issues/4) and is not compatible with this pluign.
21
25
22
-
This repository provides a more accessible version that can serve as a starting point: [godot_aria_shell.html](https://github.com/btzr-io/godot-aria/blob/main/addons/godot-aria/godot_aria_shell.html)
26
+
Before you can use this addon you need to make some quick changes to the export settings:
27
+
28
+
- This repository provides a more accessible HTML page that can serve as a starting point: [godot_aria_shell.html](https://github.com/btzr-io/godot-aria/blob/main/addons/godot-aria/godot_aria_shell.html)
23
29
30
+
- Auto focus behavior is not recommended, the user should decide when to enter focus ( click or tab navigation ).
See: [Custom HTML page for Web export](https://docs.godotengine.org/en/stable/tutorials/platform/web/customizing_html5_shell.html#custom-html-page-for-web-export)
29
38
30
39
## Usage
31
-
Global class `GodotARIA` provides a way to send messages and alerts to screen readers as [aria-live](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-live) updates.
40
+
Global class `GodotARIA` provides methods to manage focus for the html canvas element and a way to send notifications or alerts to screen readers as [aria-live](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-live) updates.
41
+
### GodotARIA.focus_canvas
42
+
Focus the current canvas element.
43
+
```py
44
+
GodotARIA.focus_canvas()
45
+
```
46
+
47
+
### GodotARIA.unfocus_canvas
48
+
Remove focus of the current canvas element.
49
+
```py
50
+
GodotARIA.unfocus_canvas()
51
+
```
32
52
33
53
### GodotARIA.notify_screen_reader
34
54
Awaits for a natural pause before speaking up. It won’t interrupt what the screen reader is currently announcing. Equivalent to aria-live [polite](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-live#polite).
@@ -41,3 +61,36 @@ Speak an alert, interrupts whatever the screen reader is currently announcing. E
41
61
```py
42
62
GodotARIA.alert_screen_reader(message: String)
43
63
```
64
+
65
+
## Accessibiltiy module for Node2D
66
+
To make any Node2D accessible you can add the custom node AccessibleModule as a direct child, this will create an overlay control to handle the focus behavior.
67
+
68
+
### Features
69
+
- Add focus behavior.
70
+
- Custom focus style.
71
+
- Tab navigation between other focusable elements.
72
+
- Notify name or description to screen readers on focus.
73
+
74
+
### Properties
75
+
#### aria_label : String
76
+
Name or description to be anounced by screen readers.
77
+
78
+
#### focus_mode : Control.FocusMode
79
+
Focus mode of the overlay control: None, Click, All.
80
+
81
+
#### focus_size : Vector2
82
+
The focusable area size, calculated by default if the node has a visible texture or rect.
83
+
84
+
#### focus_style : StyleBox
85
+
Add a custom style if needed, otherwise you can use has_focus() and apply a custom focus indicator on the node.
86
+
87
+
#### focus_control : FocusControl
88
+
Reference of the overlay control that manages the focus behavior, use this property to interact directly with the overlay control.
0 commit comments