
Security News
High Salaries No Longer Enough to Attract Top Cybersecurity Talent
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
mouse-event
Advanced tools
Provides a normalized, cross-browser, garbage-collection-free API for reading out the state of a mouse event.
Because it is 2015 and somehow every major browser still disagrees on even the most basic details of MouseEvents. Seriously guys.
var mouse = require('mouse-event')
window.addEventListener('mousemove', function(ev) {
document.body.innerHTML =
'<p>Buttons: ' + mouse.buttons(ev) +
' x:' + mouse.x(ev) +
' y:' + mouse.y(ev) + '</p>'
})
npm i mouse-event
var mouse = require('mouse-event')
mouse.buttons(event)
Returns a bit vector, similar to event.which
in WebKit encoding the state of the mouse buttons.
event
is a mouse eventReturns A bit vector with the following interpretation for the flags:
1
- left mouse2
- right mouse4
- middle mouse8
- button 416
- button 51<<k
- button k+1mouse.x(event)
Returns the relative x-coordinate of the mouse event
event
is a mouse eventReturns The relative x-coordinate of event
, similar to event.x
in WebKit
mouse.y(event)
Returns the relative y-coordinate of the mouse event
event
is a mouse eventReturns The relative y-coordinate of event
, similar to event.y
in WebKit
mouse.element(event)
Get the element which triggered the event.
event
is a mouse eventReturns The target
or srcElement
or whatever it was that triggered the event
(c) 2015 Mikola Lysenko. MIT License
FAQs
Cross browser mouse event property access
The npm package mouse-event receives a total of 176,537 weekly downloads. As such, mouse-event popularity was classified as popular.
We found that mouse-event demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.