WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Detecting keyboard usage

for

From: Jonathan C. Cohn
Date: Sep 17, 2013 8:02PM


Perhaps judicious use of the role=application would provide what you want? A region of HTML surrounded by role=application will turn off jaws virtual cursor and probably the browse modes of NVDA and Window-Eyes too. Also, please note that advanced users of VoiceOver that use quickNav have an equivalent to browse mode. Also, if you are in role-application you will need to have keypressed events for all standard navigation keys.


Best wishes,

Jonathan



On Sep 17, 2013, at 8:10 AM, Alastair Campbell wrote:

> Hi everyone,
>
> I've an odd issue with accessibalising a carousel. Yes, yes, I know we
> shouldn't use them, that's not an option here.
>
> It already has a visible pause button, alt text etc etc.
>
> The issue is that I would like it to pause automatically when a keyboard
> user is interacting with the page. (Again, I know that isn't ideal, but it
> "has to" auto-play.)
>
> That is straightforward to do with non-screen reader usage, you can detect
> use of the tab key and pause it.
>
> I thought detecting focus would be ideal, and with a little experimentation:
> http://alastairc.ac/testing/detect-keyboard.html
>
> I can detect "focusin", and it works with people tabbing, and with
> VoiceOver.
>
> However, in NVDA (due to the virtual cursor approach I assume) the event is
> not triggered, i assume it would be the same for Jaws.
>
> It is a similar story for use of the arrow keys, they don't get passed on.
> Does anyone know of a reliable way of detecting keyboard usage? (And why
> doesn't this impact ARIA widgets?)
>
> Regards,
>
> -Alastair
> > >