Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Aug 2010
    Location
    Now Southern Oregon. I was born and had lived my life in Los Angeles until relocating last year (2010)
    Posts
    208
    Thanks
    52
    Thanked 1 Time in 1 Post

    mouse event handler cancels keypress handler

    I have an app where there are mouse events used for DHTML and keypress events used for the same exact same action.
    The app is told by the user to register keypress events by checking a checkbox.
    If the user checks the box and starts using the arrow keys, and then switches to the mouse to do the same action,
    then goes back to the arrow keys, the arrow keypress events do not work.
    The user must uncheck the checkbox and recheck it for the arrow keys to function again.
    Currently the keypress event handling is being developed and tested only in
    FF on Mac OSX.

    Hopefully I don't have to post a lot of code, because there is a lot to sort
    through.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,731
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    If you don't post the (relevant) code I don't see how anyone can help you.

    It is your responsibility to die() if necessary….. - PHP Manual

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #3
    Regular Coder
    Join Date
    Aug 2010
    Location
    Now Southern Oregon. I was born and had lived my life in Los Angeles until relocating last year (2010)
    Posts
    208
    Thanks
    52
    Thanked 1 Time in 1 Post

    I know it is hard without the code

    There are at least a thousand lines (by the way I format my code) of relevant code.
    That could be trimmed to around 500 lines for this post. I have been
    wrapping as much code as possible into constructor functions. So an
    argument passed to a method could refer to another section of code that
    someone would have to look at to get the whole story.

    I was hoping to get a response from someone who had specific experience
    with this phenom.

    BUT, I was testing in an older version of Firefox. New versions and other DOM browsers
    would not run the key events as coded, at all. So I am trying to use arrow keys,
    and was trying charCode, when I should have been using keydown events
    and looking for keyCode. I also need to add the event listeners
    to the document, rather than a specific element in the document.

    That solved the problem in the newer FF, and others. These also do not have
    the same 'mouse event cancels key event' problem I originally encountered

    So considering the age of that test version, I could probably ignore it.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •