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.