Forgot to note about the .listen() function, whoops

This commit is contained in:
Ryan McGrath 2011-07-10 08:03:47 -04:00
parent 834d960243
commit 72921181bd

View file

@ -38,6 +38,8 @@ wiimote.when('pressed_a', function() {
wiimote2.when('pressed_a', function() {
alert('Wiimote #2 pressed the A Button!');
});
Wii.listen();
```
@ -66,6 +68,12 @@ var wiimote = new Wii.Remote(1, {horizontal: false}); // Vertical controls
wiimote.opts.horizontal = true; // Change to horizontal scheme.
```
The final important piece is to start the Wii-event loop; this manages the event dispatcher internally. To do this, simply...
``` javascript
Wii.listen();
```
You can listen for the following events on all controllers:
- **pressed_up** - The up button was pressed.