Forgot to note about the .listen() function, whoops
This commit is contained in:
parent
834d960243
commit
72921181bd
1 changed files with 8 additions and 0 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue