Hi,

 

Probably more helpful is the explanation of "then in use":

 

then in use:

XXX.prototype.onMouseDown = function(evt)

{

   if(getFocus() != this)
      setFocus(this);



   ...
}



Hope that helps, if not feel free to ask.

 

Cheers,

Chris

 

From: svg-developers@yahoogroups.com [mailto:svg-developers@yahoogroups.com]
On Behalf Of Chris Peto
Sent: Donnerstag, 15. September 2011 03:27
To: svg-developers@yahoogroups.com
Subject: RE: [svg-developers] Re: No Keyboard Events

 

  

Hi,

I have my own focus system:

//widget focusing

var gFocusObj = null;

function getFocus()

{

return gFocusObj;

}

//----------------------------------------------------------
------

function setFocus(newfocusobject)

{

if(gFocusObj && gFocusObj.killFocus)

gFocusObj.killFocus(newfocusobject);

if(newfocusobject && newfocusobject.setFocus)

{

//old and new

newfocusobject.setFocus(gFocusObj,newfocusobject); 

}

gFocusObj = newfocusobject;

}

function killFocus()

{

gFocusObj = null;

}

function checkFocus(evt)

{

if(evt.button == 0)

{

if(gFocusObj && gFocusObj.killFocus)

gFocusObj.killFocus(null);

gFocusObj = null;

}

}

then in use:

function ...

{

if(getFocus() != this)

setFocus(this);

}

js objects:

XXX.prototype.killFocus = function(newfocusobj)

{

}

XXX.prototype.setFocus = function(oldfocusobject, newfocusobj)

{

}

From: svg-developers@yahoogroups.com
<mailto:svg-developers%40yahoogroups.com>
[mailto:svg-developers@yahoogroups.com
<mailto:svg-developers%40yahoogroups.com> ]
On Behalf Of dark3251
Sent: Donnerstag, 15. September 2011 03:11
To: svg-developers@yahoogroups.com <mailto:svg-developers%40yahoogroups.com>

Subject: [svg-developers] Re: No Keyboard Events

That's very cool but I'm not really interested in something browser
specific. Also, i searched everywhere through that code and found no mention
of the SVG focus events. Every element has the onfocusin event but yet every
description of it in documentation is very vague and I can find no examples.

--- In svg-developers@yahoogroups.com
<mailto:svg-developers%40yahoogroups.com> 
<mailto:svg-developers%40yahoogroups.com> , Jacob Beard <jbeard4@...> wrote:
>
> You can implement your own focus system. For example, see the following
> example comprising two editable text areas (Firefox only):
> http://live.echo-flow.com/experimental/vi-everywhere/multi-editor.svg
> 
> Jake
> 
> On Wed, Sep 14, 2011 at 8:06 PM, dark3251 <dark3251@...> wrote:
> 
> >
> >
> > 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 svg-developers@yahoogroups.com
<mailto:svg-developers%40yahoogroups.com> 
<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]
>

[Non-text portions of this message have been removed]





[Non-text portions of this message have been removed]



------------------------------------

-----
To unsubscribe send a message to: svg-developers-unsubscr...@yahoogroups.com
-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:
    svg-developers-dig...@yahoogroups.com 
    svg-developers-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    svg-developers-unsubscr...@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to