1.3.0 • Published 7 years ago

input.js v1.3.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 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

7 years ago

1.2.3

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.7

8 years ago

1.1.6

8 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago