npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@kba/keypress.js

v2.1.4-webpack-2

Published

a robust keyboard input capturing Javascript utility focused on input for games. For details and documentation, please visit http://dmauro.github.io/Keypress/

Downloads

9

Readme

Keypress

Version 2.1.4

Keypress is a robust keyboard input capturing Javascript utility focused on input for games. For details and documentation, please visit http://dmauro.github.io/Keypress/

If you're using Keypress with Meteor, see the Meteor notes.

Copyright 2016 David Mauro
released under the Apache License, version 2.0

What's new

2.1.4

2.1.3

2.1.2

  • Added some simple jQuery proofing so you can pass in the result of a jQuery selector into the Listener's constructor. Thanks to mallocator for the request. Issue #89
  • Changed the default behavior of how sequence combos behavior. Most people probably would have considered this a bug, so I'm not considering this API breaking. Thanks to ronnyek for pointing the problem out in Issue #68.
  • Bower file cleaned up thanks to kkirsche. Pull request #97
  • Keys in FF/Gecko - and = fixed thanks to deanputney. Pull request #95

2.1.1

2.1.0

2.0.3

  • Fixed a bug unregistering combos using arrays of keys
  • Added ie8 compatibility shim. Thanks to barrkel. Issue #41
  • Fixed a bug targetting the semicolon key in Firefox. Thanks to mikekuehn.
  • Added commonJS module support. Issue #45

2.0.2

  • Fixed a bug that prevented combos from unregistering, and updated the docs for how to unregister properly. Thanks to pelly and g00fy-. Issue # 34.
  • Added AMD support. Issue #37.

2.0.1

  • Fixed a big ole bug with meta/cmd combos. Thanks to lexey111. Issue #29.
  • Fixed a bug with the Windows key being released on Windows systems. Issue #27.

2.0.0

  • Keypress now has a listener class that must be instantiated. The functions that were previously in the global window.keypress object are now public methods of the window.keypress.Listener class.
  • Each instance of a Keypress listener can be bound to a DOM element by passing in the element to the listener's constructor.
  • Combos now default to being ordered (the property is now called is_unordered and is false by default).
  • Combos' handlers preventDefault unless the handler returns true.
  • The "combo" public method is now called "simple_combo".
  • The basic combo helpers for simple, counting and sequence combos no longer have a third prevent_default optional parameter.
  • Debugging console logs can be enabled by setting keypress.debug to true.
  • All key event callbacks send a third argument specifying whether the event is firing again automatically because the key has remained pressed down.

1.0.9

  • Fix escape key bug. Issue #17.
  • Fix unregister bug. Issue #24.

1.0.8

  • Ensure that on_release is called for all combos, not just counting combos.
  • Fix bug that was causing is_ordered to be ignored.
  • Fixed an edge case for a counting combo's count not being reset.
  • Improve how key events are bound

1.0.7

  • Fixed combo matching to prevent performance issues as more keys are pressed.

1.0.6

  • Fixed a bug with exclusive combos not properly excluding each other in some cases.
  • Feature added to allow for combos that do not fire if unrelated keys are also pressed ("is_solitary" boolean).

TODO

  • Put negative edge in sequences.
  • See if we can do away with keyup_fired and count properties.