Open ernistkg opened 8 years ago
mesh._3xDomEvent.clickHandlers[ 0 ].callback();
this may work... but wow this is kludgy :)
Hey there! EventListener not working on mobile only (Android and Chrome for Windows using mobile view [developer tools]). Curiously, when I change from 'click' to 'mouseover', and I click and drag, it recognizes the "mouse over"
I saw in threex.domevents.js the code:
this._domElement.addEventListener( 'touchmove' , this._$onTouchMove , false );
this._domElement.addEventListener( 'touchstart' , this._$onTouchStart , false );
this._domElement.addEventListener( 'touchend' , this._$onTouchEnd , false );
this is not in README ...
So I change 'click' to 'touchstart' and it works. 👍
In web and mobile handle click and touch are different. So, I do that:
var mouseEventHandle = 'click';
if('ontouchstart' in document.documentElement === true)
mouseEventHandle = 'touchstart';
domEvents.addEventListener(meshObject, mouseEventHandle, callbackFunction());
Hope help someone!
Is there any way to programmatically click object with domEvent plugin or pure THREEjs?