Skip to the Main Content

Note:These pages make extensive use of the latest XHTML and CSS Standards. They ought to look great in any standards-compliant modern browser. Unfortunately, they will probably look horrible in older browsers, like Netscape 4.x and IE 4.x. Moreover, many posts use MathML, which is, currently only supported in Mozilla. My best suggestion (and you will thank me when surfing an ever-increasing number of sites on the web which have been crafted to use the new standards) is to upgrade to the latest version of your browser. If that's not possible, consider moving to the Standards-compliant and open-source Mozilla browser.

January 15, 2006

More on Accesskeys

In my previous post, I argued that accesskey keyboard shortcuts, to be usable, need to be

  1. discoverable
  2. modifiable

and I suggested some techniques for achieving that. To make them discoverable, I suggested including on each page, in some artful way, a definition-list of the form

<dl id="AccessKeyList">
<dt>0</dt><dd><a href="/~distler/blog/accessibility.html" accesskey="0">Accessibility Statement</a></dd>
<dt>1</dt><dd>Main Page</dd>
<dt>2</dt><dd>Skip to Content</dd>
<dt>3</dt><dd>List of Posts</dd>
<dt>4</dt><dd>Search</dd>
<dt>p</dt><dd>Previous (individual/monthly archive page)</dd>
<dt>n</dt><dd>Next (individual/monthly archive page)</dd>
</dl>

with the accesskeys for your site. To make them modifiable, I proposed a Javascript, which turns that definition-list into a template for editing the keybindings, and stores your modified keybindings for future visits.

But what about all those millions of sites, with accesskeys defined, which haven’t gone to this trouble? Since Gez Lemon inspired me to write the above Javascript, it was my turn to inspire Gez. Firefox users can install this Greasemonkey script which provides an (admittedly slightly crude) approximation to the same functionality on any site with accesskeys.

Without an author-supplied definition-list, Gez’s script needs to guess at the meaning of each accesskey. Usually, that works passably well. But, on some sites, the result can be downright comical. Obviously, it would be better if website authors went to the trouble of providing the aforementioned definition list. And with the aforementioned Javascript, all their users (not just those with Firefox and Greasemonkey installed) could customize those keybindings.

But still, it’s remarkable that, with a little clever scripting, Firefox users can now customize the keybindings for the accesskeys on any website. I’d call that progress.

(Update: The latest version of my Javascript restores compatibility with Gez’s Greasemonkey script.)

Looking into the (distant) future, XHTML 2 will offer a self-documenting reformulation of accesskeys. Instead of

<a accesskey="0" href="/accessibility.html" />

XHTML 2 authors will use the self-documenting <access> element. They’ll write

<access key="0"
  title="Accessibility Statement"
  targetrole="foo:accessibility" />

followed by

<a role="foo:accessibility" href="/accessibility.html" />

The WAI offer their own set of 8 predefined roles. Other roles need to be defined in their own namespace

xmlns:foo="http://mysite.com/roles/foo"

which points to an RDF Schema defining the role(s). Alternatively, there’s a

<access key="c"
  title="Post a Comment"
  targetid="comment" />

for those instances when a custom-defined role seems like overkill.

The definition-list we’ve been talking about here is a crude stand-in for the collection of <access> elements in an XHTML 2 document. With that substitution, the same techniques for customizing keybindings will work in XHTML 2. Hopefully, that capability will be built into XHTML 2 User Agents, rather than being an afterthought, as with today’s accesskey attribute.

Update (1/18/2006):

Gez’s script has been updated. The new features include
  1. You can toggle the Accesskey menu by hitting Shift -Esc (to reclaim some screen real-estate, and avoid obscuring the bottom of the page).
  2. The CSS styling is now rolled into the script, rather than loaded from Gez’s site.

For obvious reasons, if you’ve installed the previous version, you want to update. My Javascript has also been updated to detect the presence of Gez’s script and ensure that they play nicely together.

Posted by distler at January 15, 2006 4:12 PM

TrackBack URL for this Entry:   https://golem.ph.utexas.edu/cgi-bin/MT-3.0/dxy-tb.fcgi/727

5 Comments & 0 Trackbacks

Re: More on Accesskeys

Hi Jacques,

opening your blog with Internet Explorer is painful to impossible by now. Very slow, often it hangs.

Just a bit of feedback in case you care – please no lecture on how I should be using a “better” browser. I’m just saying this as one of your readers who is interested in your articles about physics (rather than software technology).

Best,

Posted by: Michael on January 17, 2006 7:36 PM | Permalink | Reply to this

Explorer

Hmmm.

Sorry to hear that. One of the things that I re-enabled, when I installed this latest bit of software was a program to enable support for CSS :hover effects in IE.

I don’t have the time or the inclination to debug it, so I’ve disabled it again. Hopefully, that will improve the responsiveness for you. If someone knows a solution for IE’s defective CSS support (specifically :hover) that will work reliably for people like Michael, I’ll be happy to try it.

In the meantime, you and the others reading this in IE will just have to live without CSS :hover.

Posted by: Jacques Distler on January 17, 2006 9:29 PM | Permalink | PGP Sig | Reply to this

Unsolicited Browser Advice

Oh, and if you are interested in the Physics posts, then installing the MathPlayer plugin for Internet Explorer would make them actually readable.

For some people, IE+MathPlayer may even be a superior choice to Mozilla/Firefox. I don’t know whether you’re one of those people, but I certainly want to ensure that their browsing experience is unimpeded.

Posted by: Jacques Distler on January 19, 2006 9:04 AM | Permalink | PGP Sig | Reply to this

Re: More on Accesskeys

I love you.

Posted by: brian on January 17, 2006 8:42 PM | Permalink | Reply to this

Re: More on Accesskeys

I’m going to try installing the mathplayer plugin and I’ll try to come back to let you know how it goes!

Posted by: Jason Brown on January 30, 2008 2:45 PM | Permalink | Reply to this

Post a New Comment