https://github.com/uiur/with-modifier-key
Detect some modifier keys are pressed
https://github.com/uiur/with-modifier-key
Last synced: 3 months 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 10 years ago)
- Default Branch: master
- Last Pushed: 2015-07-21T02:41:33.000Z (over 10 years ago)
- Last Synced: 2025-07-16T07:50:20.199Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 125 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# with-modifier-key
[](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