A library for getting events from the Looking Glass buttons.
npm install holoplay-gamepadholoplay-gamepad
--------------------
A JavaScript library for listening to button press events from a Looking Glass display.
javascript
var gamepad = new HoloPlayGamePad();
gamepad.on(eventName, callback);
`$3
`javascript
//Game loop
function WatchForInput(){
gamepad.tick();
// Setup a callback for the next animation tick.
requestAnimationFrame(WatchForInput);
}
WatchForInput()
`Events
$3
To listen to all the buttons, the callback is passed the name of the button
* buttonDown - Triggered once when the button is pressed
* buttonPressed - Triggered on each tim
* buttonUp
$3
Each button also has their own callback event.
#### SQUARE
* squareDown
* squarePressed
* squareUp
#### LEFT
* leftDown
* leftPressed
* leftUp
#### RIGHT
* rightDown
* rightPressed
* rightUp
#### CIRCLE
* circleDown
* circlePressed
* circleUpExample
`html
Pressing:
`Try the example yourself:
`bash
git clone https://github.com/jaxzin/holoplay-gamepad.git
yarn install
grunt install
start/open index.html
``