https://github.com/parro-it/keyboardevents-areequal
Check if two keyboardevents objects are equals.
https://github.com/parro-it/keyboardevents-areequal
Last synced: about 1 year ago
JSON representation
Check if two keyboardevents objects are equals.
- Host: GitHub
- URL: https://github.com/parro-it/keyboardevents-areequal
- Owner: parro-it
- License: mit
- Created: 2017-06-29T17:59:42.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-07T13:56:22.000Z (almost 9 years ago)
- Last Synced: 2025-03-11T07:45:27.648Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 164 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license
Awesome Lists containing this project
README
# keyboardevents-areequal
[](http://travis-ci.org/parro-it/keyboardevents-areequal)
[](https://npmjs.org/package/keyboardevents-areequal)
> Check if two keyboardevents objects are equals.
This module is part of an ongoing effort to make [electron-localshortcut](https://github.com/parro-it/electron-localshortcut) less error prone, using keyboard DOM listener instead of 'globalShortcut' method to trigger shortcuts handlers.
## Usage
This example check if various KeyboardEvent objects represents the same event:
```js
const areEqual = require('keyboardevents-areequal');
console.log(areEqual({ctrlKey: true, code: 'f'}, {ctrlKey: true, code: 'f'}));
// true
console.log(areEqual({code: 'f'}, {ctrlKey: true, code: 'f'}));
// false
```
## API
## Install
With [npm](https://npmjs.org/) installed, run
```bash
npm install --save keyboardevents-areequal
```
## See Also
- [`noffle/common-readme`](https://github.com/noffle/common-readme)
## License
MIT