Skip to content

Latest commit

 

History

History
42 lines (24 loc) · 1.11 KB

README.md

File metadata and controls

42 lines (24 loc) · 1.11 KB

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