Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

key

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

key

A tiny little keycode library

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
263
decreased by-35.7%
Maintainers
1
Weekly downloads
 
Created
Source

#Key

Key is a tiny little keycode library for your browser. It makes keybound event assertions super simple.

Build Status

Installation

Browser

To use Key without a package manager in-browser, copy/link to client/key.js or client/key.min.js and start using.

NPM

Just install with npm install key or add it to your package.json

Usage

Key is bound to the window object, so usage in the browser is simple

var key = window.key

Key will also work fine with a dependency manager like Browserify (both Javascript and CoffeeScript).

var key = require('key')

Example

pressed = 13; // An event keycode (eg jQuery.event.which)

key.get(pressed).name; // "Enter"
key.is(key.code.special.enter, pressed); // true
key.is(key.code.alnum.a, pressed); // false

License

The content of this library is released under the MIT License by Andrew Lawson.
You can find a copy of this license at http://www.opensource.org/licenses/mit

Keywords

FAQs

Package last updated on 06 Nov 2012

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc