Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Screen readers cannot update caret offset in code editor #98256

Closed
joanmarie opened this issue May 20, 2020 · 9 comments
Closed

Screen readers cannot update caret offset in code editor #98256

joanmarie opened this issue May 20, 2020 · 9 comments
Assignees
Labels
accessibility Keyboard, mouse, ARIA, vision, screen readers (non-specific) issues bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders on-release-notes Issue/pull request mentioned in release notes verified Verification succeeded
Milestone

Comments

@joanmarie
Copy link

Steps to reproduce:

  1. Create a document in the Edtior
  2. Type "hello world" and press Return, leaving the caret/cursor on line 2
  3. Launch Accerciser, locate the Editor in the accessibility tree (it has role of "entry" and name of "Untitled-1"
  4. In Accerciser's iPython console, type the following:
text = acc.queryText()
text.setCaretOffset(0)

Expected result: The caret would move to the "h" (because that's the character at offset 0)

Actual result: The caret does not move.

Impact: Orca has a SayAll command which allows the user to give a single command / keystroke which causes Orca to speak the full content starting from the present location. When the user reaches the end of the document or interrupts speech by pressing a key like Ctrl, Orca uses ATK/AT-SPI2 to set the caret offset at the last location read. Doing so means the user is where they think they are. ("Orca just read 'foo bar', so I must be on the line with 'foo bar'".) Unfortunately, because setCaretOffset() fails to work in the Editor, Orca is unable to make this update and the user remains at the point where the SayAll command was given.

@isidorn: Is this due to the fact that VSCode has a special textarea which it uses to make the Editor contents available to screen readers? If so, could you pay attention to the caret being moved in that textarea and update the real location within the Editor?

@isidorn
Copy link
Contributor

isidorn commented May 26, 2020

@joanmarie yes this seems to be due to the fact that we are using a textArea. So the gist is
Orca updates caret position in the textArea and the Editor does not reflect that.

Idealy we would listen on cursor change events in the textArea somewhere here and update the cursor location in the real editor.
Googled a bit and I could not find an event for "caret updated". Though i migtht be missing something.

fyi @alexdima

@isidorn isidorn added accessibility Keyboard, mouse, ARIA, vision, screen readers (non-specific) issues under-discussion Issue is under discussion for relevance, priority, approach labels May 26, 2020
@alexdima
Copy link
Member

alexdima commented Jun 1, 2020

@isidorn We do listen to selection changes especially for cases where it gets via Braille displays. That was confirmed to be working, although I don't own one of those devices to try it out.

Here it is --

private _installSelectionChangeListener(): IDisposable {

@isidorn It might be as easy as tweaking this if statement to allow Linux to go through. Currently, that code path is only allowed on Windows + Chrome --

if (!browser.isChrome || !platform.isWindows) {
// Support only for Chrome on Windows until testing happens on other browsers + OS configurations
return;
}

@isidorn
Copy link
Contributor

isidorn commented Jun 2, 2020

@alexdima great pointer, thanks a lot!
@joanmarie so I can produce a build with that if statment changed, or if you have time you can just change that line at textAreaInput:409 and run vscode out of source. Let me know what works for you.

@isidorn isidorn added this to the June 2020 milestone Jun 2, 2020
@joanmarie
Copy link
Author

@isidorn: Removing the check for windows solved it for me. Thanks!

I wonder if VoiceOver might also have a need to reset the caret in that textarea?

@isidorn
Copy link
Contributor

isidorn commented Jun 2, 2020

@joanmarie great, thanks for trying it out.
I would just remove the check to allow it for all platforms as long as Chrome
Though let's do it start of next week June so we catch potential issues, since we are wrapping up our release now.

@isidorn isidorn added bug Issue identified by VS Code Team member as probable bug and removed under-discussion Issue is under discussion for relevance, priority, approach labels Jun 2, 2020
@isidorn isidorn closed this as completed in 62d12e9 Jun 8, 2020
@isidorn
Copy link
Contributor

isidorn commented Jun 8, 2020

I have pushed a change that we allow selection change events to update the selection not only on Win, but on Mac and Linux as well.
Decided to push this start of milestone so we catch potential regressions
@alexdima please let me know if you would like me to test this in a perticular way. Currently I just tried it out with vscode out of source on the mac.

@joanmarie Insiders in a couple of days should have this change, then you can try it out and let us know.

@isidorn
Copy link
Contributor

isidorn commented Jun 23, 2020

@joanmarie did you get a chance to try this out with vscode insiders?
Asking so we know if this works fine so we add a verified label.

@jvesouza
Copy link

@isidorn based on the test I did it seems to be correct.

Steps used in the test:

  • Launch VSCode and orca.
  • Open a file with some content.
  • Use the orca command 'say all' to read the file.
  • While the orca is reading press the ctrl key to stop reading.
  • Use say all again.

as expected, the orca continues to read from where it was stopped.

@isidorn
Copy link
Contributor

isidorn commented Jun 23, 2020

@jvesouza thanks a lot, really appreciate it! Adding verified label.

@isidorn isidorn added the verified Verification succeeded label Jun 23, 2020
@isidorn isidorn added the on-release-notes Issue/pull request mentioned in release notes label Jul 2, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jul 23, 2020
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
accessibility Keyboard, mouse, ARIA, vision, screen readers (non-specific) issues bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders on-release-notes Issue/pull request mentioned in release notes verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants
@isidorn @jvesouza @joanmarie @alexdima and others