Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Electron JS kiosk mode with touch screen

Tags:

electron

We are working on a customer facing electron app which should run in kiosk mode. The application runs on a touch enabled device with windows 10.

Even when the app is in kiosk mode, users can easily get into the OS by using the swipe gestures (Swipe left and Swipe right) of the OS.

What is the ideal way to lock down the app and prevent users from interacting with the OS?

like image 542
Raathigesh Avatar asked Feb 23 '17 20:02

Raathigesh


3 Answers

There doesn't appear to be a way to disable touch screen gestures in Windows 10.

If you don't need the full node integration offered in electron, ie. your app could run entirely in Chrome you can run it from a cheap Android dongle and lock it down much more easily. I've done this a few times and there are apps which let you add a password, etc.

Alternatively, you could listen for the blur event on your BrowserWindow which is fired when your app loses focus. At that point you may be able to set it into the foreground again:

const mainWindow = require('electron').remote.getCurrentWindow();

mainWindow.on('blur', () => {
  mainWindow.restore();
  mainWindow.focus();
  mainWindow.setKiosk(true);
});
like image 164
Tim Avatar answered Sep 22 '22 13:09

Tim


I was able to disable touchscreen gestures for edge of screen by editing a group policy value:

  1. RUN gpedit.msc from the Run box
  2. Computer Configuration > Administrative Templates > Windows Components > EdgeUI > Allow Swipe: DISABLE
like image 35
Rastographics Avatar answered Sep 20 '22 13:09

Rastographics


A method I've used since Windows 8, is to kill the explorer.exe process shortly after login. Achieved with a scheduled task, set to run 20-30 seconds after login, with a command like this: taskkill /F /IM explorer.exe

If you need to work on the system, remote in or connect a keyboard and send CTRL + ALT + Del to bring up Task Manager. Go to File > Run new task. In the Create new task dialogue, enter explorer and hit Enter.

When done, reboot the system and all is back to normal.

like image 40
Bink Avatar answered Sep 20 '22 13:09

Bink