Jump to content

Get when pointer is pressed/released.


Recommended Posts


I want to capture when exactly a pointer is pressed and released (when its isUp and isDown change values). I also want to get the id of the pointer.

I tried with the start() and stop() methods of the pointer, but for some reason they need a DOM event as a parameter, which in my situation is completely useless, I think. Why can't I pass my own function, so that those methods can call it...

EDIT: I tried to use game.input.onDown() and game.input.onUp() and then loop through game.input.pointers to see which pointer is pressed/released. However, the engine is silly again... The onDown event is dispatched after isUp and isDown are changed, but onUp is dispatched before they are changed. I don't see any logic in this. It's kind of OK now, but I see a pointer as released only after another pointer is released. And I get when that other pointer is released when a third one gets released. It's ridiculous.

In version 2.4.2 (an older version - before 2.4.4, which I'm using), the onUp event is dispatched correctly, which is even more interesting.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...