W3C home > Mailing lists > Public > www-svg@w3.org > June 2002

RE: SVG 1.2 / 2.0 Keyboard Events

From: Doug Schepers <doug@schepers.cc>
Date: Wed, 5 Jun 2002 18:52:38 -0400
To: <www-svg@w3.org>
Cc: <svg-developers@yahoogroups.com>

Hi, Chris (et al)-

Chris Lilley wrote:
> On Wednesday, May 22, 2002, 11:04:25 PM, Doug wrote:
> DS> At the very minimum, I'd like to see Western keyboard letter,
> number, and
> DS> notational characters handled, and I'd really love to see
> such commands keys
> DS> as the arrows, insert, delete, and backspace thrown in as
> well. Dare I say
> DS> "tab"?
> DS> I'll stop short of asking for support for the
> play/pause/ff/stop command
> DS> keys on fancy keyboards...
> Please peruse
> http://www.w3.org/TR/DOM-Level-3-Events/
> and tell us if that seems to fit the bill?

It's a heck of a start! I'd be pretty pleased by the inclusion of this set
of events; I like the model of separating out key events from the text
representations. Also, differentiation between left- and right-
shift/alt/ctrl keys, and numpad input, is nice.

I noticed some exciting possibilies ... could you clarify a couple of things
for me?
 * textInput
"The text information entered can originate from a variety of sources. It
could, for example, be a character resulting from a keypress. It could also
be a string resulting from an input method."

If I read this right, this could take, say, a paste operation? That'd be
wonderful. Probably many other uses that don't immediately pop to mind,

 * keydown and keyup events
Currently, evt.getCharCode() only (properly) processes keypress events,
right? Would adding keydown and keyup supplement, replace, or not affect
getCharCode()'s functionality? I'd like to have all the keyboard handling in
a few universal functions. Currently, I use both keydown and keypress events
to process getCharCode() and keyCode, respectively, but it's a real kluge.

Could this be used to pause animations in SVG? Hardly the full complement of
Play/Pause/Stop/FF/Rew keys, but then I said I wouldn't ask for those. ;)

 * Mutation event
Would you include these as well? I can see a real use for things like
DOMNodeRemoved and DOMAttrModified with respect to OOP.

 * DOMFocusIn, DOMFocusOut, DOMActivate
Same question as above, for the same reasons.

There are still some ommisions, though:
 * "backspace" key -- Did I miss this somehow? I'd expected this to be under
VirtualKeyCode Defined Constants... Right now, I check for (8 ==
evt.getCharCode()) on a keydown to get backspace; I guess that would still
work? In any case, backspace is very useful for text input operations, and
unless there's a really good reason for its omission, I think it'd be good
to have it.

 * "tab" key -- DOMFocusIn, DOMFocusOut, focus, and blur all mention
"tabbing navigation", but the key itself is not mentioned. I have read
variously that (9 == evt.keyCode) will register the keypress event, and that
you can't register it because of how the browser (IE) handles it. I
certainly have not gotten it to work with SVG. This would be extremely
useful in navigation of (X)Forms, setting up a general tabstop handler, and
text input in SVG. Even if Web browsers hog the key event, I think it would
be nice to have in the Spec anyway, in case other UAs want to implement it
(say, Batik, or one of the upcoming handheld viewers).

Maybe one or both of these keys could be extracted from DOM_VK_UNDEFINED...
? I'm not sure how that one works. Could the SVG include DOM3, and extend it
to include these two keys? Pretty please?

Finally, not to be picayune, but I noticed a tiny typo someone might want to
take care of:
"Issue offsets:
Resolution: We are not doing views at the momewnt. "
should obviously read "moment." To whom should I mention this?

Received on Wednesday, 5 June 2002 18:51:34 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:46:53 UTC