Touch events and scrolling



I am creating an app that will run in a touch device.
The problem is that no touch events are supported when electron runs
I have tried the --touch-events switch but with no luck
I also tried the --touch-devices switch but doing a ps afterwards it seems that the switch is not present in the list of arguments passed in the executable.

Anyone with experience in running Electron with a touch screen?
Are there any specific flags that needed in order for touch events and scrolling to work correctly?



Also tried --enable-touch-events but with no luck as well


Working solution:
add to main.js
app.commandLine.appendSwitch(‘touch-events’, ‘enabled’);


Hi there

I have also tried this and the behavior is the same as running electron with the --touch-events

Specifically, if I give to the dev tools console the command

‘ontouchstart’ in window it returns true

However, if I attach a touchstart handler in any element, the callback never fires
In order for it to work, I need to enable device emulation where touch events are enabled

In your case, is your app running in a touch screen and the switch works correctly?
I am using electron v1.4.8



Was commenting on this other thread but this one looks more promising. @bellostom have you found a working solution? I’m on OSX, which I know is part of the problem, but as I mentioned in the other thread Electron does seem to be piping touch events through to Blink. Haven’t gotten the touch-events switch to work yet…


The issue turned out to be the touch screen’s device driver.
I do not know the specifics, but one of the guys in the hardware team, tweaked something and we were set
Probably this offers little help for you



@ericsoco Looks like this works for touch events. Although interestingly enough, according to your link in the Blink converter, pointer events do not yet make it down to Blink.