Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ccampbell/mousetrap
Simple library for handling keyboard shortcuts in Javascript
https://github.com/ccampbell/mousetrap
javascript keyboard keyboard-shortcuts mousetrap
Last synced: 5 days ago
JSON representation
Simple library for handling keyboard shortcuts in Javascript
- Host: GitHub
- URL: https://github.com/ccampbell/mousetrap
- Owner: ccampbell
- License: apache-2.0
- Created: 2012-07-05T03:13:55.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2023-03-15T18:11:42.000Z (almost 2 years ago)
- Last Synced: 2024-10-29T20:55:51.700Z (3 months ago)
- Topics: javascript, keyboard, keyboard-shortcuts, mousetrap
- Language: JavaScript
- Homepage: https://craig.is/killing/mice
- Size: 450 KB
- Stars: 11,682
- Watchers: 175
- Forks: 968
- Open Issues: 238
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-frontend - mousetrap - Simple library for handling keyboard shortcuts in Javascript. ![](https://img.shields.io/github/stars/ccampbell/mousetrap.svg?style=social&label=Star) (Repository / Interaction)
- awesome-javascript-cn - 官网
- awesome-javascript - mousetrap - Simple library for handling keyboard shortcuts in Javascript - ★ 9166 (Keyboard Wrappers)
- starred-awesome - mousetrap - Simple library for handling keyboard shortcuts in Javascript (JavaScript)
- awesome-inspiration - mousetrap
README
# Mousetrap
[![CDNJS](https://img.shields.io/cdnjs/v/mousetrap.svg)](https://cdnjs.com/libraries/mousetrap)Mousetrap is a simple library for handling keyboard shortcuts in Javascript.
It is licensed under the Apache 2.0 license.
It is around **2kb** minified and gzipped and **4.5kb** minified, has no external dependencies, and has been tested in the following browsers:
- Internet Explorer 6+
- Safari
- Firefox
- ChromeIt has support for `keypress`, `keydown`, and `keyup` events on specific keys, keyboard combinations, or key sequences.
## Getting started
1. Include mousetrap on your page before the closing `