hodka
08-12-2014, 04:28 AM
Hi,
I am using the PPT Wand 2014 using the "viz_wand_2014.py" included in Vizard 5.
I can easily detect whether a button is pressed using the following code:
ppt_wand = viz_wand_2014.add("localhost",3)
def wand_test():
if ppt_wand.isButtonDown(6):
print "-----"
print viz.tick()
print viz.getFrameTime()
vizact.ontimer(0,wand_test)
However, I have the problem that the timing is locked to the frame rate of the display. In order to aquire more accurate reaction time estimates, it would be great not to be restricted to the frame rate. I tried using the threading.Timer to call the wand_test function more frequently but it also returned the button state only once every frame.
Is there a way to receive a timestamp of when the button was pressed or have a callback function being called once the button is pressed without being restricted to the frame rate?
I am using the PPT Wand 2014 using the "viz_wand_2014.py" included in Vizard 5.
I can easily detect whether a button is pressed using the following code:
ppt_wand = viz_wand_2014.add("localhost",3)
def wand_test():
if ppt_wand.isButtonDown(6):
print "-----"
print viz.tick()
print viz.getFrameTime()
vizact.ontimer(0,wand_test)
However, I have the problem that the timing is locked to the frame rate of the display. In order to aquire more accurate reaction time estimates, it would be great not to be restricted to the frame rate. I tried using the threading.Timer to call the wand_test function more frequently but it also returned the button state only once every frame.
Is there a way to receive a timestamp of when the button was pressed or have a callback function being called once the button is pressed without being restricted to the frame rate?