WiiLi Wiki frontpage Include your post in the News Get links Hoteles Quito
WiiLi.org Forum Index WiiLi.org
a new revolution
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

WiiRemoteJ 1.3 Released
Goto page Previous  1, 2
 
Post new topic   Reply to topic    WiiLi.org Forum Index -> WiiremoteJ
View previous topic :: View next topic  
Author Message
Icon-C



Joined: 25 Feb 2008
Posts: 8

Digg It
PostPosted: 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
View user's profile Send private message
Cha0s
Site Admin


Joined: 17 Jan 2007
Posts: 493

Digg It
PostPosted: 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
View user's profile Send private message
Icon-C



Joined: 25 Feb 2008
Posts: 8

Digg It
PostPosted: 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 Shocked

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
View user's profile Send private message
Cha0s
Site Admin


Joined: 17 Jan 2007
Posts: 493

Digg It
PostPosted: Tue Feb 26, 2008 1:22 pm    Post subject:

Cool. Glad it's working. Smile
_________________
Cha0s
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    WiiLi.org Forum Index -> WiiremoteJ All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group