I wrote this script to control a driving game with my mouse:
- Horizontal mouse controls the steer (middle mouse for auto-center).
- Downward Vertical mouse, while holding right button, controls the gas.
- Upward Vertical mouse, while holding left button, controls the brake.
Code: Select all
from System import Int16
if starting:
x = 0
y = 0
z = 0
sensibilidadX = 50
sensibilidadY = 100
sensibilidadZ = 100
x += mouse.deltaX * sensibilidadX
if mouse.middleButton:
x = 0
if mouse.rightButton:
y += mouse.deltaY * sensibilidadY
else:
y = 0
if mouse.leftButton:
z -= mouse.deltaY * sensibilidadZ
else:
z = 0
if (x > Int16.MaxValue):
x = Int16.MaxValue
elif (x < -Int16.MaxValue):
x = -Int16.MaxValue
if (y > Int16.MaxValue):
y = Int16.MaxValue
elif (y < 0):
y = 0
if (z > Int16.MaxValue):
z = Int16.MaxValue
elif (z < 0):
z = 0
vJoy[0].x = x
vJoy[0].y = y
vJoy[0].z = z
diagnostics.watch(vJoy[0].x)
diagnostics.watch(vJoy[0].y)
diagnostics.watch(vJoy[0].z)
Is it possible with freePIE (or it is planned) to asign the mouse wheel? or the 4th and 5th mouse buttons?
Thanks