Narcoleptic Pasta Manufacturer
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

keys-until-click

1.0.0 • Public • Published

Keys Until Click

A dirt-simple function that will call you back with an event on every key stroke until the next click.

Uses really low level browser javascript, so should work with just about any framework, for times when you really need to just get every key stroke until the next click.

Usage

Like the name says, it really is all about the keys (until the click, that is).

  var keysUntilClick = require('keys-until-click');
 
  keysUntilClick(function (event){
    console.log("Check out this sweet key press: " + event.keyCode);
  });

You might be worried this would keep firing after the next click, but that's patently not what it does. It most certainly only fires until the next click, and not after. The browser will be behaving normally after that kind of thing.

Contributing

God only knows what you could possibly want to contribute. Please, submit an issue, enlighten me how this function could be the next Rails.

install

npm i keys-until-click

Downloadsweekly downloads

2

version

1.0.0

license

ISC

repository

githubgithub

last publish

collaborators

  • avatar