forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Press two buttons?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
nikocronaldo



Joined: 24 Feb 2008
Posts: 31

PostPosted: Sun Mar 16, 2008 7:06 am    Post subject: Press two buttons? Reply with quote

if i want press two buttons to make a function,what do I put?
i saw this but it only works a button,i want the two buttons.
Code:

if ((pad.Buttons & PSP_CTRL_START && pad.Buttons & PSP_CTRL_CROSS))


what do I do?
Back to top
View user's profile Send private message
pspZorba



Joined: 22 Sep 2007
Posts: 156
Location: NY

PostPosted: Sun Mar 16, 2008 7:41 am    Post subject: Reply with quote

if (pad.Buttons &(PSP_CTRL_START| PSP_CTRL_CROSS) )
_________________
--pspZorba--
NO to K1.5 !
Back to top
View user's profile Send private message
nikocronaldo



Joined: 24 Feb 2008
Posts: 31

PostPosted: Sun Mar 16, 2008 8:47 am    Post subject: Reply with quote

it doesn't work,or work START,or work CROSS.
thanks you.
Back to top
View user's profile Send private message
crazyc



Joined: 17 Jun 2005
Posts: 410

PostPosted: Sun Mar 16, 2008 9:39 am    Post subject: Reply with quote

if ((pad.Buttons & (PSP_CTRL_START|PSP_CTRL_CROSS)) == (PSP_CTRL_START|PSP_CTRL_CROSS))
Back to top
View user's profile Send private message
pspZorba



Joined: 22 Sep 2007
Posts: 156
Location: NY

PostPosted: Sun Mar 16, 2008 9:49 am    Post subject: Reply with quote

oups, I do always the same mistake ;-)

if ((currentPad.Buttons &PSP_CTRL_START)&&(currentPad.Buttons& PSP_CTRL_CROSS) )
_________________
--pspZorba--
NO to K1.5 !
Back to top
View user's profile Send private message
Art



Joined: 09 Nov 2005
Posts: 647

PostPosted: Sun Mar 16, 2008 1:08 pm    Post subject: Reply with quote

or:
Code:

if (currentPad.Buttons &PSP_CTRL_START) {
// start is pressed
if (currentPad.Buttons &PSP_CTRL_CROSS) {
// start and cross are pressed
}
}

not the sort of thing that belongs here really.
_________________
If not actually, then potentially.
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sun Mar 16, 2008 4:33 pm    Post subject: Reply with quote

Yeah. All you're doing here is testing if two bits in an unsigned integer are both set. If you can't already do that, you probably need some remedial C lessons, which we don't do here.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
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