AndersMalmgren / FreePIE

Programmable Input Emulator
644 stars 144 forks source link

Question: how to invert the right stick of an xbox360 controller? #186

Closed EricCreusen closed 4 years ago

EricCreusen commented 4 years ago

I'm trying to play a game that does not support inverted camera, so I'd like to invert the right analog stick of an xbox360 controller.

So far I've tried this script:

xbox360[0].rightStickX = -1 * xbox360[0].rightStickX xbox360[0].rightStickY = -1 * xbox360[0].rightStickY

However, that gives me the error:

can't assign to read-only property rightStickX of type 'XBox360PluginGlobal'

I see no update method, or setRightStick methods available in the xbox360 structure, so I'm unsure how to proceed.

How can I invert the right stick of an xbox controller?

Thanks in advance.

AndersMalmgren commented 4 years ago

Xbox 360 is a read only plugin. You can send the inpur through vjoy which outputs virtual joysticks

EricCreusen commented 4 years ago

Great, I'll give that a try this evening. Thanks for the quick reply and showing me which direction to go.

EricCreusen commented 4 years ago

I've had a look at the vJoy documentation, and it seems to only support a single analog stick. Since the xbox360 controller has two sticks, it seems I'm unable to map both analog sticks to the vJoy. I would appreciate any suggestions on how to proceed.

AndersMalmgren commented 4 years ago

You can use the rotation axis for that. Accesible through freepie

vJoy[0].rx

EricCreusen commented 4 years ago

Thanks!