Page 1 of 1

Some questions concerning the generic joystick pluign

Posted: Mon Mar 02, 2015 4:05 pm
by Jabberwock
Is there any specific reason why the generic joystick plugin reports the raw data instead of DX ones? This not only makes setting up tedious, but also does not allow to use calibration and deadzone settings done in the system. Practically any game or program using game controllers assumes that they are properly calibrated and set up in the system...

Also, would it be possible to address the controllers by their names as seen in the Game Controllers window and not by number? Due to various reasons I often rearrange my controller connections, which makes it difficult to trace the numbering used in the scripts...

Re: Some questions concerning the generic joystick pluign

Posted: Wed Mar 04, 2015 3:42 am
by CyberVillain
It uses the DirectX api to access the data, to my knowledge it shuld read the data like any other game or software would.

https://github.com/AndersMalmgren/FreeP ... gin.cs#L16

It could be possible with a rewrite,but the name is not unique, if you have two controllers of the same type they will get same name (I think)

Re: Some questions concerning the generic joystick pluign

Posted: Wed Mar 04, 2015 4:10 am
by Jabberwock
CyberVillain wrote:It uses the DirectX api to access the data, to my knowledge it shuld read the data like any other game or software would.
No, it does not seem to be true. If you use a program like DXTweak2:

Image

you can see two kinds of values: DX and raw ones. The raw ones may have very different values, they might get jitter on older analog hardware, etc. Beside you see DX values: they are normalized between +-32767 for each axis, they have applied deadzone and the have applied response curve. These are the data that are used by games, so that any calibration done in the system is actually applied in the games.
It could be possible with a rewrite,but the name is not unique, if you have two controllers of the same type they will get same name (I think)
That is true. Still, I think it would be easier to reference the first controller with the name (and just grab the other one(s) if the first is not working) than modify the code each time the configuration changes. This would be an alternate way to reference the controllers anyway.

Re: Some questions concerning the generic joystick pluign

Posted: Wed Mar 04, 2015 4:25 am
by Jabberwock
I see now that the values are ranged between -1000 and 1000. I am not sure why, though.

Re: Some questions concerning the generic joystick pluign

Posted: Wed Mar 04, 2015 5:30 am
by CyberVillain
We read Direct input data not raw data. I cant see in the API that you can read raw data from the Dircect input interface

Re: Some questions concerning the generic joystick pluign

Posted: Wed Mar 04, 2015 5:39 am
by Jabberwock
CyberVillain wrote:We read Direct input data not raw data. I cant see in the API that you can read raw data from the Dircect input interface
I know that now, I did not notice that it gets reconverted to -1000,1000 range. I was asking about this as I need to rerange it again for all axes for vjoy. I mean it would make more sense for me to write:

vJoy[0].x = joystick[0].x

than

vJoy[0].x = map_range(joystick[0].x, -1000, 1000, -32767, 32767)

but I can live with that.

Re: Some questions concerning the generic joystick pluign

Posted: Wed Mar 04, 2015 5:50 am
by CyberVillain
You can also use setRange(int lowerRange, int upperRange) on the joystick