hey dudes..
i am trying to write a freePIE script to use the trackIR to emulate the moueswheel.
basically i want to lean in and make the wheel scroll up, lean out and the wheel goes down.. pretty simple, but im a plebe.
here is a script written for the hydra that achieves the same thing, but by spinning the thumbstick in a circle..
can anyone modify it for my purposes?
global scrollSensitivity
global scrolling
global scrollPrevPos
global scrollDiff
global scrollDiffMagnitude
L = 0
R = 1
def applyHydraSide():
global L, R
if(hydra[0].side == "L"):
L = 0
R = 1
if(hydra[0].side == "R"):
L = 1
R = 0
def updateScrollPrevPos():
global scrollPrevPos
scrollPrevPos = hydra[R].roll
def startScrolling():
global scrolling
updateScrollPrevPos()
scrolling = True
def stopScrolling():
global scrolling
scrolling = False
def scroll():
global scrollDiff, scrollDiffMagnitude, scrollSensitivity
scrollDiff = hydra[R].roll - scrollPrevPos
scrollDiffMagnitude = scrollDiff * scrollSensitivity
if (scrollDiffMagnitude > 1.0 or scrollDiffMagnitude < -1.0):
mouse.wheel = scrollDiffMagnitude
updateScrollPrevPos()
def update():
global scrollSensitivity, scrolling
applyHydraSide()
if scrolling:
if hydra[R].one:
scroll()
else:
stopScrolling()
else:
if hydra[R].one:
startScrolling()
if starting:
applyHydraSide()
scrollSensitivity = 5
scrolling = False
scrollPrevPos = 0.0
scrollDiff = 0.0
scrollDiffMagnitude = 0.0
update()
i am trying to write a freePIE script to use the trackIR to emulate the moueswheel.
basically i want to lean in and make the wheel scroll up, lean out and the wheel goes down.. pretty simple, but im a plebe.
here is a script written for the hydra that achieves the same thing, but by spinning the thumbstick in a circle..
can anyone modify it for my purposes?
global scrollSensitivity
global scrolling
global scrollPrevPos
global scrollDiff
global scrollDiffMagnitude
L = 0
R = 1
def applyHydraSide():
global L, R
if(hydra[0].side == "L"):
L = 0
R = 1
if(hydra[0].side == "R"):
L = 1
R = 0
def updateScrollPrevPos():
global scrollPrevPos
scrollPrevPos = hydra[R].roll
def startScrolling():
global scrolling
updateScrollPrevPos()
scrolling = True
def stopScrolling():
global scrolling
scrolling = False
def scroll():
global scrollDiff, scrollDiffMagnitude, scrollSensitivity
scrollDiff = hydra[R].roll - scrollPrevPos
scrollDiffMagnitude = scrollDiff * scrollSensitivity
if (scrollDiffMagnitude > 1.0 or scrollDiffMagnitude < -1.0):
mouse.wheel = scrollDiffMagnitude
updateScrollPrevPos()
def update():
global scrollSensitivity, scrolling
applyHydraSide()
if scrolling:
if hydra[R].one:
scroll()
else:
stopScrolling()
else:
if hydra[R].one:
startScrolling()
if starting:
applyHydraSide()
scrollSensitivity = 5
scrolling = False
scrollPrevPos = 0.0
scrollDiff = 0.0
scrollDiffMagnitude = 0.0
update()