How to enable touch events on desktop Mac?


Running Electron on a Mac with a screen sporting a hardware touch addon (PQ Labs sort of thing) and the default drag-scrolling (like on a native touch device) isn’t working.

Tried using endless combinations of
app.commandLine.appendSwitch('touch-devices', '123'),
app.commandLine.appendSwitch('touch-events', 'true') and app.commandLine.appendSwitch('enable-touch-events')
in Electron’s main.js file, but to no avail.

The behavior I’m after is as when you use the Chrome>DevTools>Sensors>Touch: Force Enabled setting in Chrome DevTools.

Found these old links but no clear solution provided:

Anyone done this successfully before?
Thank you,

Touch events and scrolling

@jcnesci, did you ever find a solution for this? Also trying to get Electron to work with a touchscreen, a 3M. I have native multi/touch events coming into OSX via Touch-Base’s UPDD driver, but haven’t successfully gotten them into the browser / Electron yet. I think the former (browser) may not be possible yet, but I’m hoping the latter (Electron) is, through the magic of native code talking with Node…


Seems that the touch events are being captured by the native shell and piped into Blink…but I’m not able to get a 'touchstart' listener to fire in my application code.