I wasnt able to run your sample without fixing the open script tag (and its been a while sence I fiddled with svg), I think the problem is loss of focus, after you pop the alert box. you may want to use: window.status = e.charCode ; or window.status = window.status + e.charCode; to put it on the status line Hope Santa brings you what you need Happy EndOfYear.
rwkemper <[EMAIL PROTECTED]> wrote: 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> ----- To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" ---- SPONSORED LINKS Computer internet security Computer internet business Computer internet access Computer internet privacy securities Computer internet help How to format a computer hard drive --------------------------------- YAHOO! GROUPS LINKS Visit your group "svg-developers" on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. --------------------------------- __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com [Non-text portions of this message have been removed] ------------------------ 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/