New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.7
Source
npm
Version published
Weekly downloads
813
20.8%
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

###Example

Here's how key can work together with a DOM query library like jQuery to navigate through a [pseudo] image gallery.

var gallery = new GalleryOfAwesome();

$(window).on('keyup', function(event) {
    if (key.is(key.code.arrow.left, event.which)) {
        gallery.navigateLeft();
    } else if (key.is(key.code.arrow.right, event.which)) {
        gallery.navigateRight();
    } else if (key.is(key.code.special.esc, event.which)) {
        gallery.close();
    }
});

###Usage

var key = window.key; // In browser
var key = require('key'); // Or package manager

###Installation

  • npm install key
  • <script src="path/to/vendors/adlawson/key/client/key.min.js"></script>

###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

key

FAQs

Package last updated on 14 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