WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Detecting keyboard usage

for

From: Léonie Watson
Date: Sep 17, 2013 7:18AM


Alastair Campbell wrote:
" Does anyone know of a reliable way of detecting keyboard usage? (And why
doesn't this impact ARIA widgets?)"

Screen readers that utilise a virtual buffer will automatically switch into
application mode when they encounter certain ARIA widgets. This stops the
screen reader from intercepting the keys, and passes them back through to
the browser instead.

Léonie.

-----Original Message-----
From: <EMAIL REMOVED>
[mailto: <EMAIL REMOVED> ] On Behalf Of Alastair Campbell
Sent: 17 September 2013 13:10
To: WebAIM Discussion List
Subject: [WebAIM] Detecting keyboard usage

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
messages to <EMAIL REMOVED>