Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hughsk/key-pressed
A simple browserify module for telling whether or not a given key has been pressed down.
https://github.com/hughsk/key-pressed
Last synced: 12 days ago
JSON representation
A simple browserify module for telling whether or not a given key has been pressed down.
- Host: GitHub
- URL: https://github.com/hughsk/key-pressed
- Owner: hughsk
- License: other
- Created: 2014-05-13T20:28:00.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-09-09T00:00:04.000Z (about 6 years ago)
- Last Synced: 2024-10-25T22:45:50.707Z (14 days ago)
- Language: JavaScript
- Homepage:
- Size: 121 KB
- Stars: 8
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# key-pressed [![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)
A simple [browserify](http://browserify.org/) module for telling whether or not
a given key has been pressed down.## Usage
[![NPM](https://nodei.co/npm/key-pressed.png)](https://nodei.co/npm/key-pressed/)
### pressed(name) ###
Given a key's `name`, check if that key is currently being pressed down and
return either `true` or `false` accordingly.For most keyboard characters you can simply pass their uppercase equivalent,
and the remaining special characters are listed in
[vkey](https://github.com/chrisdickinson/vkey/blob/ed364428f6327bddfffb92ca09b1ee15cc09456e/index.js#L6-L112).## License
MIT. See [LICENSE.md](http://github.com/hughsk/key-pressed/blob/master/LICENSE.md) for details.