1

I have two different game controllers, and I've been using joyGetPosEx (Windows API) to get information from them. They each have buttons with the same physical labels, but some of those buttons have different bit values (as returned by joyGetPosEx when the buttons are pushed). This surprised me, because they both claim to be PS3-compatible.

For example, they both have the "shape" buttons - a triangle, a circle, an X, and a square. But on one controller (made by "Snakebyte"), those buttons have the following bit values according to joyGetPosEx:

Triangle = 1
Circle = 2
X = 4
Square = 8

While on the other (made by "Rock Candy"), they have:

Triangle = 8
Circle = 4
X = 2
Square = 1

The other difference is that 4096 is DPad Up on the Snakebyte and Home on the Rock Candy, and 8192, 16384, and 32768 are the other DPad directions on the Snakebyte and nothing on the Rock Candy. The Rock Candy's DPad buttons don't have bit values (though they do set the POV just the same as the Snakebyte), and the Snakebyte's Home button doesn't have a bit value.

All other bits, from 16 to 2048, match up between the two controllers.

So, how am I supposed to know what bit corresponds to what button on an arbitrary controller? Or at least an arbitrary "PS3 compatible" controller. I had naively imagined that due to the fact they're supposedly "PS3 compatible", they would follow some standard mapping of bits and buttons.

Bob Vesterman
  • 1,127
  • 1
  • 11
  • 31
  • You probably just need to calibrate the joysticks through the Game Controllers control panel. – Jonathan Potter Jul 15 '14 at 19:28
  • Jonathan Potter, thanks, but that doesn't seem to give me a way to control the mapping of bits to buttons. It seems to only let me calibrate the axes, and view which button is which. – Bob Vesterman Jul 15 '14 at 21:03
  • You'd combine that with a mapping function in your own software. I.E. I doubt there is any "standard" for joystick buttons, I'd say it's up to the user to map the hardware to virtual button IDs and the game/app to match the IDs to functions. Just my impression of it anyway. – Jonathan Potter Jul 15 '14 at 21:16
  • I understand that there wouldn't be any standard mapping for something like "right trigger shoots your main weapon", but certainly for a "PS3 compatible" controller there must be a way to know what bit corresponds to "right trigger"? How else would the joystick work on an actual PS3 if there's no way to know which bit corresponds to which physical button? – Bob Vesterman Jul 15 '14 at 21:27
  • Maybe the PS3 has some way of interrogating the joystick that doesn't happen under Windows? These controllers aren't designed for PCs after all. – Jonathan Potter Jul 15 '14 at 22:21

0 Answers0