Skip to main content
Inspiring
September 3, 2020
Question

Touchscreen not recognized

  • September 3, 2020
  • 1 reply
  • 654 views

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).

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
September 3, 2020

use mousedown events, not click events.

Inspiring
September 3, 2020

Mousedown events triger just like click events, thats why I can't detect someone holding the button or swiping the screen etc.

kglad
Community Expert
Community Expert
September 3, 2020

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