#1
|
|||
|
|||
Timer vs. Keyboard input
Hi.
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: viz.go() PORT_PPT = 4 ball = viz.add('white_ball.wrl') ball.translate(0,1,8) ball.alpha(0) #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() ball.scale(3,mousePos[1]) ball.fade(0,1,4) elif viz.iskeydown('u'): print "Undo" ball.fade(1,0,2) viz.callback(viz.TIMER_EVENT, ontimer) viz.starttimer(1,viz.FASTEST_EXPIRATION, viz.FOREVER) thanks for any help! -Wenamun |
#2
|
|||
|
|||
Can you please phrase what your difficulty is in more precise terms?
|
Thread Tools | |
Display Modes | Rate This Thread |
|
|