Loading ...
Sorry, an error occurred while loading the content.

Re: HELP !! keypress event fires only once (ASV3 / IE6 )

Expand Messages
  • rwkemper
    Dear John, thanks a lot for the quick hint. You seem to be right. In my more complex real world it seems to be a similar effect. It looks like that some other
    Message 1 of 3 , Dec 21, 2005
    • 0 Attachment
      Dear John,

      thanks a lot for the quick hint. You seem to be right. In my more
      complex real world it seems to be a similar effect. It looks like
      that some other event changes the focus.
      Thanks,
      I hope you have a time to enjoy x-mas and e/o year days.
      Rolf
      --- In svg-developers@yahoogroups.com, John Coe <johncoe42@y...>
      wrote:
      >
      > 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 <KemperR@e...> 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: svg-developers-
      unsubscribe@yahoogroups.com
      > -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:
      > svg-developers-unsubscribe@yahoogroups.com
      >
      > 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]
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.