WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   manually set mouse cursor position (https://forum.worldviz.com/showthread.php?t=6182)

sskalicky 08-17-2018 09:28 AM

manually set mouse cursor position
 
Hello,

I'm designing an experiment where the user picks an object with the mouse to initiate a trial. I'd like to reset the mouse cursor to the center of the screen before the start of a new trial, but I can't seem to find a way to set the position. Any help?

Jeff 08-18-2018 08:21 AM

Here's some example code:

Code:

import viz
import vizact
import win32api

viz.go()
viz.addChild('piazza.osgb')

def setCursorCenter():
        win32api.SetCursorPos((400,300))
       
vizact.onkeydown(' ',setCursorCenter)


sskalicky 08-20-2018 06:41 AM

Many thanks Jeff!


All times are GMT -7. The time now is 04:54 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC