xoutput mouse steering

Official forum for open source FreePIE discussion and development.
Post Reply
PCGamer88
One Eyed Hopeful
Posts: 17
Joined: Sun Nov 15, 2015 1:56 pm

xoutput mouse steering

Post by PCGamer88 »

Hello,,

I'm looking for a script which allows Xoutput mouse steering.
I have a vjoy to xoutput rewrote which also works so far.
Unfortunately the steering is not the best, since the steering is very slow and I have to move the mouse very far to reasonably
It also does not help increase the mouse sensitivity in the script, you hardly notice anything of it
Do you have a tip which is the problem in the script, or is there even one?

Code: Select all

if starting:    
    system.setThreadTiming(TimingTypes.HighresSystemTimer)
    system.threadExecutionInterval = 5
    def calculate_rate(max, time):
        if time > 0:
            return max / (time / system.threadExecutionInterval)
        else:
            return max

    int32_max = (2 ** 14) - 1
    int32_min = (( 2** 14) * -1) + 1
    
    #xoutput[0].lx = int32_min
    # =============================================================================================
    # //////////////////////////////////////// SETTINGS ///////////////////////////////////////////
    # =============================================================================================
    # Mouse settings
    # =============================================================================================
    # Higher SCR = Smoother/Slower Response | Lower SCR = Harder/Quicker Response
    # With the game's built in steering settings, there's no need to change the scr value
    # SCR's effects can be felt better with arcade style racing games
    # =============================================================================================
    global mouse_sensitivity, sensitivity_center_reduction
    mouse_sensitivity = 50
    sensitivity_center_reduction = 0.8
    # =============================================================================================
    # Steering settings7
    # =============================================================================================
    global steering, steering_max, steering_min, steering_center_reduction    
    # Init values, do not change
    steering = 0.0
    steering_max = float(int32_max)
    steering_min = float(int32_min)
    steering_center_reduction = 0.5
# =================================================================================================
# Steering logic
# =================================================================================================
if mouse.wheelUp:
   steering = 0.0
if steering > 0:
    steering_center_reduction = sensitivity_center_reduction ** (1 - (steering / steering_max))
elif steering < 0:
    steering_center_reduction = sensitivity_center_reduction ** (1 - (steering / steering_min))
steering = steering + ((float(mouse.deltaX) * mouse_sensitivity) / steering_center_reduction)
if steering > steering_max:
    steering = steering_max
elif steering < steering_min:
    steering = steering_min

xoutput[0].lx = int(round(steering))
Best regards
PCGamer
Post Reply

Return to “FreePIE”