| View previous topic :: View next topic |
| Author |
Message |
Icon-C
Joined: 25 Feb 2008 Posts: 8
Digg It |
Posted: Mon Feb 25, 2008 10:16 pm Post subject: |
|
|
This is my ButtonInputReceived method
| Code: |
public void buttonInputReceived(WRButtonEvent wrbe) {
GameAction gameAction = getWiimoteButtonAction(wrbe);
if (gameAction != null) {
switch (getWiimotePressStatus(wrbe)) {
case 0:
gameAction.release();
break;
case 1:
gameAction.press();
break;
case -1:
// error retrieving buttonpressstatus
}
}
}
|
|
|
| Back to top |
|
 |
Cha0s Site Admin
Joined: 17 Jan 2007 Posts: 493
Digg It |
Posted: Mon Feb 25, 2008 11:13 pm Post subject: |
|
|
Hrmm... Have you checked to see that gameAction is not null? Perhaps something in the method that creates gameAction returns a null gameAction when the button is released.
I just tested wasReleased myself, and it worked flawlessly, so I'm not sure what the problem could be. If you want, I can take a look at the code directly. If you decide to do that, just email it to me (my email is in the WiiRemoteJ license).
One other thing you could try is putting System.out.println(wrbe.wasReleased(WRButtonEvent.A)); at the top of your buttonInputReceived method to see if the events are coming through at all. _________________ Cha0s |
|
| Back to top |
|
 |
Icon-C
Joined: 25 Feb 2008 Posts: 8
Digg It |
Posted: Tue Feb 26, 2008 12:38 pm Post subject: |
|
|
Just turned on my computer again today, and without changing anything to the code everything works like a charm now
Thank you for your help, and even more for the WiiremoteJ library. I have been able to port the Bob Summers WiiDrum to Java without any problem and am currently working on a Java game with the wiimote controller. |
|
| Back to top |
|
 |
Cha0s Site Admin
Joined: 17 Jan 2007 Posts: 493
Digg It |
Posted: Tue Feb 26, 2008 1:22 pm Post subject: |
|
|
Cool. Glad it's working.  _________________ Cha0s |
|
| Back to top |
|
 |
|