Commit Graph

198 Commits

Author SHA1 Message Date
54c01c5381 Allow a global override to determine if the next focus event should interrupt speech.
There seem to be a small handful of cases where we want this--controls that gain focus immediately after a dialog appears, for instance. We allow these edge cases to indicate that the next focus shouldn't stop speech, then clear it on cases where speech isn't stopped. This is a bit hacky, but seems cleaner than anything else I came up with.
2020-08-10 13:26:57 -05:00
c218d18090 Revert "Focus and dialog presentation tweaks."
This causes scrolling through trees, lists, and just about everything else where focus doesn't change to a new widget to fail. Clearly another solution is needed.

This reverts commit c459a35f0d.
2020-08-10 12:39:53 -05:00
c459a35f0d Focus and dialog presentation tweaks.
* Remove indiscriminant speech stop on focus events.
* Only stop speech on input events that are keypresses.
* Don't interrupt speech when a dialog is presented.

Now dialogs present in their entirety without having their labels explicitly focused. This allows for Godot's default behavior, where the _OK_ button is automatically focused when the dialog appears, to speak the dialog text and the button as a screen reader user would expect.
2020-08-10 12:12:12 -05:00
6beeaa01bd Redirect "ui_accept" input for specific Tree edge cases.
Trees appear to eat "ui_accept" before `gui_input` receives it. This makes certain use cases--triggering buttons in cells--impossible via the keyboard.

Here, `ScreenReader` attempts to intercept recent presses of "ui_accept" and, if a button in a cell should receive focus, redirects the `InputEvent` to the custom handler for `Tree`.

Unfortunately, this loses the ability to click buttons in cells in the editor's node tree for some reason. It restores, or maybe gets working in the first place, clicking on the _Remove_ button in the input mapping screen. Not sure how to restore the former functionality--these trees are complex and not well-documented.
2020-07-22 12:13:19 -05:00
d522da8fc0 Remove unnecessary signal connected to nonexistent method. 2020-07-16 09:55:06 -05:00
ccc79c93f6 Begin moving more functionality from ScreenReader/Accessible into the editor plugin. 2020-06-16 18:03:13 -05:00
76d1926385 Remove unnecessary code to set an initial scene focus. 2020-06-16 17:55:52 -05:00
8f110a27d3 Label improvements, plus trimming.
* Labels themselves don't have labels, so `guess_label()` on a `Label` returns null.
* Remove unused `is_in_bar()` function.
* Prepend `_` to more private function names.
2020-06-16 11:54:49 -05:00
3cbcfa8f40
Merge pull request #1 from follower/patch-1
Fix-ups of Markdown list formatting. Add syntax highlighting. Typo fix.
2020-06-16 09:14:29 -05:00
follower
5aaa252f60
Enable syntax highlighting of .ini file snippets
Figured I might as well while I'm here. :)

Do screen readers make use of syntax highlighting in a context like this?
2020-06-16 22:16:13 +12:00
follower
ab87ab6ef4
Fix-up of Markdown formatting for item 4
Add required indent spaces to content of item 4 in order to get all the item's content to be aligned correctly.
2020-06-16 22:11:50 +12:00
follower
b70de2d97f
Fix-up of Markdown formatting for items 1-3
Add necessary blank lines between items (even though they still displayed correctly).

Add additional indent spaces to ensure that "fenced" code blocks (both the back-tick open/close markers & the actual content ) are indented correctly in order to appear aligned with the rest of the item.
2020-06-16 22:07:56 +12:00
follower
7f47af8177
Fix-up of Markdown formatting
This change ensures that the items numbered 5, 6 & 7 appear as individual paragraphs with a list number instead of being run together in a single paragraph. The change inserts an extra blank line between list items which ensures their correct formatting.

