microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.87k stars 29.52k forks source link

"Screen Reader detected" appears without using a screen reader #27893

Closed alexdima closed 7 years ago

alexdima commented 7 years ago

Extracted from @Tyriar in https://github.com/Microsoft/vscode/issues/27698#issuecomment-305585158

I don't have a screen reader as far as I know on my Windows machine yet it's still there, removing my line/col information, bright green and in my face? As someone who has never used a screen reader on this machine I don't know how to disable the message.

alexdima commented 7 years ago

@Tyriar Do you perhaps use any software on this machine that behaves like a Screen Reader ? Do you do anything special that makes Electron enter accessibility mode or does Electron enter it on start-up? My best guess is that there must be some software on your machine that sends automation / accessibility events to VS Code, kicking Electron into entering accessibility mode.

Can you confirm that Chromium is in accessibility mode when this happens via the Help > Accessibility Options menu item. What software do you have running on this machine?

alexdima commented 7 years ago

@Tyriar are you 100% certain you didn't have NVDA running. e.g. I think this happened once to @bpasero where NVDA was running (and "hidden" in the task bar next to the clock), and without enabling sounds in a VM one would not even notice.

alexdima commented 7 years ago

This issue covers the false-positive case, while #27833 covers the false-negative case.

This is mostly based on a new setting editor.accessibilitySupport:

The scenario is:

A screen reader is NOT attached to VS Code, but Electron's API tells us that a screen reader is attached

Please check that:

Tyriar commented 7 years ago

@alexandrudima

Do you perhaps use any software on this machine that behaves like a Screen Reader ?

OneNote and maybe Dashlane would be the only things that comes to mind that may poke such APIs. This machine also has a touch screen and en, ja, zh and ko keyboard layouts active.

Do you do anything special that makes Electron enter accessibility mode or does Electron enter it on start-up?

It happens on start up.

are you 100% certain you didn't have NVDA running.

It's not in programs and features and I'm pretty sure I've never installed it


The tooltip and setting is fine for me, just hope that my case isn't too common.

alexdima commented 7 years ago

I hope so too. I have OneNote installed and I don't think that's it.

The interesting thing is that:

Bill-Stewart commented 7 years ago

I have the same problem. I do not have any screen reader software. I had to manually set editor.accessibilitySupport to off.

Tyriar commented 7 years ago

@Bill-Stewart can you think of any software you have that could be pretending to be a screen reader?

Bill-Stewart commented 7 years ago

No idea whatsoever. How does electron determine that there's a screen reader?

alexdima commented 7 years ago

@Bill-Stewart Using Screen Readers on Windows ultimately result in a window receiving a very specific type of message from the OS, similar how a window receives for example a key down, or a mouse move, or a window resize.

I don't know all the details, but I believe a COM protocol based connection is then established between the Screen Reader and the window, and through this connection accessibility information travels.

Electron, through its use of Chromium, when it sees such a specific message type, decides to enable a flag that ultimately leads to data from the renderer process being sent over to the main process for accessibility purposes. We simply react when Electron lets us know it has entered this mode.

TL;DR: there might be software on your machine that is generating events going to windows that look very similar to the events that a Screen Reader would generate. Usually, UI automation software would use the same mechanisms as a Screen Reader. I'm not sure if it's useful or not, but if we'd get to know what software tricks Electron into entering accessibility mode, perhaps we can communicate that back to the Electron folks and they maybe could work around it.

ChrisMBarr commented 7 years ago

The same thing is happening to me. The strange part is that it's intermittent. VSCode doesn't always launch with this green badge, but just sometimes.

This morning I got to my desk and opened VSCode and the badge was there: (note the time) image

I saw it and search online, and found this issue. As I was typing this I decided to close and re-launch VSCode - and now the badge is gone (note the time again)!

image

The only thing I did while it was open is install a new extension.


I have no idea what software on my machine is thought to behave like a screen reader. The only software I have that does anything with an input device is "Logitech Options" for my MX Master mouse.

anthony-gregg commented 7 years ago

I have an even better variation of this. I opened VS Code this morning and also had the "Screen Reader Detected" green badge and it also was missing the Line Number and Character location. I closed VS Code and reopened it and now look at it:

image 22

I have not seen a scenario where both have been displayed based on the above statements. I also have no idea what software I have that is acting as a Screen Reader. I do have One Note, but that cannot be the case I would believe.

