keyboardevents-areequal

Check if two keyboardevents objects are equals.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
keyboardevents-areequal
200.2.25 years ago6 years agoMinified + gzip package size for keyboardevents-areequal in KB

Readme

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