| View previous topic :: View next topic |
| Author |
Message |
nikocronaldo
Joined: 24 Feb 2008 Posts: 31
|
Posted: Sun Mar 16, 2008 7:06 am Post subject: Press two buttons? |
|
|
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 |
|
 |
pspZorba
Joined: 22 Sep 2007 Posts: 156 Location: NY
|
Posted: Sun Mar 16, 2008 7:41 am Post subject: |
|
|
if (pad.Buttons &(PSP_CTRL_START| PSP_CTRL_CROSS) ) _________________ --pspZorba--
NO to K1.5 ! |
|
| Back to top |
|
 |
nikocronaldo
Joined: 24 Feb 2008 Posts: 31
|
Posted: Sun Mar 16, 2008 8:47 am Post subject: |
|
|
it doesn't work,or work START,or work CROSS.
thanks you. |
|
| Back to top |
|
 |
crazyc
Joined: 17 Jun 2005 Posts: 410
|
Posted: Sun Mar 16, 2008 9:39 am Post subject: |
|
|
| if ((pad.Buttons & (PSP_CTRL_START|PSP_CTRL_CROSS)) == (PSP_CTRL_START|PSP_CTRL_CROSS)) |
|
| Back to top |
|
 |
pspZorba
Joined: 22 Sep 2007 Posts: 156 Location: NY
|
Posted: Sun Mar 16, 2008 9:49 am Post subject: |
|
|
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 |
|
 |
Art
Joined: 09 Nov 2005 Posts: 647
|
Posted: Sun Mar 16, 2008 1:08 pm Post subject: |
|
|
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 |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Sun Mar 16, 2008 4:33 pm Post subject: |
|
|
| 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 |
|
 |
|