Home Forums PS2X PlayStation 2 Controller Library Support Forum Recognizing simultaneous key presses PS2X library Reply To: Recognizing simultaneous key presses PS2X library

#3157
Bill
Member

ps2x.ButtonDataByte() will return 2 bytes representing all the current buttons pressed.

You could use that to test multiple button presses at once.

 

Here is the bits in that word and what buttons they represent:

 

//These are our button constants
#define PSB_SELECT 0x0001
#define PSB_L3 0x0002
#define PSB_R3 0x0004
#define PSB_START 0x0008
#define PSB_PAD_UP 0x0010
#define PSB_PAD_RIGHT 0x0020
#define PSB_PAD_DOWN 0x0040
#define PSB_PAD_LEFT 0x0080
#define PSB_L2 0x0100
#define PSB_R2 0x0200
#define PSB_L1 0x0400
#define PSB_R1 0x0800
#define PSB_GREEN 0x1000
#define PSB_RED 0x2000
#define PSB_BLUE 0x4000
#define PSB_PINK 0x8000
#define PSB_TRIANGLE 0x1000
#define PSB_CIRCLE 0x2000
#define PSB_CROSS 0x4000
#define PSB_SQUARE 0x8000