Skip to content

Instantly share code, notes, and snippets.

@juuba
Created June 3, 2015 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juuba/6087a8a2444ceda8d11f to your computer and use it in GitHub Desktop.
Save juuba/6087a8a2444ceda8d11f to your computer and use it in GitHub Desktop.
FreePIE + vJoy script for CH Combatstick wheel-axis
# FreePIE + vJoy script for CH Combatstick Wheel
# from https://www.reddit.com/r/hoggit/comments/384bkn/ch_fighterstick_throttle_wheel_has_jitter_any_fix/crspxso
range = 1000 # Not sure if this is ever not 1000 in FreePIE. Set to maximum value of "input"
deadzone = 16 # Deadzone relative to "range" above. With my X-55 rotary, the granularity was 8, so at 16 this gives 2 units of deadzone.
input = joystick[2].z # Change this to whatever joystick and axis is your slider
if starting:
deadzoneStart = 0
if input > (deadzoneStart + deadzone):
deadzoneStart = input - deadzone
elif input < deadzoneStart:
deadzoneStart = input
output = ((deadzoneStart + deadzone/2) * vJoy[0].axisMax)/(range - deadzone/2)
vJoy[0].slider = output
diagnostics.watch(output)
diagnostics.watch(input)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment