Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/uiur/with-modifier-key
Detect some modifier keys are pressed
https://github.com/uiur/with-modifier-key
Last synced: about 1 month ago
JSON representation
Detect some modifier keys are pressed
- Host: GitHub
- URL: https://github.com/uiur/with-modifier-key
- Owner: uiur
- Created: 2015-07-18T02:51:05.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-07-21T02:41:33.000Z (over 9 years ago)
- Last Synced: 2024-04-24T16:19:30.313Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 125 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# with-modifier-key
[![Build Status](https://travis-ci.org/uiureo/with-modifier-key.svg)](https://travis-ci.org/uiureo/with-modifier-key)Detect some modifier keys are pressed.
For example, you can use this to detect an user is going to open a link in new tab or window.
``` javascript
var withModifierKey = require('with-modifier-key')element.addEventListener('click', function (event) {
if (withModifierKey(event)) {
// yay
}
})
```## Install
```
npm install with-modifier-key
```## License
MIT