Keyboard shortcuts in Javascript

Hi,

I presume everyone does this.

It's a terrible idea. We really should find a way to stop doing it.

I think a key to being able to give them up is to make accesskey work. For  
the moment implementations still range between bad and abysmal ;( although  
the overall standard is way better than it was.

If we don't do that, we're going to be stuck replicating it and hoping we  
somehow do it different this time. If we do fix it, we have teh benefit of  
not breaking a lot of existing content (last I checked, accesskey was used  
by about 1.5% of content - and it tends to be on big sites people use a  
lot).

Note there are a few key things to keep in mind:

accesskey shouldn't replace user intention events or other standard things  
like <a rel="help">. If we have a standard event for "Toggle Bold Text" or  
"make this a link" then it *shouldn't* need an activation, since it should  
have one in the UI. (But then, following links in SVG should have one too,  
and doesn't in a fair number of browsers ;( ).

accesskey should be an author *hint* to activate an element (or function),  
and the user agent should be free to assign some other activation  
behaviour - a key that is more readily available (accesskey="я" is  
perfectly sensible in some cases, but should be mapped for latin keyboard  
users - and in Opera not directly to the Z key that it already uses for  
enhanced navigation)

users should be able to find out what shortcut activation has been  
assigned, from the user agent. Asking authors to guess is stupid at best  
because they don't get it right, and impossible at worst because if you  
allow for customisation the odds of them getting it right are probably  
even smaller.

One of these days - maybe even in time for TPAC - I hope to get my  
accesskey proposal finished. It's currently a mess on github...

cheers

-- 
Charles McCathie Nevile - web standards - CTO Office, Yandex
  chaals@yandex-team.ru - - - Find more at http://yandex.com

Received on Tuesday, 20 October 2015 22:16:50 UTC