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.
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
With npm installed, run
npm install --save keyboardevents-areequal
MIT