WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Old 07-01-2008, 01:29 AM
Cheff Cheff is offline
Join Date: Jun 2008
Posts: 2
Question onkeydown list of values


i'm quit a rookie in the world of Vizard and i have a problem with making a list of values by keyboard action.
I have a list of values (60, 69, 52, 9, 55, 58, 10, 18, 56) and I want vizard to run throug the list from the beginning to the end , each time you hit the spacebar I want the script to give the next value. Once the last value is reached, I want it to jump back to the beginning and repeat.
I've tried something like this:

def onkeydown (key):
	if key == ' ':
		print vizact.choice( [60, 69, 52, 9, 55, 58, 10, 18, 56], viz.LOOP )
but it doesn't quite work.

Can anybody help me with this problem?

Reply With Quote
Old 07-01-2008, 10:03 AM
farshizzo farshizzo is offline
WorldViz Team Member
Join Date: Mar 2003
Posts: 2,849
Try the following code, it should do what you ant:
numberCycle = viz.cycle([60, 69, 52, 9, 55, 58, 10, 18, 56])
def PrintNumber():
vizact.onkeydown(' ',PrintNumber)
Reply With Quote
Old 07-02-2008, 02:00 AM
Cheff Cheff is offline
Join Date: Jun 2008
Posts: 2
yes it works!

thank you
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Incoming floating point values Rachel Vizard 1 02-12-2008 03:09 PM

All times are GMT -7. The time now is 10:18 PM.

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