Tumortisch-Dist/resources/app/node_modules/keyboardevents-areequal
2021-06-15 16:00:08 +02:00
..
example.js project files added 2021-06-15 16:00:08 +02:00
index.js project files added 2021-06-15 16:00:08 +02:00
license project files added 2021-06-15 16:00:08 +02:00
package.json project files added 2021-06-15 16:00:08 +02:00
README.md project files added 2021-06-15 16:00:08 +02:00

keyboardevents-areequal

Travis Build Status NPM downloads

Check if two keyboardevents objects are equals.

This module is part of an ongoing effort to make 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:

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 installed, run

npm install --save keyboardevents-areequal

See Also

License

MIT