Some people (including me) have asked about creating virtual controllers and programming some unusual controller behavior here. I've been using vJoy and FreePIE recently and the solution is quite convenient. You can quickly script on a virtual controller to convert keyborad/mouse/whatever input, remap axes, do conditional logic or make other fancy stuff.
vJoy is a PPJoy-like driver that can create virtual game controllers. This driver is signed, so unlike PPJoy you can install it on 64bit Win7/8 without using test mode. It does not have any input generation function, so you'll need a "feeder" program do make it functional. This is where FreePIE comes in. The FreePIE Programmable Input Emulator is something that allows you to emulate different kinds of inputs with Python scripts. It supports vJoy natively. Just install both, create at least one virtual controller in vJoy and fire up FreePIE. The documentation is lacking tbh but it's still easy to get started.
This is what I use on my laptop for driving games that do not support mouse control. It also gives me independent steering sensitivity setting in LFS.
This one is for tristancliffe who asked for Sequential AND paddle shift script over one year ago. I know it's way too late, but it's still good as a demonstration.
If you're still on 32bit/XP and PPJoy does work without test mode, GlovePIE (more mature, but no vJoy support) will work in a similar fashion as FreePIE. You can also ignore FreePIE/GlovePIE and code your own vJoy/PPJoy feeder application if you like.
FFB can not pass through such a setup so don't do it on your wheel steering axis.
vJoy is a PPJoy-like driver that can create virtual game controllers. This driver is signed, so unlike PPJoy you can install it on 64bit Win7/8 without using test mode. It does not have any input generation function, so you'll need a "feeder" program do make it functional. This is where FreePIE comes in. The FreePIE Programmable Input Emulator is something that allows you to emulate different kinds of inputs with Python scripts. It supports vJoy natively. Just install both, create at least one virtual controller in vJoy and fire up FreePIE. The documentation is lacking tbh but it's still easy to get started.
This is what I use on my laptop for driving games that do not support mouse control. It also gives me independent steering sensitivity setting in LFS.
from System import Int16
if starting:
system.setThreadTiming(TimingTypes.HighresSystemTimer)
system.threadExecutionInterval = 5 # loop delay
max = Int16.MaxValue*0.5+2
min = -Int16.MaxValue*0.5+1
x = 0 # steering
senX = 3
y = min # throttle
z = min # brake
rx = min # clutch
ry = min # handbrake
senP = 1500
x += mouse.deltaX * senX
y += (1 if keyboard.getKeyDown(Key.D) else -1) * senP
z += (1 if keyboard.getKeyDown(Key.S) else -1) * senP
rx += (1 if keyboard.getKeyDown(Key.A) else -1) * senP
ry += (1 if mouse.middleButton else -1) * senP
if keyboard.getKeyDown(Key.LeftControl) and mouse.middleButton: # steering centering
x = 0
if (x > max):
x = max
elif (x < min):
x = min
if (y > max):
y = max
elif (y < min):
y = min
if (z > max):
z = max
elif (z < min):
z = min
if (rx > max):
rx = max
elif (rx < min):
rx = min
if (ry > max):
ry = max
elif (ry < min):
ry = min
vJoy[0].x = x
vJoy[0].y = y
vJoy[0].z = z
vJoy[0].rx = rx
vJoy[0].ry = ry
vJoy[0].setButton(0,int(mouse.leftButton))
vJoy[0].setButton(1,int(mouse.rightButton))
#vJoy[0].setButton(2,int(mouse.middleButton))
if mouse.wheelUp: # pit menu +
keyboard.setKeyDown(Key.RightArrow)
else:
keyboard.setKeyUp(Key.RightArrow)
if mouse.wheelDown: # pit menu -
keyboard.setKeyDown(Key.LeftArrow)
else:
keyboard.setKeyUp(Key.LeftArrow)
This one is for tristancliffe who asked for Sequential AND paddle shift script over one year ago. I know it's way too late, but it's still good as a demonstration.
# Using x axis on vJoy device 0 as desired throttle input.
# The real wheel is joystick 0 and throttle input is y axis. Ignition cut is button 10.
from System import Int16
if starting:
system.setThreadTiming(TimingTypes.HighresSystemTimer)
system.threadExecutionInterval = 5 # loop delay
max = Int16.MaxValue*0.5+2
min = -Int16.MaxValue*0.5+1
if joystick[0].getPressed(10):
vJoy[0].x = min # ignition cut
else:
vJoy[0].x = joystick[0].y # normal throttle
If you're still on 32bit/XP and PPJoy does work without test mode, GlovePIE (more mature, but no vJoy support) will work in a similar fashion as FreePIE. You can also ignore FreePIE/GlovePIE and code your own vJoy/PPJoy feeder application if you like.
FFB can not pass through such a setup so don't do it on your wheel steering axis.