EverNewJoy/UE4GamepadUMG

Changing the code to use the Right Analogue Stick to move cursor?

kylehardy opened this issue · 1 comments

How would someone change the Plugin to use the Right Analogue stick to move cursor?

Courtesy of Sam.1 from the Unreal Forums.

For those looking at how to change which analogue stick the input is taken from, in GameAnalogCursor.cpp line 136...

//grab the cursor acceleration
const FVector2D AccelFromAnalogStick = GetAnalogCursorAccelerationValue(GetAnalogValues(), DPIScale);

GetAnalogValues() is the function which gets the stick input, and it can take an argument which is the stick to read, EAnalogStick. It defaults to EAnalogStick::Left, and I'm guessing because its such a common use case this code doesn't worry about the possibility of changing that. I needed to, and I see a few of you do too, so if you add an argument in here you can change the line to use a different stick...

//grab the cursor acceleration
const FVector2D AccelFromAnalogStick = GetAnalogCursorAccelerationValue(GetAnalogValues([B]EAnalogStick::Right[/B]), DPIScale);