mclang, on 01 March 2016 - 01:05 AM, said:

UCR could do mouse emulation also... You could do way more in UCR than you could in FreePIE, as freepie is limited in scope, whereas AutoHotkey (Which UCR is written in) is a full-blown language that you can basically do anything with.
Given the command GetKeyState() which can be used to read axis states (eg GetKeyState("2JoyX") ), which returns a value from 0 to 100 and SetAxisState(), which is a (simplified, purely for illustration purposes) command which sets the state of the output axis, then the code would look something like this:
out := 50 ; set output axis to start in the middle Loop { ; Get state of input - the Y axis on joystick 2 ax := GetKeyState("2JoyY") ; Subtract 50 from input axis (to convert to -50->+50 scale) and divide by 10 (to convert to -5 to +5 scale) ; 10 is an arbitrary divider - you could tweak it to alter the "sensitivity" of the throttle delta := (ax - 50) / 10 ; Change the current value of the output by the amount held in "delta" out := out + delta ; Ensure output values stay within valid range if (out > 100) out := 100 else if (out < 0) out := 0 ; Set new state of output axis SetAxisState(out) ; Sleep a bit to avoid chewing too much CPU - updates every 10ms are enough Sleep 10 }
In reality the code would be a little more complex (eg the input reports in the scale 0->100, and the output vJoy stick is in the range of 0->32767, so conversion between the two scales is needed - ie multiply by 327.67), but the core logic would be identical: Hold current value in a variable, then read the input stick, adjust current value of output according to the input, then set the output axis.
Edited by evilC, 01 March 2016 - 11:44 AM.