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 1, 2  Next
 
Post new topic   Reply to topic    WiiLi.org Forum Index -> WiiremoteJ
View previous topic :: View next topic  
Author Message
Cha0s
Site Admin


Joined: 17 Jan 2007
Posts: 468

Digg It
PostPosted: Sun Feb 24, 2008 4:58 pm    Post subject: WiiRemoteJ 1.3 Released

WiiRemoteJ 1.3 is out! Unfortunately, it doesn't yet have the updates to the IR sensor that I'd have hoped for (i.e. absolute positioning). It does fix some bugs and allow for users to create "fake" WiiRemotes for testing things (you could use this to write an event-generating program). It also allows user-customizable IR sensitivity settings. You can download it from the link the WiiRemoteJ tips sticky. If you have any comments, let me know here or via email.
_________________
Cha0s
Back to top
View user's profile Send private message
layertwothree



Joined: 24 Feb 2008
Posts: 4

Digg It
PostPosted: Mon Feb 25, 2008 4:02 pm    Post subject:

Hi Cha0s,

I am trying to create mock IRLight objects for testing. I noticed that the constructor only accepts integers for the x and y arguments. Yet, the getters getX() and getY() returns doubles which are percentages in the range 0.0 to 1.0 (and -1.0).

So is it the case that if I specify the integer x,y coordinates within the 1024x768 camera resolution, getX() and getY() will automagically convert them into percentages for me?

Thanks!

Jim
Back to top
View user's profile Send private message
Cha0s
Site Admin


Joined: 17 Jan 2007
Posts: 468

Digg It
PostPosted: Mon Feb 25, 2008 8:24 pm    Post subject:

Yes. Next release will have updated docs indicating this. Note that since 0 is an option, the actual range is 0 to 1023 for the X and 0 to 767 for the Y.
_________________
Cha0s
Back to top
View user's profile Send private message
Icon-C



Joined: 25 Feb 2008
Posts: 8

Digg It
PostPosted: Mon Feb 25, 2008 8:41 pm    Post subject:

Hi Chaos,

I am integrating the WiiMote in an existing Input Manager.
But I'm having a minor problem with the usage of the wasReleased method
of the ButtonEvent class.

I need to know when a button was just pressed (isPressed()) and when
the button was just released.

Code:

/**
    *
    * @param wrbe
    * @return Return 1 if button was pressed, 0 if button was released, -1 if
    *         no buttonstatus was found
    */
private int getWiimotePressStatus(WRButtonEvent wrbe) {
      if (wrbe.wasPressed(WRButtonEvent.A)) {
         System.out.println("Button A was pressed");
         return 1;
      } else if (wrbe.wasReleased(WRButtonEvent.A)) {
                        System.out.println("Button A was released");
         return 0;
      } else {
         return -1;
      }

   }


The problem is that I never get the "Button was released".
Do you have any idea what the problem could be?

Thanks
Back to top
View user's profile Send private message
Cha0s
Site Admin


Joined: 17 Jan 2007
Posts: 468

Digg It
PostPosted: Mon Feb 25, 2008 9:01 pm    Post subject:

Well, if you want to know when a button was just pressed, use wasPressed. isPressed fires repeatedly so long as the button is held down. Is that method being called from a listener? You see, wasPressed and wasReleased will only fire once for an instant. So if you're only getting events once in a while, you could easily miss them.
_________________
Cha0s
Back to top
View user's profile Send private message
Icon-C



Joined: 25 Feb 2008
Posts: 8

Digg It
PostPosted: Mon Feb 25, 2008 9:11 pm    Post subject:

Thanks for the quick response...

Yes, i am calling them from a listener, but it is quite strange that I can capture the wasPressed() every time but the wasReleased() doesn't seem to be caught, can you see any logic in this?
Back to top
View user's profile Send private message
Cha0s
Site Admin


Joined: 17 Jan 2007
Posts: 468

Digg It
PostPosted: Mon Feb 25, 2008 9:53 pm    Post subject:

What's the code in the listener method buttonInputReceived(...)?
_________________
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 1, 2  Next
Page 1 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