Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brrd/electron-is-accelerator
Check if a string is a valid Electron accelerator
https://github.com/brrd/electron-is-accelerator
accelerator electron
Last synced: 2 months ago
JSON representation
Check if a string is a valid Electron accelerator
- Host: GitHub
- URL: https://github.com/brrd/electron-is-accelerator
- Owner: brrd
- License: mit
- Created: 2016-10-26T11:22:27.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-04-30T06:20:02.000Z (over 4 years ago)
- Last Synced: 2024-10-05T09:23:54.241Z (3 months ago)
- Topics: accelerator, electron
- Language: JavaScript
- Size: 7.81 KB
- Stars: 16
- Watchers: 4
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-electron - electron-is-accelerator - Check if a string is a valid accelerator. (Tools / For Electron)
- awesome-electron - electron-is-accelerator - Check if a string is a valid Electron accelerator. ![](https://img.shields.io/github/stars/brrd/electron-is-accelerator.svg?style=social&label=Star) (Library / Check/Detect)
- awesome-electron-zh - electron-is-accelerator - Check if a string is a valid accelerator. (Tools / For Electron)
README
# electron-is-accelerator
Check if a string is a valid [Electron accelerator](https://github.com/electron/electron/blob/master/docs/api/accelerator.md) and return a boolean. This module can be used to validate user defined accelerators before using them with [MenuItems](http://electron.atom.io/docs/api/menu-item/).
## Installation
```
$ npm install --save electron-is-accelerator
```## Usage
```javascript
var isAccelerator = require("electron-is-accelerator");isAccelerator("CommandOrControl+Shift+Z"); // true
isAccelerator("CommandOrControl+F9"); // true
isAccelerator("CommandOrContrl+F9"); // false
isAccelerator("A+Z"); // false
```## License
The MIT License (MIT)
Copyright (c) 2016 Thomas Brouard