November 2019
Beginner
436 pages
8h 52m
English
In this section, we are going to provide support for saving files to the local filesystem, as well as handling global keyboard shortcuts.
Depending on the platform, you may want to support either Cmd + S for macOS or Ctrl + S for Windows or Linux desktops.
Let's start by switching back to the menu.js file and registering a new global shortcut. The Electron framework is going to handle it regardless of the focused window. It can handle globally registered shortcuts even if no window is present. This is often used when the application provides support for the minimize to tray feature:
const { globalShortcut } = require('electron'); ...Read now
Unlock full access