WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-17-2018, 10:28 AM
sskalicky sskalicky is offline
Member
 
Join Date: Aug 2018
Posts: 2
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?
Reply With Quote
  #2  
Old 08-18-2018, 09:21 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,431
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)
Reply With Quote
  #3  
Old 08-20-2018, 07:41 AM
sskalicky sskalicky is offline
Member
 
Join Date: Aug 2018
Posts: 2
Many thanks Jeff!
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mouse bug in V3 and V4 Renato Lima Vizard 2 05-11-2011 07:38 PM
Mouse event: how to detect no mouse move event, how to set mouse position? Zhi Vizard 3 04-11-2011 07:25 PM
Warning mouse() -> Set mouse() of window johannes2 Vizard 1 08-19-2010 03:11 PM
how to remove velocity when mouse is disabled? jvacare1 Vizard 2 02-18-2010 11:25 AM
Navigating an avatar using mouse position(2D) in 3D environment james007 Vizard 1 10-16-2009 12:29 PM


All times are GMT -7. The time now is 09:08 AM.


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