However, the last sentence of item 4 is now indented incorrectly (it currently has no indent) but it was getting too complicated to figure out how to get all the content of item 4 indented correctly while also fixing the remaining items so decided to split the tasks.
2020-06-16 22:00:49 +12:00
follower
a6afc88209
Typo fix: "ar" -> "are" 2020-06-16 21:50:43 +12:00
a8f7adaeee Add support for CheckButton, improve CheckBox support, and other minor tweaks. 2020-06-15 15:58:45 -05:00
d2f2145f17 Remove spammy print. 2020-06-11 13:24:56 -05:00
a24255e3c4 Move focus loss prevention code from ScreenReader to Plugin.
That behavior is only specific to the editor. Any game UI that loses focus should be fixed by intelligently setting focus, not by magic in the accessibility addon.
2020-06-10 11:45:32 -05:00
ce4b9c94f2 Fix null comparison. 2020-06-09 14:30:08 -05:00
ce8d429336 Fix regression where actions not being faked via keyboard didn't work. 2020-06-09 13:45:00 -05:00
10a080ab99 Speak expanded/collapsed state of TreeItem immediately after its name. 2020-06-09 13:27:53 -05:00
8ee1c05512 Add basic touchscreen support for sliders. 2020-06-09 13:23:58 -05:00
5852285dd4 Ensure screen reader always runs, even when game is paused. 2020-06-08 10:45:38 -05:00
548199d647 Significant improvements to tree-handling.
* Don't manipulate selection in any way. Leave that to Godot, and I'll fix issues in the engine if needed.
* Unify speech rendering of tree rows. This results in more useful announcements of buttons and such when tree items receive focus.
* Only handle `ui_up` and `ui_down` to ensure that focus won't leave a tree when the top-most or bottom-most row is arrowed past.
* Add a bit of handling to strip out duplicate collapse/focus events generated by the remote `SceneTree` in an active game.
2020-06-06 12:05:59 -05:00
123e475fed Update section in README about focus loss. 2020-06-05 15:16:30 -05:00
3a160df5fd Remove code that no longer seems necessary for restoring focus in the editor when lost. 2020-06-05 15:14:04 -05:00
d7b4744c6a Switch focus mode toggle to shift+escape to avoid conflict with Windows. 2020-05-29 11:07:56 -05:00
229353b37f Try to support disabling the screen reader by deleting all Accessibles. 2020-05-28 13:21:31 -05:00
2da7fcff9d Correctly handle case where EditorInspectorSection child isn't expandable. 2020-05-28 13:13:39 -05:00
dd9877557e Enable focus mode use by default in the editor. 2020-05-28 13:13:06 -05:00
95bbbff780 Unify event generation to support both simple and keyfake strategies, using the latter on Android where necessary. 2020-05-28 13:00:42 -05:00
4281e3777d Standardize focus mode on _press_and_release until input event generation is cleaned up. 2020-05-28 11:25:21 -05:00
d7040c25bf Add focus/UI modes and clean up event generation.
UI controls occasionally trap focus and make navigation impossible. Now, Ctrl+escape toggles a mode that attempts to intercept and generate UI focus events and bypass the control's own handling. This can probably be refined, but for now it allows escaping of `TextEdit` via tab. It also won't work everywhere--inn particular, arrowing around still traps focus in trees. But it is at least possible to tab out of most traps.

Further, event generation was cleaned up some. We specifically need to generate `KeyEvents` under Android because, IIRC, it wasn't enough to simply create and send some types of events. We now have two distinct generation strategies. These can probably be combined and streamlined, but for now this works.
2020-05-28 10:58:36 -05:00
9e2e99349c Reformat. 2020-05-19 12:03:59 -05:00
6279f1a3c9 Replace a couple print calls with print_debug. 2020-05-17 18:18:18 -05:00
d2e6b34c42 Add Windows-only steps for using screen reader-based Tolk in the editor. 2020-05-14 11:30:47 -05:00
08ad3db74c s/gitlab/github/g 2020-05-05 08:01:12 -05:00
2463eced93 Fix fail-fast condition that prevented single character text fields from speaking. 2020-04-15 12:32:22 -05:00
b55bdb1547 Put 'dialog:' before message. 2020-03-30 15:15:46 -05:00
fb56a4e37d Begin adding support to enable/disable screen reader. 2020-03-30 15:15:00 -05:00
fa9e10b1ea Change Accessible initialization strategy.
`Accessible` is now a child of its `Control`. This helps to ensure that everything gets cleaned up as it should. Further, node additions no longer scrape the entire scene.

This may introduce regressions and has only been lightly tested, but without it, `ScreenReader` leaked in various circumstances, including some that caused segfaults on exit.
2020-03-18 08:56:45 -05:00
f47450d05d Add support for focusing RichTextLabels. 2020-01-30 13:23:52 -06:00
ae4c4c2aa0 More README updates. 2020-01-29 13:31:22 -06:00
aed41874cd Update to specify 3.2 as the minimum supported version. 2020-01-29 13:24:21 -06:00
d180158749 Remove automatic capture of arrow keys by nodes.
On one hand, it's a bit confusing that UIs can be arrowed around independently of tab/shift-tab. Arrow navigation doesn't feel as intuitive, as it isn't obvious where you'll land.

On the other, it's quicker to navigate between areas of the editor UI by arrowing up/down between controls, and may solve the issue of having to tab a million times to traverse all controls. This also allows for in-game UIs to be traversed using arrows and, quite probably, gamepads as well.
2020-01-25 11:44:20 -06:00
1bef677066 Present button disabled state. 2020-01-21 15:28:23 -06:00
4e1d152657 Note that only 64-bit builds of Godot are supported for now. 2020-01-18 11:00:49 -06:00
ecd3ff6143 Update README. 2020-01-15 09:40:45 -06:00
8ffcaf970e Generate correct ui_focus_next and ui_focus_prev events. 2020-01-14 16:41:35 -06:00
22bb195db0 Don't double-present popup menu item text in cases where the item and shortcut resource name are identical. 2020-01-13 18:06:26 -06:00
fc5b591fe3 Better dialog presentation, and make message labels non-focusable. 2020-01-13 17:59:48 -06:00