Forum Discussion

AaronBurgessAU's avatar
AaronBurgessAU
Community Member
6 days ago
Solved

Clicking a button while setting focus

This is probably not possible, but worth asking.

I have a task in Storyline 360 where a user can click on 3 buttons. Each button changes a specific BLANK variable in a sentence. Button1 changes variable1 etc etc.

EG. Button1 when clicked changes to "tree", and when clicked again it changes to "mountain".

The sentence would be "There was a beautiful (BLANK) it was very (BLANK)" <-- the second BLANK is for Button2 as an example.

I would love to know if it is possible that when a user clicks one of the buttons, the screen reader reads out the sentence, but we still keep focus on the button.

Right now if the user clicks the button I set focus to the sentence so the user can hear their choice in context, but then they need to navigate back to which ever button they were on before they clicked. If I keep focus on the buttons, the user then has to navigate to the sentence to hear if their choice makes sense.

So yeah...is there a way to allow the user to stay on the button but also have the sentence read out by the screen reader?

  • Hi AaronBurgessAU​ there is a hack for this. As I say, it's not a documented feature, but something I have used to force the screen reader to announce content and retain focus. I have tested with JAWS NVDA and Windows Narrator and it has worked consistently.

    What I do is use a layer, the layer should have the following properties:

    Then add your string of text to the layerand position the text just off-screen (you don't want to see it flash up when the layer is shown). You also want the layer to be blank (transparent background) so it is not seen when shown.

    Then set the layer timeline to very very short:

    Give your layer a name so you remember what it is and don't accidentally delete it:


    Then, whenever you want that text announced to the screen reader, just show the layer. I think the key property on the layer that makes the screen reader announce the content is Prevent the user from click on the other layers.

    The layer has a very short timeline, and hides itself, returning the focus to the button that triggered the layer. You may just have to tweak if it doesn't work and just ensure there is enough time for the text in the layer to be put into the screen readers buffer.

    Cheers,
    Sam

3 Replies

  • AaronBurgessAU's avatar
    AaronBurgessAU
    Community Member

    Thank you SamHill​ 

    I did consider how a layer might have resolved this problem, but I couldn't think of a solution. Thank you so much it worked perfectly.

  • Hi AaronBurgessAU​ there is a hack for this. As I say, it's not a documented feature, but something I have used to force the screen reader to announce content and retain focus. I have tested with JAWS NVDA and Windows Narrator and it has worked consistently.

    What I do is use a layer, the layer should have the following properties:

    Then add your string of text to the layerand position the text just off-screen (you don't want to see it flash up when the layer is shown). You also want the layer to be blank (transparent background) so it is not seen when shown.

    Then set the layer timeline to very very short:

    Give your layer a name so you remember what it is and don't accidentally delete it:


    Then, whenever you want that text announced to the screen reader, just show the layer. I think the key property on the layer that makes the screen reader announce the content is Prevent the user from click on the other layers.

    The layer has a very short timeline, and hides itself, returning the focus to the button that triggered the layer. You may just have to tweak if it doesn't work and just ensure there is enough time for the text in the layer to be put into the screen readers buffer.

    Cheers,
    Sam

    • DShaw's avatar
      DShaw
      Community Member

      I really like this solution.. my initial thoughts when I read the post was a JavaScript solution triggered on each button would be the way to go. The outcome would be similar but you wouldn’t have to worry about the focus moving and the timeline tuning you mentioned.