Socket
Book a DemoInstallSign in
Socket

is-key

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-key

determine if an event is a key

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

is-key

Determine if a particular key was pressed in an event handler

Installation

Install with NPM, Component, or Duo:

$ npm install bmcmahen/is-key

Usage

var key = require('is-key');
var isArrow = key('left', 'right', 'up', 'down');
el.onkeyup = function (e) {
  if (isArrow(e)) {
    // arrow key pressed
  }
};

License

MIT

Keywords

keyname

FAQs

Package last updated on 14 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts