Copy link to clipboard
Copied
Hello,
I'm using HTML5 canvas with Animate to make an application that will use a touchscreen.
My problem is that something like on click buttons and whatever needs the "mouse" to be pressed down for some time does not work.
The button will triger the click function however it wont show the "down" state.
I tried to enable touch to see if that would help but it does not, in fact it seems to not detect that I have a touch device:
console.log("Enable touch: "+createjs.Touch.enable(stage)); ==> returns false
if(createjs.Touch.isSupported()){ ==> does not trigger
console.log("touch is supported");
}
I'm running this in windows and the same thing happens when I run it on my target device (a brightsign player that can run HTML5).
Copy link to clipboard
Copied
use mousedown events, not click events.
Copy link to clipboard
Copied
Mousedown events triger just like click events, thats why I can't detect someone holding the button or swiping the screen etc.
Copy link to clipboard
Copied
if you need to use more touch events then you're probably out-of-luck with the built-in easeljs methods if it fails to recognize your device and will need to create your own, https://developer.mozilla.org/en-US/docs/Web/API/Touch_events/Using_Touch_Events
Copy link to clipboard
Copied
I did more testing and found out:
1. it works fine in microsoft edge but the problem is present in chromium based windows browsers.
2. it works fine on android browsers
I don't really need touch events but I would love at least that mousedown events work properly so when I keep a button pressed it stays in the pressd(down) state untill I lift my finger.
This is really bizzare and I have no idea if its a browser proble, my specific touchscreen problem or adobe animate problem.
Copy link to clipboard
Copied
maybe the problem is your chrome settings.
https://superuser.com/questions/715909/enable-touch-events-chrome
Copy link to clipboard
Copied
Thanks, it actually works in mobile emulation mode, you can't just enable touch events like you could before but there is a button in developer settings for mobile emulation mode.
Unfortunately my target device does not have this feature even though it uses its own chromium-based browser.