Turns out that on most generic gamepads, they are not buttons, nor an axis, but a hat... (I used the app Gamepad Tester to list all the gamepad buttons).
So I'm wondering how to detect it. For starters, is a hat a POV?
I tried joyGetPOV, and after some search I found that bit of code in ChuckieEgg.zgeproj.
(Maybe we should add some explanations in the ZGE's help regarding the use of joyGetPOV?)
Code: Select all
float pov=joyGetPOV(0);
if(pov != -1 ) {
const int range=45;
if( (pov>= 90-range) && (pov<=90+range) )
buttons |= BUTTON_RIGHT;
else if( (pov>=270-range) && (pov<=270+range) )
buttons |= BUTTON_LEFT;
if( (pov>= 0-range) && (pov<=0+range) )
buttons |= BUTTON_UP;
else if( (pov>=180-range) && (pov<=180+range) )
buttons |= BUTTON_DOWN;
}
What could it be, then?