Update: I just moved my cursor in VS Code and the Line Number and Character Location indicator disappeared. See below:

image 23

Now it looks the same as everyone elses.

alexdima commented 7 years ago

@chrismbarr @anthony-gregg I'm sorry about you running into these false positive cases. Please change the setting editor.accessibilitySupport from "auto" to "off". We need to continue to ship with "auto" for the users that are forced to use a Screen Reader.

When the setting is "auto", we react to Electron telling us a Screen Reader is attached and then we proceed to do some tweaks: e.g. disable word wrapping, as wrapping points cannot be communicated correctly to Screen Readers (w3c spec limitation) and visually impaired users would hear "New Line" at the location of a wrapping point, which is incorrect. Another example is our removal of the Ln/Col indicator which would produce accessibility events that would throw off / confuse / spam NVDA.

In any case, it is probably a good idea to find out what software on your machine causes this, as, e.g. from my experience, when Electron/Chromium enters accessibility mode, VS Code will run a lot slower for you. e.g. https://github.com/electron/electron/issues/7208 . It is also possible that Chrome on your machine will be running a lot slower than for other users. In Chrome, you can visit chrome://accessibility/ to find out if Chrome has entered this mode on your machine.

anthony-gregg commented 7 years ago

Alexandru,

Thank you for your response and help. I have previously turned off my accessibility features in VS Code and my problem went away. I have also looked at my Chrome accessibility and found that it was not activated:

[cid:image003.jpg@01D31049.DD3DD3B0]

I am not sure what else could be causing the false reading.

Thanks

Anthony

Anthony Gregg | Technical Lead | Retail Development | Application Development & Maintenance | Best Buy | A5-071 | Ph.: (612) 291-2350 | Cell: (612) 231-0011 [cid:image001.jpg@01CCB595.50739B50] http://www.bestbuy.com/

TFS Requests: Service Now https://bestbuy.service-now.com/ – Self Service -> Request Catalog -> IT Infrastructure -> TFS Support Requests

