Touchscreen not recognized

Explorer ,
Sep 03, 2020 Sep 03, 2020

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

TOPICS
Code

Views

87

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Sep 03, 2020 Sep 03, 2020

Copy link to clipboard

Copied

use mousedown events, not click events.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 03, 2020 Sep 03, 2020

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Sep 03, 2020 Sep 03, 2020

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 08, 2020 Sep 08, 2020

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Sep 08, 2020 Sep 08, 2020

Copy link to clipboard

Copied

maybe the problem is your chrome settings.

 

https://superuser.com/questions/715909/enable-touch-events-chrome

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 09, 2020 Sep 09, 2020

Copy link to clipboard

Copied

LATEST

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines