0

HTML5 touchscreen input

I have a simple(ish) HTML5 page- essentially just a full-screen canvas. I've added event listeners for touch/mouse input, and they just aren't being called. I've connected a remote debugger, and verified that the functions aren't triggering.

function hit(evt){
console.log("hit"); //added remote breakpoint here- never called
}
var evt_options = {capture:true,once:false,passive:false};
canvas.addEventListener('mousedown', hit, evt_options);
canvas.addEventListener('touchstart', hit, evt_options);

Any ideas?

I've run the same code from a PC on the same touchscreen, and it works fine. I've even (accidentally) triggered the brightsign device setup with the touchscreen, and used the touchscreen to interact with that- so the communication between touchscreen/brightsign is functional. (related question: how do I trigger the brightsign device setup?)

Is there something I need to do to enable HTML5 touchscreen functionality?

The method I'm using to host this whole thing is with an autorun.brs script at the root of the SD card, that references an html file via "file:///index.html" during its initialization (other than that, + enabling the debugger, I just copied pasted the example autorun.brs script from the documentation- but I've spent 15 minutes looking for that documentation again and I can't find it).

1 comment

Please sign in to leave a comment.