Slick Forums

Discuss the Slick 2D Library
It is currently Fri May 24, 2013 9:24 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sun Apr 26, 2009 1:22 pm 
Offline

Joined: Sun Apr 26, 2009 1:09 pm
Posts: 11
Hi, I'm pretty new to slick (just started making a game last week) and I've run into a problem. When I check for controller input it keeps polling true for as long as the button (from a joystick) is pressed. This seems odd given that the name of it is isButtonPressed, not isButtonDown (which doesn't exist). So I'm not sure how to get functionality like isMouseDown or isKeyDown. Any suggestions for manually getting that functionality? Should I just use an if() statement that checks for a boolean flag that gets set/unset when the button is released? Has anyone else ran into this problem?

I'm not sure if this should be a request for functionality or not so I put it in help.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 26, 2009 6:34 pm 
Offline
Site Admin
User avatar

Joined: Thu Jan 01, 1970 12:00 am
Posts: 3143
It's a bit of bad naming I'm afraid. isButtonPressed() is actually like isKeyDown(). The equivilent to isKeyPressed() is isControlPressed(). RFE should be for consistent naming.

Kev


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 26, 2009 7:15 pm 
Offline

Joined: Sun Apr 26, 2009 1:09 pm
Posts: 11
Thanks so much! I don't know how I missed the other one. I'd be all for consistent naming, just so long as it's mentioned somewhere that there was a change so I know to go back and fix it if/when its changed.

EDIT: I guess the other request I would have would be for isControlPressed(int index, int control) similar to isButtonPressed(int index, int control)


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 24, 2009 12:46 pm 
Offline
Site Admin
User avatar

Joined: Thu Jan 01, 1970 12:00 am
Posts: 3143
Added isControlPressed(int button, int controller).

In SVN.

Kev


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group