Reputation: 804
We have to implement keyboard support for our browser based client. I have found two ways for implementing 1. By specifying "accesskey" attribute in HTML or 2. By supporting hotkeys via javascript
I am inclining to go with 1. because it's inbuild and standard, however I have observed most of websites going for 2.
Is there any particular reason for this ?
Upvotes: 3
Views: 673
Reputation: 444
Many websites neglect testing with screen readers, which have limit support for hot key but much better for accesskey. JAWS announces an item with an accesskey by saying “alt plus [the_accesskey]" but knows less about how JavaScript runs.
Some people also use sticky keys, which can be turned on in MS windows and MAC OS X. So the situations become more complicated. JAWS use ctrl to silent speech. Accesskey or hot key don't work well if they conflict with screen readers own hot keys.
As @Jukka K. Korpela said:
The main reason, or at least a good reason, is that the accesskey attribute is poorly designed, underspecified (the specification does not really say how it works), and inconsistently implemented in browsers.
It will be better as time goes by. What's more, most users just have to learn how to trigger accesskey on their favorite browser.
The accesskey attribute – do we still need it? discuss more about this topic. For both plans, you may test with screen readers to make it more usable.
Blind or low visioned people will thank you for your efforts.
Upvotes: 1
Reputation: 201728
The main reason, or at least a good reason, is that the accesskey
attribute is poorly designed, underspecified (the specification does not really say how it works), and inconsistently implemented in browsers.
Moreover, the use of accesskey
normally requires the user to use an Alt or Option key or equivalent in addition to a letter or digit key. This is not particularly good usability or accessibility.
The only advantage of accesskey
over scripted techniques is that it works when JavaScript is disabled. But this is seldom a real concern in applications or application-like web pages, since they don’t work without JavaScript anyway.
Upvotes: 1