Currently, this is my code:
Code: Select all
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.0
y = 0.0
sen = 25 # sensitivity
x += mouse.deltaX * sen
y += mouse.deltaY * sen
if (x > max):
x = max
elif (x < min):
x = min
if (y > max):
y = max
elif (y < min):
y = min
# Centering
if keyboard.getKeyDown(Key.LeftControl):
x = 0
y = 0
vJoy[1].x = x
vJoy[1].y = y
# Watch
diagnostics.watch(vJoy[1].x)
diagnostics.watch(vJoy[1].y)
Any clue?