Mouse Events not working on machines with a touchscreen

I do have a wacom pen tablet installed, but its not plugged in.

Edit: and the Surface Pen of course

Hi Simon,

A client of mine is seeing similar issues, where the Surface Pro touch screen isn’t working.

With this change to the document body, has the same content worked on all machines ( ie does the Surface Pro now behave correctly )?

If so, would it be possible for this to be a toggle-able option within PlayCanvas, or just have it on by default. I didn’t realise that PlayCanvas wouldn’t work properly on a Surface Pro without this until earlier today ( the PlayCanvas content was tested on the clients Surface Pro, and on a second one locally ).

For anyone else having this issue, you can do the following tasks within PlayCanvas

  1. Create a script called injectSurfaceProTouchFix

  2. Paste the following code into it

var InjectSurfaceProTouchFix = pc.createScript(‘injectSurfaceProTouchFix’);

// initialize code called once per entity
InjectSurfaceProTouchFix.prototype.initialize = function() {
var css = ‘canvas {touch-action: none;}’;
var style = pc.createStyle(css);
document.head.appendChild(style);
};

  1. Attach this to a new empty in the scene, or to an existing entity.

Your content will now work correctly with the Surface Pro.

Tested on a Surface Pro in IE 11 and Edge, it works in both.