Normalize electron keyboard shortcuts so they work on different operating systems.
npm install electron-shortcut-normalizer --save
const normalize = require("electron-shortcut-normalizer")
normalize('Ctrl+A')
// => 'CommandOrControl+A'
normalize('CommandOrControl+Z', process.platform)
// => 'Command+Z' on Mac OS X
// => 'Control+Z' on Windows and Linux
normalize('CmdOrCtrl+a', 'darwin')
// => 'Command+A'
normalize('CmdOrCtrl+a', 'win32')
// => 'Control+A'
// `Option` is unique to Mac OS X, so it's normalized to `Alt`:
normalize('Option+Up')
// => 'Alt+Up'
For more specific usage information, see test.js
npm install
npm test
None
MIT
Generated by package-json-to-readme