WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
Old 01-19-2006, 01:33 PM
Wenamun Wenamun is offline
Join Date: Jan 2006
Location: Milwaukee Wisconsin
Posts: 11
Timer vs. Keyboard input

I want to trigger a series of actions with a single keystroke.
Some of these actions need to use viz.FASTEST_EXPIRATION and viz.FOREVER though, as I am getting input from a mouse and a PPT system.

Here's my code:



ball = viz.add('white_ball.wrl')

#Now we press "1"
#The ball fades in...
#The ball scales vertically according ...
#to the height of the mouse...
#but it only scales to the initial height...
#it doesn't update in real time.

def ontimer(num):
if viz.iskeydown('1'):
print '"1" key is down'
mousePos = viz.mousepos()
elif viz.iskeydown('u'):
print "Undo"
viz.callback(viz.TIMER_EVENT, ontimer)
viz.starttimer(1,viz.FASTEST_EXPIRATION, viz.FOREVER)

thanks for any help!

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:28 PM.

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