Hi,
You will find that these work for all browsers:
document.rootElement.setAttribute("onkeypress","ecmascript:gKeyPress(evt);")
;
document.rootElement.setAttribute("onkeydown","ecmascript:gKeyDown(evt);");
document['onkeypress'] = gKeyPress;
document['onkeydown'] = gKeyDown;
function gKeyPress(evt)
{
...
}
function gKeyDown(evt)
{
...
}
Hope this helps.
Cheers,
Chris
From: [email protected] [mailto:[email protected]]
On Behalf Of dark3251
Sent: Donnerstag, 15. September 2011 02:07
To: [email protected]
Subject: [svg-developers] Re: No Keyboard Events
Interesting. I could just keep track of the last element clicked or
something similar. Certainly not ideal but I can live with that until
something better comes along.
So what would be the actual function of these focus events if there are no
built in keyboard events? I did a quick test but i couldn't even get the
event to trigger.
--- In [email protected]
<mailto:svg-developers%40yahoogroups.com> , Jacob Beard <jbeard4@...> wrote:
>
> I think your best bet for handling keyboard events interoperably across
SVG
> renderers is to register the key* event listener (keyup, keydown,
keypress)
> on the document root element. Some renderers do things differently - for
> example Batik can receive keypress events on individual elements based on
> the mouse position.
>
> Jake
>
> On Wed, Sep 14, 2011 at 2:55 PM, dark3251 <dark3251@...> wrote:
>
> >
> >
> > Am I right to assume there are no keyboard events associated with SVG at
> > this time? I see nothing in the specifications although the confusing
thing
> > to me is that I see events describing "focus" as if there were keyboard
> > events (e.g. onfocusin/out). Am I just misunderstanding the meaning of
focus
> > here?
> >
> >
> >
>
>
> [Non-text portions of this message have been removed]
>
[Non-text portions of this message have been removed]
------------------------------------
-----
To unsubscribe send a message to: [email protected]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my
membership"
----Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/svg-developers/join
(Yahoo! ID required)
<*> To change settings via email:
[email protected]
[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/