rpi3-webiopi
rpi3-webiopi copied to clipboard
Laptop with touch screen and Chrome not working
Bug description: I have laptop with touch screen, and when i open Chrome browser, buttons (on mouse click) are not sanding any events (not calling macro).
Found the problem and solution within /htdocs/webiopi.js. ... ... //DETECTING IF DEVICE IS TOUCH DEVICE. IF TRUE DISABLE MOUSE - PROBLEM!!! var isTouchDevice = "ontouchstart" in document.documentElement ? true : false; var BUTTON_DOWN = isTouchDevice ? "touchstart" : "mousedown"; var BUTTON_UP = isTouchDevice ? "touchend" : "mouseup"; ... ... ... WebIOPi.prototype.createButton = function (id, label, callback, callbackUp) { var button = $('
In my case my laptop is recognize as TouchDevice, so mouseup and mousedown event is not bind to button. Need to be fixed in future versions.
Hi, hmlinaric. Thanks for your bug reporting. I will modify source codes, and release it in next milestone; 0.71+deb06.
Hi, hmlinaric. Tablet PC (e.g., Surface, Chromebook, et al.) generally has multiple input devices (such a mouse or a multi-touch/-point screen), so both mouse and touch event handlers should be registered in JavaScript.
As as easy way (a work-around), I committed a solution in: https://github.com/thortex/rpi3-webiopi/commit/285e5268987e9cbb1629251a4802bb8b95b871bd
I wish you would.