Hello guys,
This is my code:
If Btn$ = "UP" and (GetRawJoystickPOV(JoyStick,0)=0 or GetRawJoystickPOV(JoyStick,0)= 31500 or GetRawJoystickPOV(JoyStick,0)= 4500 )
State = 1
ElseIf Btn$ = "DP" and (GetRawJoystickPOV(JoyStick,0)= 18000 or GetRawJoystickPOV(JoyStick,0)= 13500 or GetRawJoystickPOV(JoyStick,0)= 22500)
State = 1
ElseIf Btn$ = "LP" and (GetRawJoystickPOV(JoyStick,0)= 27000 or GetRawJoystickPOV(JoyStick,0)= 31500 or GetRawJoystickPOV(JoyStick,0)= 22500)
State = 1
ElseIf Btn$ = "RP" and (GetRawJoystickPOV(JoyStick,0)= 9000 or GetRawJoystickPOV(JoyStick,0)= 13500 or GetRawJoystickPOV(JoyStick,0)= 4500)
State = 1
Elseif FenBtnStr.find(Btn$)>-1
I figured out, that POV gets more or less the degree ° of the position from the coolie hat. So 0° is UP, 90 is RIGHT, but is saved as 9000, so all angles multiplied by 100.
It works fine. But I have a problem, if my Gamepad or Joystick does not have a coolie hat. Because it would not return -1 or something like that, but 0 (ZERO). So I will get UP as a result.
I can try it via the Joystick-Name but Bluetooth-Controller are registered in Windows, but could be off.
It works fine, if my gamepad has a cooli had and is wired or on. Than I will get a -1 if no direction is pushed.
And getting the Joystick-Name does not work under Android and is not complete, because some different gamepads could share the same generic names.
So how can I implement the coolie hat? Why I need it in the first place? On some gamepads the D-pad acts like a JoystickY and JoystickX and on some gamepads the D-pad is a coolie had and on some the D-pad are 4 or 8 seperate buttons.
But I have to test the coolie hat for that and if this specific joystick does not have one, I want to get a -1 and not a 0.
Or is there another chance, to proof, if there is a coolie had? Maybe my approach is completly wrong. Thanks for help.