Skip to content

Commit d6b1325

Browse files
committed
Add separate editor accessibility mode setting.
1 parent 42c7f14 commit d6b1325

File tree

4 files changed

+31
-7
lines changed

4 files changed

+31
-7
lines changed

doc/classes/EditorSettings.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,13 @@
812812
Input accumulation can be disabled to get slightly more precise/reactive input at the cost of increased CPU usage.
813813
[b]Note:[/b] Input accumulation is [i]enabled[/i] by default.
814814
</member>
815+
<member name="interface/accessibility/accessibility_support" type="int" setter="" getter="">
816+
Editor accessibility support mode:
817+
- [b]Auto[/b] ([code]0[/code]): Accessibility support is enabled, but updates to the accessibility information are processed only if an assistive app (such as a screen reader or a Braille display) is active (default).
818+
- [b]Always Active[/b] ([code]1[/code]): Accessibility support is enabled, and updates to the accessibility information are always processed, regardless of the status of assistive apps.
819+
- [b]Disabled[/b] ([code]2[/code]): Accessibility support is fully disabled.
820+
[b]Note:[/b] Accessibility debugging tools, such as Accessibility Insights for Windows, Accessibility Inspector (macOS), or AT-SPI Browser (Linux/BSD) do not count as assistive apps. To test your project with these tools, use [b]Always Active[/b].
821+
</member>
815822
<member name="interface/editor/accept_dialog_cancel_ok_buttons" type="int" setter="" getter="">
816823
How to position the Cancel and OK buttons in the editor's [AcceptDialog]s. Different platforms have different standard behaviors for this, which can be overridden using this setting. This is useful if you use Godot both on Windows and macOS/Linux and your Godot muscle memory is stronger than your OS specific one.
817824
- [b]Auto[/b] follows the platform convention: OK first on Windows, KDE, and LXQt, Cancel first on macOS and other Linux desktop environments.

doc/classes/ProjectSettings.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,10 @@
261261
<members>
262262
<member name="accessibility/general/accessibility_support" type="int" setter="" getter="" default="0">
263263
Accessibility support mode:
264-
- [b]Auto[/b] ([code]0[/code]): accessibility support is enabled, but accessibility information updates are processed only if an assistive app (e.g. screen reader or Braille display) is active (default).
265-
- [b]Always Active[/b] ([code]1[/code]): accessibility support is enabled, and accessibility information updates are processed regardless of current assistive apps' status.
266-
- [b]Disabled[/b] ([code]2[/code]): accessibility support is fully disabled.
267-
[b]Note:[/b] Accessibility debugging tools, such as Accessibility Insights for Windows, macOS Accessibility Inspector, or AT-SPI Browser do not count as assistive apps. To test your app with these tools, use [code]1[/code].
264+
- [b]Auto[/b] ([code]0[/code]): Accessibility support is enabled, but updates to the accessibility information are processed only if an assistive app (such as a screen reader or a Braille display) is active (default).
265+
- [b]Always Active[/b] ([code]1[/code]): Accessibility support is enabled, and updates to the accessibility information are always processed, regardless of the status of assistive apps.
266+
- [b]Disabled[/b] ([code]2[/code]): Accessibility support is fully disabled.
267+
[b]Note:[/b] Accessibility debugging tools, such as Accessibility Insights for Windows, Accessibility Inspector (macOS), or AT-SPI Browser (Linux/BSD) do not count as assistive apps. To test your project with these tools, use [b]Always Active[/b].
268268
</member>
269269
<member name="accessibility/general/updates_per_second" type="int" setter="" getter="" default="60">
270270
The number of accessibility information updates per second.

editor/editor_settings.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,9 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
568568
open_in_new_inspector_defaults.push_back("MeshLibrary");
569569
_initial_set("interface/inspector/resources_to_open_in_new_inspector", open_in_new_inspector_defaults);
570570

571+
EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "interface/accessibility/accessibility_support", 0, "Auto (When Screen Reader is Running),Always Active,Disabled")
572+
set_restart_if_changed("interface/accessibility/accessibility_support", true);
573+
571574
EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "interface/inspector/default_color_picker_mode", (int32_t)ColorPicker::MODE_RGB, "RGB,HSV,RAW,OKHSL")
572575
EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "interface/inspector/default_color_picker_shape", (int32_t)ColorPicker::SHAPE_OKHSL_CIRCLE, "HSV Rectangle,HSV Rectangle Wheel,VHS Circle,OKHSL Circle")
573576
EDITOR_SETTING_BASIC(Variant::BOOL, PROPERTY_HINT_NONE, "interface/inspector/color_picker_show_intensity", true, "");

main/main.cpp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2908,6 +2908,7 @@ Error Main::setup2(bool p_show_boot_logo) {
29082908
print_header(false);
29092909

29102910
#ifdef TOOLS_ENABLED
2911+
int accessibility_mode_editor = 0;
29112912
int tablet_driver_editor = -1;
29122913
if (editor || project_manager || cmdline_tool) {
29132914
OS::get_singleton()->benchmark_begin_measure("Startup", "Initialize Early Settings");
@@ -2945,6 +2946,8 @@ Error Main::setup2(bool p_show_boot_logo) {
29452946

29462947
bool tablet_found = false;
29472948

2949+
bool ac_found = false;
2950+
29482951
if (editor) {
29492952
screen_property = "interface/editor/editor_screen";
29502953
} else if (project_manager) {
@@ -2959,7 +2962,7 @@ Error Main::setup2(bool p_show_boot_logo) {
29592962
prefer_wayland_found = true;
29602963
}
29612964

2962-
while (!screen_found || !prefer_wayland_found || !tablet_found) {
2965+
while (!screen_found || !prefer_wayland_found || !tablet_found || !ac_found) {
29632966
assign = Variant();
29642967
next_tag.fields.clear();
29652968
next_tag.name = String();
@@ -2978,7 +2981,10 @@ Error Main::setup2(bool p_show_boot_logo) {
29782981
restore_editor_window_layout = value.operator int() == EditorSettings::InitialScreen::INITIAL_SCREEN_AUTO;
29792982
}
29802983
}
2981-
if (assign == "interface/editor/expand_to_title") {
2984+
if (assign == "interface/accessibility/accessibility_support") {
2985+
accessibility_mode_editor = value;
2986+
ac_found = true;
2987+
} else if (assign == "interface/editor/expand_to_title") {
29822988
init_expand_to_title = value;
29832989
} else if (assign == "interface/editor/display_scale") {
29842990
init_display_scale = value;
@@ -3153,7 +3159,15 @@ Error Main::setup2(bool p_show_boot_logo) {
31533159
#endif
31543160

31553161
if (!accessibility_mode_set) {
3156-
accessibility_mode = (DisplayServer::AccessibilityMode)GLOBAL_GET("accessibility/general/accessibility_support").operator int64_t();
3162+
#ifdef TOOLS_ENABLED
3163+
if (editor || project_manager || cmdline_tool) {
3164+
accessibility_mode = (DisplayServer::AccessibilityMode)accessibility_mode_editor;
3165+
} else {
3166+
#else
3167+
{
3168+
#endif
3169+
accessibility_mode = (DisplayServer::AccessibilityMode)GLOBAL_GET("accessibility/general/accessibility_support").operator int64_t();
3170+
}
31573171
}
31583172
DisplayServer::accessibility_set_mode(accessibility_mode);
31593173

0 commit comments

Comments
 (0)