Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: about 2 months ago
JSON representation

Check if a string is a valid Electron accelerator

Awesome Lists containing this project

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