user-input-mouse

    2.0.2 • Public • Published

    user-input-mouse

    Stores the latest state values received from mouse events.

    Install

    NPM

    Usage

    var mouse = window.mouseInput(document)
    

    When the user presses the left mouse button at coordinates (x100,y200), mouse would contain the following.

    {
        "x": 100,
        "y": 200,
        "mouse0": 1
    }
    

    When the user releases the left mouse button at (x110,y200), and then presses the right mouse button at (x200,y300), mouse would contain the following.

    {
        "x": 200,
        "y": 300,
        "mouse0": 0,
        "mouse2": 1
    }
    

    The values shown always represent the latest values received.

    Tests

    • Mocha
      • Test functionality in Node.js
      • npm test
    • User Test
      • Test functionality in browser.
      • npm run user-test

    Install

    npm i user-input-mouse

    DownloadsWeekly Downloads

    0

    Version

    2.0.2

    License

    MIT

    Unpacked Size

    5.23 kB

    Total Files

    5

    Last publish

    Collaborators

    • avatar