joejohnmurphy / switchcalc

switch access calculator for the web
2 stars 1 forks source link

Chromevox will not re-read the button text when Enter is pressed on Chromebook #4

Closed joejohnmurphy closed 5 years ago

joejohnmurphy commented 5 years ago

The method to return focus to the button so the screen reader will re-read it worked on other OSs but not on Chromebook. The fix in place now is to trigger an audio file with text-to-speech of the button label.

Drizej commented 5 years ago

Do you remember what method you tried before to re-read the focused element?

joejohnmurphy commented 5 years ago

Here is what Patrick originally proposed for this, which worked beautifully on my PC and Mac, but not on the Chromebook for some reason:

                // hack to get the screen reader to re-read
                // the number you are on for repeats
                $(evt.target).blur().focus();

From this longer chunk:

    // on the "body", listen for keyboard events 
    $('body').on('keydown', function(evt) {
        if (!fired) {
            // Enter key is 13, so if enter is hit and you 
            // are on a button, find whatever has focus and pass that 
            // text (lower case) to the process function
            if (evt.keyCode == 13) {
                // once a key goes down, mark it as fired and don't
                // accept any more events until the key goes up
                fired = true;

                // hack to get the screen reader to re-read
                // the number you are on for repeats
                $(evt.target).blur().focus();

                // call the function
                process($('.btn:focus').text().toLowerCase());
            }
Drizej commented 5 years ago

Hi Joe, I've pushed a possible fix for the enter re-focus on talker.js in the develop and dev-enter branches. I am blurring on keydown and focusing on keyup. If this works, I can put the same code on calc.js. If it takes time to set up the test, I can push some other possible fixes so you can test them all at once :-) -Andrzej

joejohnmurphy commented 5 years ago

Thank you, Andrzej! I will be testing today and will let you know how things go.

joejohnmurphy commented 5 years ago

When testing on PC, I press Enter on a button and the text is re-read. However, when on Chromebook, the text is not re-read. This seems to be the same issue as with the original focus/blur solution. I think there might be another related issue: if the button is re-read, then the mp3 file is not played. I'm wondering if the issue with the Chromebook may not be worth fixing, given that we want a different sound to play when Enter is hit. For example, on "About Me" when the My name button is Tabbed to, the screen reader reads the label, but when Enter is hit, we want it to say My name is Owen and to say it at a louder volume and probably ideally in a different voice.

Drizej commented 5 years ago

Hey there Joe, I am happy to try other possible solutions, but if the mp3s work better anyway then maybe its a feature rather than a bug :-)

joejohnmurphy commented 5 years ago

Agreed, I will close out this issue. Thanks!