WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 09-28-2005, 06:05 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

The following script will manually move the mouse in a circlular motion at the center of the screen. The command to move the mouse cursor is win32api.mouse_event:
Code:
import viz
viz.go(viz.FULLSCREEN)

import win32api
import math

angle = 0

def ontimer(num):
	global angle
	angle += 90 * viz.elapsed()
	x = (math.sin(viz.radians(angle)) * 0.3) + 0.5
	y = (math.cos(viz.radians(angle)) * 0.3) + 0.5
	x = int(65535*x)
	y = int(65535*y)
	
	#The mouse coordinates must be normalized from 0 to 65535.
	#The origin (0,0) represents the upper left corner of the monitor
	win32api.mouse_event(32769,x,y,0)
	
viz.callback(viz.TIMER_EVENT,ontimer)
viz.starttimer(0,0,viz.FOREVER)
Reply With Quote
 

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


All times are GMT -7. The time now is 03:02 AM.


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