anys-web-plugin-monitor-mouse-event
v8.0.0
Published
Monitor mouse event.
Downloads
8
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
false
all 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,
},
}