Hello All,

I have a very tiny and simple example below. Actually I want to get 
all keystrokes (may be just on the rect) and indicate the ascii code 
by the alert function.
In case I click onto the red rectangle before, it works once.
Why does a click on the rect activate the eventlistener ?? 

But after the first one, it happens never again (before I click the 
rect again !!! )

What's is wrong here ?

Thank you very much for your kind help !


<svg onload="init(evt)" width="500" height="800" >
        <script><![CDATA[
        function init(e) {      
        if ( window.svgdoc == null ) svgdoc = e.target.ownerDocument;
        svgroot = svgdoc.documentElement;
        svgroot.addEventListener("keypress",Key,false);    
    }
        
    function Key(e){
                  alert(e.charCode);
    }
        ]]></script>
        
        <rect x="100" y="100" width="200" height="200" fill="red"/>

</svg>






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/1U_rlB/TM
--------------------------------------------------------------------~-> 

-----
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/

<*> 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/
 


Reply via email to