├── component.json ├── bower.json ├── composer.json ├── tests ├── peanutbutter.css ├── defaults.html ├── index.html ├── peanutbutter.js └── jquery-1.7.2.min.js ├── README.md ├── mousetrap.min.js └── mousetrap.js /component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mousetrap", 3 | "repo": "components/mousetrap", 4 | "version": "1.4.6", 5 | "description": "Simple library for handling keyboard shortcuts in Javascript", 6 | "keywords": [ 7 | "keyboard", 8 | "shortcuts", 9 | "keybinding", 10 | "accessibility" 11 | ], 12 | "author": "Craig Campbell", 13 | "license": "APLv2", 14 | "main": "mousetrap.js", 15 | "scripts": [ 16 | "mousetrap.js" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mousetrap", 3 | "version": "1.4.6", 4 | "description": "Simple library for handling keyboard shortcuts in Javascript", 5 | "main": [ 6 | "mousetrap.js" 7 | ], 8 | "repository": { 9 | "type": "git", 10 | "url": "git://github.com/components/mousetrap.git" 11 | }, 12 | "keywords": [ 13 | "keyboard", 14 | "shortcuts", 15 | "keybinding", 16 | "accessibility" 17 | ], 18 | "author": "Craig Campbell", 19 | "license": "APLv2" 20 | } 21 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "components/mousetrap", 3 | "type": "component", 4 | "description": "Simple library for handling keyboard shortcuts in Javascript", 5 | "keywords": [ 6 | "keyboard", 7 | "shortcuts", 8 | "keybinding", 9 | "accessibility" 10 | ], 11 | "homepage": "http://craig.is/killing/mice", 12 | "license": "Apache-2.0", 13 | "extra": { 14 | "component": { 15 | "scripts": [ 16 | "mousetrap.js" 17 | ], 18 | "shim": { 19 | "exports": "window.Mousetrap" 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /tests/peanutbutter.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: helvetica, arial, sans-serif; 3 | line-height: 20px; 4 | } 5 | 6 | table { 7 | border: 1px solid #aaa; 8 | padding: 5px; 9 | border-collapse: collapse; 10 | } 11 | 12 | td, th { 13 | border: 1px solid #ccc; 14 | margin: 0px; 15 | padding: 8px; 16 | height: 25px; 17 | } 18 | 19 | .success { 20 | color: green; 21 | } 22 | 23 | .ready { 24 | background: #fff55e; 25 | /*color: #efbf00;*/ 26 | } 27 | 28 | .failure { 29 | color: red; 30 | } 31 | 32 | .keypress, .keydown, .keyup { 33 | color: #555; 34 | } 35 | 36 | .na { 37 | font-size: 12px; 38 | color: #ccc; 39 | } 40 | 41 | td { 42 | text-align: center; 43 | } 44 | 45 | .result { 46 | font-size: 40px; 47 | 48 | } 49 | 50 | .combo { 51 | text-align: left; 52 | } 53 | -------------------------------------------------------------------------------- /tests/defaults.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |For testing mousetrap
7 |When the row is highlighted press the key(s). If you can't get anything to happen for a certain test press the f key to mark it as a failure
8 |This test is to test the default values if you don't specify an event type. Basically it decides if it should default to keydown or keyup
9 || keys | 13 |keypress | 14 |keydown | 15 |keyup | 16 |result | 17 |
|---|
For testing mousetrap
7 |When the row is highlighted press the key(s). If you can't get anything to happen for a certain test press the f key to mark it as a failure
8 || keys | 12 |keypress | 13 |keydown | 14 |keyup | 15 |result | 16 |
|---|