Electron disconnects frequently

Also, there are much better ways to process button presses and only publish an event once.

This thread should help: