Code: Select all
def update():
#define globals
global lastX
global lastY
global cursorScale
#bind left mouse to trigger button
#Right mouse to Move button
#Middle mouse to Square
mouse.leftButton = joystick[0].getDown(20)
mouse.rightButton = joystick[0].getDown(19)
mouse.middleButton = joystick[0].getDown(15)
#Mouse movement using Gryoscope
mouse.deltaX = -1 * (freePieIO[0].yaw) * 2
mouse.deltaY = -1 * (freePieIO[0].pitch) * 2
if starting:
lastX = freePieIO[0].x
lastY = freePieIO[0].y
cursorScale = 10
freePieIO[0].update += update
Code: Select all
def update():
#define globals
global cursorScale
#bind left mouse to trigger button
#Right mouse to Move button
#Middle mouse to Square
mouse.leftButton = joystick[0].getDown(20)
mouse.rightButton = joystick[0].getDown(19)
mouse.middleButton = joystick[0].getDown(15)
#Mouse movement using Gryoscope
mouse.deltaX = -1 * filters.delta(filters.deadband(freePieIO[0].yaw * 50, 10))
mouse.deltaY = -1 * filters.delta(filters.deadband(freePieIO[0].yaw * 50, 10))
if starting:
cursorScale = 10
freePieIO[0].update += update
Unfortunately, because I do not want that behavior (I want the mouse speed to be simply proportional to the angle you are rotating at for vr uses) I need to modify the code. The problem is that I'm fairly new to freepie and programming in general (I'm at the second month of my programming class) and I'm pretty unsure how to do this and I would like to have some help/tips/similar example code.
Finally please forgive my bad english and thanks for anything you can provide
links:
Psmoveservice driver :https://github.com/cboulay/PSMoveService
Psmovefreepiebridge (the program that give a freepie output) : https://bitbucket.org/hawkinse/psmovefreepiebridge