On Sep 20, 2007, at 4:33 AM, AsbjÃ¸rn Ulsberg wrote:
> On Thu, 20 Sep 2007 13:03:03 +0200, Maciej Stachowiak
> <mjs@apple.com> wrote:
>
> First I have to say that I really like the suggestion. What's
> missing, though, is a way to bind a command to an actual action in
> the document. Is this done via a "command" attribute, via scripting,
> or both?
With the "onclick" attribute or programmatic "click" or "DOMActivate"
event listeners. Note that these events bubble, so this could
automatically activate another element by nesting. The not-yet-defined
command attribute may allow you to active an arbitrary other element.
It may also be useful to add a "focus" command type to automatically
focus another element, if this is expected to be a commonly desired
keyboard shortcut so that it should be doable without script. (With
script you can just call focus() on the element to be focused from the
command's onclick handler). I can imagine wanting a shortcut to focus
a page's search field for instance.
If shortcutkey="" is allowed on other types of command-defining
elements, you could make a link command using an <a> element.
>> <command label="Compose New Message" shortcutkey="n 1">
>
> Could perhaps "shortcutkey" be shortened to just "key" or
> "keys" (since multiple keys can be bound to one command)?
The idea is that only one key binding is created, but the client may
give multiple prioritized suggestions. It has been pointed out that
XHTML2 adds an <access> element with a key="" attribute, so perhaps
key would be a good choice.
Regards,
Maciej