Joystick Axis
- StarBootics
- Addict
- Posts: 984
- Joined: Sun Jul 07, 2013 11:35 am
- Location: Canada
Joystick Axis
Hello,
In the current Joystick library, we have nothing to get information about the 4th axis (most often the throttle or "R" axis)
It's a serious limitation for the moment.
Best regards
StarBootics
In the current Joystick library, we have nothing to get information about the 4th axis (most often the throttle or "R" axis)
It's a serious limitation for the moment.
Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
- Bananenfreak
- Enthusiast
- Posts: 519
- Joined: Mon Apr 15, 2013 12:22 pm
Re: Joystick Axis
What´s this 4th axis?
I don´t know how to use 3, because there´s X and Y or Z, because down- or upward is a button.
I don´t know how to use 3, because there´s X and Y or Z, because down- or upward is a button.
Re: Joystick Axis
On current game pads you have up to 6 axes:
X, Y, Z, R, U, V
http://team358.org/files/programming/Co ... apping.jpg
With Win-API it is possible to use all this axes, so you can use this incldue for example:
Joystick v1.0, Windows, 6 axes, 32 button, POV, deadzones
X, Y, Z, R, U, V
http://team358.org/files/programming/Co ... apping.jpg
With Win-API it is possible to use all this axes, so you can use this incldue for example:
Joystick v1.0, Windows, 6 axes, 32 button, POV, deadzones
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
- StarBootics
- Addict
- Posts: 984
- Joined: Sun Jul 07, 2013 11:35 am
- Location: Canada
Re: Joystick Axis
For a Joystick like this one :
X axis
Y axis
Z axis
Slider axis (Throttle)
Best regards
StarBootics
X axis
Y axis
Z axis
Slider axis (Throttle)
Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
Re: Joystick Axis
The stars came out!
They illustrate the main problem which is,
if the developers decided to extend support to include that range of inputs,
then you'd likely need to send the developers the actual stick to get it supported,
as there are so many configurations.
The actual standard can be found here and that seems to be what the team implemented for the last upgrade.
There is still significant variation within the implementations of the recently finalized standard.
Of course, the XBOX and PlayStation console variants are very popular,
but The Logitech Dual Action is my recommendation based on the information presented in this thread.
Characteristically, Microsoft keeps on changing the specs on their controllers.
For example the 360 controller <> XBone controller.
Sony on the other hand is a lot more reasonable and considerate.
In this area I feel the history needs to be examined to make a better evaluation for future plans.
Which type of controller(s) are being supported with the current mapping?
It would be nice to know.
Unfortunately for Logitech, and Sony, and most of the low end generic controller manufacturers,
it looks like the main 4 XBOX buttons (A B X Y) conform to the new standards.
Or is it the other way around?
That's a good example picture StarBootics. So is yours STARGÅTE.StarBootics wrote:
They illustrate the main problem which is,
if the developers decided to extend support to include that range of inputs,
then you'd likely need to send the developers the actual stick to get it supported,
as there are so many configurations.
The actual standard can be found here and that seems to be what the team implemented for the last upgrade.
There is still significant variation within the implementations of the recently finalized standard.
Of course, the XBOX and PlayStation console variants are very popular,
but The Logitech Dual Action is my recommendation based on the information presented in this thread.
Characteristically, Microsoft keeps on changing the specs on their controllers.
For example the 360 controller <> XBone controller.
Sony on the other hand is a lot more reasonable and considerate.
In this area I feel the history needs to be examined to make a better evaluation for future plans.
Which type of controller(s) are being supported with the current mapping?
It would be nice to know.
Unfortunately for Logitech, and Sony, and most of the low end generic controller manufacturers,
it looks like the main 4 XBOX buttons (A B X Y) conform to the new standards.
Or is it the other way around?
Keep it BASIC.
Re: Joystick Axis
I can acess to all buttons, joysticks and triggers in my xbox controller. Only have to select PAD in function -> JoystickAxisX(#Joystick [, Pad [, Mode]])
Example:
Is that what you mean?
Example:
Code: Select all
NbJoysticks = InitJoystick()
If NbJoysticks = 0
MessageRequester("Error", "No joysticks are availables.", 0)
End
EndIf
If OpenWindow(0, 100, 100, 300, 500, "PureBasic - Joystick Demo")
TextGadget(1,0,0,150,500,"")
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)
result.s=JoystickName(0)+#CRLF$
For f=1 To 16
result+"Botón "+Str(f)+": "+Str(JoystickButton(0,f))+#CRLF$
Next f
For f=0 To 2
result+"Eje X"+Str(f+1)+": "+JoystickAxisX(0,f,#PB_Relative)+#CRLF$
result+"Eje Y"+Str(f+1)+": "+JoystickAxisY(0,f,#PB_Relative)+#CRLF$
result+"Eje Z"+Str(f+1)+": "+JoystickAxisZ(0,f,#PB_Relative)+#CRLF$
Next f
SetGadgetText(1,result)
EndIf
Until Quit = 1
EndIf
End
[:: PB Registered ::]
Win10 Intel core i5-3330 8GB RAM Nvidia GTX 1050Ti
Win10 Intel core i5-3330 8GB RAM Nvidia GTX 1050Ti
- StarBootics
- Addict
- Posts: 984
- Joined: Sun Jul 07, 2013 11:35 am
- Location: Canada
Re: Joystick Axis
Hello everyone,
A command to get the information about the Hat Switch (8 states button) can be useful as well.
Best regards
StarBootics
A command to get the information about the Hat Switch (8 states button) can be useful as well.
Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
- Bananenfreak
- Enthusiast
- Posts: 519
- Joined: Mon Apr 15, 2013 12:22 pm
Re: Joystick Axis
@ Stargate:
As Saboteur said, this is already implemented. And there are only 2 axis!
@Starbootics:
Do you test it with a program before posting your request?
I´m sure you can use your Joystick. I only see 2 pads. One with 3 axis and one with 1 axis(?).
I don´t want to write a program for it, but you could use my Epos Worldeditor for it.
It supports up to 4 Joysticks. I think it´s in german, so do this "Datei --> Optionen --> Allgemein ---> Sprache" now choose English and restart the program.
Now go in Options and try your Joystick
EDIT: "Hat" is also a pad. It´s a digital pad (Digipad) with 9 states.
As Saboteur said, this is already implemented. And there are only 2 axis!
@Starbootics:
Do you test it with a program before posting your request?
I´m sure you can use your Joystick. I only see 2 pads. One with 3 axis and one with 1 axis(?).
I don´t want to write a program for it, but you could use my Epos Worldeditor for it.
It supports up to 4 Joysticks. I think it´s in german, so do this "Datei --> Optionen --> Allgemein ---> Sprache" now choose English and restart the program.
Now go in Options and try your Joystick
EDIT: "Hat" is also a pad. It´s a digital pad (Digipad) with 9 states.
Last edited by Bananenfreak on Sun Feb 01, 2015 9:01 am, edited 2 times in total.
- StarBootics
- Addict
- Posts: 984
- Joined: Sun Jul 07, 2013 11:35 am
- Location: Canada
Re: Joystick Axis
@Bananenfreak
You should take a look at http://wiki.libsdl.org/CategoryJoystick
Best regards
StarBootics
You should take a look at http://wiki.libsdl.org/CategoryJoystick
Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
- Bananenfreak
- Enthusiast
- Posts: 519
- Joined: Mon Apr 15, 2013 12:22 pm
Re: Joystick Axis
@StarBootics:
What should I read there? You should take a look at http://www.purebasic.com/documentation/ ... index.html
I don´t have a Joystick, but I´m sure your "Hat Switch" in PB is only a third pad. Did you test it?
What should I read there? You should take a look at http://www.purebasic.com/documentation/ ... index.html
I don´t have a Joystick, but I´m sure your "Hat Switch" in PB is only a third pad. Did you test it?