Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

4 years ago by Joncom

In "input.js", there is a line that looks like this:
ig.system.canvas.addEventListener('touchend', this.keyup.bind(this), false );

Another line should be appended after it so that we have:
ig.system.canvas.addEventListener('touchend', this.keyup.bind(this), false );
ig.system.canvas.addEventListener('touchcancel', this.keyup.bind(this), false );

Why?

For example, on iOS, pressing down on a button that happens to be flush with the bottom of the screen, and then dragging up will open the Control Center. This will trigger a touchcancel event. No touchend event will ever fire for this touch.

Therefore, without adding the second line, the button will remain pressed down, even after closing the Control Center.

This should be a minor issue with vanilla Impact, because a new touchstart and touchend should clear things. Although, it is odd that technically multiple "pressed" events can fire before a "released" event.

This is a major issue for anyone supporting multi-touch, because without handling touchcancel, it's very possible to have several permanently "pressed down" and "stuck" touch events active around the canvas.

4 years ago by stahlmanDesign

You should tweet his to Dominic Szablewski @phoboslab

4 years ago by Joncom

This issue is now fixed in Houly's excellent multi-touch plugin.

4 years ago by dungeonmaster

Is this the reason also why the released never fires for mouse button if you are on a touch-pad ?

4 years ago by Joncom

Quote from dungeonmaster
Is this the reason also why the released never fires for mouse button if you are on a touch-pad ?
Do you mean on the iPad? released should still fire there as far as I know...

4 years ago by dominic

Fixed in the recent dev version in the git repo. Thanks Joncom!

4 years ago by dungeonmaster

@Joncom: No, I mean the trackpad. In my game I check the .released for button clicks. When I use the trackpad on macbook air and tap on the trackpad, it fires the .pressed but not .released.
Page 1 of 1
« first « previous next › last »