anys-web-plugin-monitor-mouse-event
v9.0.0
Published
Monitor mouse event.
Readme
AnysMonitorMouseEventPlugin
Monitor mouse event.
Install
npm i anys-web-plugin-monitor-mouse-event<script src="https://unpkg.com/anys-web-plugin-monitor-mouse-event"></script>Usage
import { AnysMonitorMouseEventPlugin } from 'anys-web-plugin-monitor-mouse-event';<script>
const { AnysMonitorMouseEventPlugin } = window.anys;
const anys = new Anys({
plugins: [AnysMonitorMouseEventPlugin],
});
</script>Options
- mouse: !isSupportTouch, total switch, when
falseall options items will not work - click: true,
- mousemove: false,
- mousedown: false,
- mouseup: false,
- wheel: false,
- contextmenu: false,
const anys = new Anys({
mouse: false,
});Log
{
type: 'click' | 'mousemove' | 'mousedown' | 'mouseup' | 'contextmenu',
time: Date.now(),
detail: {
e: getPath(target),
w: innerWidth,
h: innerHeight,
x: pageX,
y: pageY,
button,
},
}{
type: 'wheel',
time: Date.now(),
detail: {
e: getPath(target),
deltaX,
deltaY,
deltaZ,
mode: deltaMode,
},
}