Skip to content

apexearth/user-input-mouse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published