anys-web-plugin-monitor-mouse-event

8.0.0 • Public • Published

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,
    },
}

Readme

Keywords

none

Package Sidebar

Install

npm i anys-web-plugin-monitor-mouse-event

Weekly Downloads

2

Version

8.0.0

License

Apache-2.0

Unpacked Size

34.5 kB

Total Files

6

Last publish

Collaborators

  • tangshuang