From: Alexandru Dima [mailto:notifications@github.com] Sent: Tuesday, August 8, 2017 9:27 AM To: Microsoft/vscode vscode@noreply.github.com Cc: Gregg, Anthony Anthony.Gregg@bestbuy.com; Mention mention@noreply.github.com Subject: Re: [Microsoft/vscode] "Screen Reader detected" appears without using a screen reader (#27893)

@chrismbarrhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fchrismbarr&data=02%7C01%7Canthony.gregg%40bestbuy.com%7Ca72369620bdf40865f9c08d4de698d10%7C135e89957d3b4466844ba0d62ba5f495%7C0%7C0%7C636377992298402019&sdata=%2FVrbvg7txmCCs3t5jGQXV12DJOAONWgs9IRi698%2BSTE%3D&reserved=0 @anthony-gregghttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fanthony-gregg&data=02%7C01%7Canthony.gregg%40bestbuy.com%7Ca72369620bdf40865f9c08d4de698d10%7C135e89957d3b4466844ba0d62ba5f495%7C0%7C0%7C636377992298402019&sdata=oQBsNkQYs3eT7T2JgXZhQY8LCJsmk3ckWju4rwnluUQ%3D&reserved=0 I'm sorry about you running into these false positive cases. Please change the setting editor.accessibilitySupport from "auto" to "off". We need to continue to ship with "auto" for the users that are forced to use a Screen Reader.

When the setting is "auto", we react to Electron telling us a Screen Reader is attached and then we proceed to do some tweaks: e.g. disable word wrapping, as wrapping points cannot be communicated correctly to Screen Readers (w3c spec limitation) and visually impaired users would hear "New Line" at the location of a wrapping point, which is incorrect. Another example is our removal of the Ln/Col indicator which would produce accessibility events that would throw off / confuse / spam NVDA.

In any case, it is probably a good idea to find out what software on your machine causes this, as, e.g. from my experience, when Electron/Chromium enters accessibility mode, VS Code will run a lot slower for you. e.g. electron/electron#7208https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Felectron%2Felectron%2Fissues%2F7208&data=02%7C01%7Canthony.gregg%40bestbuy.com%7Ca72369620bdf40865f9c08d4de698d10%7C135e89957d3b4466844ba0d62ba5f495%7C0%7C0%7C636377992298402019&sdata=iXOi2HHZ%2BKYQ2SkTLm%2FaGsH%2B0GLmJgCrxM4TiCVqJfw%3D&reserved=0 . It is also possible that Chrome on your machine will be running a lot slower than for other users. In Chrome, you can visit chrome://accessibility/ to find out if Chrome has entered this mode on your machine.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2Fvscode%2Fissues%2F27893%23issuecomment-320972506&data=02%7C01%7Canthony.gregg%40bestbuy.com%7Ca72369620bdf40865f9c08d4de698d10%7C135e89957d3b4466844ba0d62ba5f495%7C0%7C0%7C636377992298402019&sdata=3g5E3aFc9yvn86dNaNeb8c%2Bjb6GdZVxPh5n5dULu5%2BQ%3D&reserved=0, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAWTaEkg5Y4b5BwnWd8gtAodYaZN4tQwHks5sWHA7gaJpZM4Nt2jF&data=02%7C01%7Canthony.gregg%40bestbuy.com%7Ca72369620bdf40865f9c08d4de698d10%7C135e89957d3b4466844ba0d62ba5f495%7C0%7C0%7C636377992298402019&sdata=EEFuo%2BXkC2SKnVDfgkR0%2FEYFc8%2Fg2v7kJUj%2FRtw79GQ%3D&reserved=0.

ChrisMBarr commented 7 years ago

So here's something else. I was working on one project this morning and no screen reader badge appeared. Without closing that project, I opened up another one and that one does have the screen reader banner at the same time!

image

So, I now have an instance of VSCode in each mode. Neat!

anthony-gregg commented 7 years ago

Very unique and I assume that you have Accessibility enabled, correct?

Anthony Gregg | Technical Lead | Retail Development | Application Development & Maintenance | Best Buy | A5-071 | Ph.: (612) 291-2350 | Cell: (612) 231-0011 [cid:image001.jpg@01CCB595.50739B50] http://www.bestbuy.com/

TFS Requests: Service Now https://bestbuy.service-now.com/ – Self Service -> Request Catalog -> IT Infrastructure -> TFS Support Requests

From: Chris Barr [mailto:notifications@github.com] Sent: Thursday, August 10, 2017 8:09 AM To: Microsoft/vscode vscode@noreply.github.com Cc: Gregg, Anthony Anthony.Gregg@bestbuy.com; Mention mention@noreply.github.com Subject: Re: [Microsoft/vscode] "Screen Reader detected" appears without using a screen reader (#27893)

So here's something else. I was working on one project this morning and no screen reader badge appeared. Without closing that project, I opened up another one and that one does have the screen reader banner at the same time!

[image]https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F463685%2F29171700-5eea0414-7dab-11e7-85c9-050f64e146cb.png&data=02%7C01%7Canthony.gregg%40bestbuy.com%7Cd1fb45ed608147f21a5c08d4dff0e8f8%7C135e89957d3b4466844ba0d62ba5f495%7C0%7C0%7C636379673172985623&sdata=bEAsp1aLY%2FOhwR%2FCgX3OSRb5q1oTz43CaP5aacasWw0%3D&reserved=0

So, I now have an instance of VSCode in each mode. Neat!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2Fvscode%2Fissues%2F27893%23issuecomment-321545620&data=02%7C01%7Canthony.gregg%40bestbuy.com%7Cd1fb45ed608147f21a5c08d4dff0e8f8%7C135e89957d3b4466844ba0d62ba5f495%7C0%7C0%7C636379673172985623&sdata=T6winybWCds9CHKeo9r28gQ1szkOC2lvOI%2FY9gmmkv0%3D&reserved=0, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAWTaEo9xjNZT3z-K4Cutq0IUDQwN2kZaks5sWwDRgaJpZM4Nt2jF&data=02%7C01%7Canthony.gregg%40bestbuy.com%7Cd1fb45ed608147f21a5c08d4dff0e8f8%7C135e89957d3b4466844ba0d62ba5f495%7C0%7C0%7C636379673172985623&sdata=i8Ekxq639Z7%2FTrL2YnRl2SHSSBXNAeYMnYHnjvvPZVc%3D&reserved=0.

ChrisMBarr commented 7 years ago

@anthony-gregg I haven't changed the defaults, so yes I suppose so.

I think I'm going to turn this off now since it's not something I need.