Adding visual clues that accesskey exists - Mailing list pgsql-docs

From Corey Huinker
Subject Adding visual clues that accesskey exists
Date
Msg-id CADkLM=dMg4cad1JJKny5ErRAuMXZcECYNznO6yFP2tJhwutdmA@mail.gmail.com
Whole thread Raw
Responses Re: Adding visual clues that accesskey exists  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
List pgsql-docs
Today I discovered that we already have accesskey support for navigation of our documentation. And it's been there since at least 2007, according to the mailing list archives.

I discovered this accidentally, because I was researching something and just instinctively hit the right arrow in the vain hope that it was somehow linked to the "Next" link.

Doing a view source on the page, I found the access keys: h = home, u = up, n = next, p = previous. That's great, and easy to remember for English speakers, everyone else less so. Accesskeys are primarily discovered via screen readers, so this isn't a huge problem, but having something language independent would be a nice touch. As far as I know, accesskeys cannot be the arrow keys.

Accesskeys seem to have universal support (at least: Chrome, Edge, Firefox, Safari, Opera) now according to https://www.w3schools.com/tags/att_global_accesskey.asp but, as the page says, they are not recommended largely because desktops and browsers tend to reuse these keys.

I would like to make this feature more discoverable and useful. Some ideas, in increasing order of complexity, are:

1. Add static hints to each link, so "Next" becomes "Next [n]".  Fairly simple, but visually clumsy, and it might not actually clue the user that they need to hit ALT+n, not just "n". This chrome extension is an example of how it might look https://chrome.google.com/webstore/detail/display-access-keys/gpicedcgegaokienkdbbcagodgacpbpd?hl=en . The extension itself seems stale if not completely abandoned, but the screenshot gives a good visual representation.

2. Add the hint to the hovertext of the link. So, for example on https://www.postgresql.org/docs/current/libpq-exec.html the Hovertext for the "Next" link would become: "34.4 Asynchronous Command Processing [ALT+n]". This would lead to more accidental discovery, but wouldn't alter the existing static page appearance.

3. Add hotkey that launches an overlay which displays all available keyboard shortcuts. A common example of this is typing '?' in gmail or any other google web app.

4. Actually implement arrow keys with javascript, but leave the accesskeys as-is. I'm not a front-end programmer of any great skill, but it should be easy to capture the keydown event, filter for ArrowUp/ArrowLeft/ArrowRight, and then either search the DOM for the anchor with the corresponding accesskey, or rely on element ids (example: "nav-left", "nav-up", "nav-right") to find the anchor and invoke a .click() on it. Currently the navigation anchors do not have IDs, but adding them for this purpose might close us off from a future use.

Thoughts?



pgsql-docs by date:

Previous
From: "Jonathan S. Katz"
Date:
Subject: Re: Tightening the trust auth advice
Next
From: Noboru Saito
Date:
Subject: archive_command was duplicated in backup.sgml