[Bug 13958] New: Authors should be able to request specific modifiers for accesskeys

http://www.w3.org/Bugs/Public/show_bug.cgi?id=13958

           Summary: Authors should be able to request specific modifiers
                    for accesskeys
           Product: HTML WG
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: HTML5 spec (editor: Ian Hickson)
        AssignedTo: ian@hixie.ch
        ReportedBy: ayg@aryeh.name
         QAContact: public-html-bugzilla@w3.org
                CC: mike@w3.org, public-html-wg-issue-tracking@w3.org,
                    public-html@w3.org


Ryosuke, Ehsan, Annie, and I discussed this at our face-to-face meeting last
week.  See the "Keyboard shortcuts" section of the Etherpad, for the second
day:

http://etherpad.mozilla.com:9000/html-editing-mozilla-google-meeting-minutes

Currently, authors get no control over which modifiers are used for accesskeys.
 accesskey=b might mean Alt-B, Ctrl-B, Alt-Shift-B, Shift-Esc-B, etc.  This is
fine in a lot of cases, but sometimes authors want more control.  For instance,
users expect that pressing Ctrl-B (or Cmd-B on Mac) will make text bold in a
rich-text editor.

Thus authors intercept key events.  This is bad, because it's a pain and easy
to get wrong.  Authors have to manually sniff Mac vs. Windows/Linux to decide
whether to recognize Cmd or Ctrl.  Also, the accesskey won't be visible as an
accesskey when hitting Shift-Esc in Opera or anything else that cares about
accesskeys.  This might include AT (I don't know).

It would be better if authors could declaratively request a specific modifier,
and programmatically detect if they got it or not.  For the use-cases I know
of, the only modifier authors would need to request is the accelerator (Cmd on
Mac, Ctrl on Windows/Linux).

Perhaps in the accesskey attribute, tokens could be optionally prefixed by
"accel-" to request the accelerator instead of the normal modifier.  Like this:

  <button onclick="execCommand('bold')" accesskey="accel-b"><b>B</b></button>

Whether it worked could be detectable using accessKeyLabel.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Received on Monday, 29 August 2011 18:47:53 UTC