1.5.1 • Published 5 years ago

user-input v1.5.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

user-input

npm.io

User input tracking for keyboard, mouse, touch, and gamepad inputs.

Usage

NPM

Example

var input   = userInput()
    .withMouse()
    .withKeyboard()
    .withGamepad(0)
    .withTouch()

input.keyboard('A') === 0
// Press A
input.keyboard('A') === 1
    
input.mouse('mouse0') === 0
// Press Left Mouse Button
input.mouse('mouse0') === 1

// Get instances of gamepads, in rendering loops.
input.gamepad()

input.touches        // Current touches
input.changedTouches // Changed touches

// Clear keyboard & mouse values back to zero.
input.clear()

// Set values for testing
input.keyboard('A', 1)
input.mouse('mouse0', 1)
input.mouse('x', 500)

Tests

  • Mocha
    • Test functionality in Node.js
1.5.1

5 years ago

1.5.0

7 years ago

1.4.1

7 years ago

1.3.1

8 years ago

1.3.0

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago

0.0.2

8 years ago