I want to give my game a gamepadsupport. So, today I wanted to work with that. First: Thank you Team for working over the Joystick library. With supporting more gamepadaxis it is better for games ^^
Now my Problem:
First of all, i tried my Joystick with games, all of that got no Problem with my Joystick, so my Joystick isn´t broken.
My Problem is, that the right Gamepad isn´t working with PB... digital Gamepad and left analog Gamepad is working, but not the right one.
This is a edited JoystickExample.pb - file, please give it a try. Just Switch this one
Code: Select all
Debug JoystickAxisX(0, 1, #PB_Relative)
Code: Select all
;
; ------------------------------------------------------------
;
; PureBasic - Joystick example file
;
; (c) 2001 - Fantaisie Software
;
; ------------------------------------------------------------
;
NbJoysticks = InitJoystick()
If NbJoysticks = 0
MessageRequester("Error", "No joysticks are availables.", 0)
End
EndIf
If OpenWindow(0, 100, 100, 300, 260, "PureBasic - Joystick Demo")
MessageRequester("Information", "This will test the joystick in a window.", 0)
x = WindowWidth(0)/2
y = WindowHeight(0)/2-20
Repeat
Repeat
Event = WindowEvent()
If Event = #PB_Event_CloseWindow : Quit = 1 : EndIf
Until Event = 0
Delay(20) ; a little delay (20 milli seconds -> 50 fps)
If ExamineJoystick(0)
x+JoystickAxisX(0)
y+JoystickAxisY(0)
If JoystickButton(0, 1)
MessageRequester("Info", "Button 1 has been pressed", 0)
EndIf
If JoystickButton(0, 2)
MessageRequester("Info", "Button 2 has been pressed", 0)
EndIf
Debug JoystickAxisX(0, 1, #PB_Relative)
If StartDrawing(WindowOutput(0)) ; Set the drawing output to our window
FrontColor(RGB(255,0,0)) ; Use the RED colour
Box(x, y, 10, 10) ; Draw a little box
StopDrawing() ;
EndIf
EndIf
Until Quit = 1
EndIf
End
Code: Select all
Debug JoystickAxisZ(0, 0, #PB_Relative)
Code: Select all
Debug JoystickAxisZ(0, 1, #PB_Relative)
This isn´t normal, or should it be this way?!

If this is normal, please move this Topic to related wishes. I want a second analog Gamepad with the number 1, not a unlogical Z-Axis
