1.3.0 • Published 6 years ago

input.js v1.3.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Input States

Update input states every frame.

Install

npm install input.js

Usage

let input = new Input();

function animate() {
  if (input.keydown('w')) {
    console.log('key w down');
  }

  input.reset();
  requestAnimationFrame(animate);
}
requestAnimationFrame(animate);

Documentation

TODO

  • options
    • lock-filter (a filter function to decide if enter the lock state)
  • api
    • installTouches()
  • extensions
    • input.mouseclick(name, downupSpan, dragDistance)
    • input.mouseclicks(name, clickCount, downupSpan, clickSpan, dragDistance)
    • input.keyclick(name, downupSpan)
    • input.keyclicks(name, clickCount, downupSpan, clickSpan)

License

MIT © 2017 Johnny Wu

1.3.0

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

7 years ago

1.1.7

7 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago