PDA

View Full Version : wait for vizproximity and waitKeyDown in task


krimble
07-25-2013, 04:45 AM
Hi,
my name is Jeroen and I'm having troubles with waiting inside a viztask.

I would like to have to wait for an vizproximity.waitEnter and for an waitKeyDown. If one of them occurs go on, otherwise wait.

d = yield viztask.waitAny(vizproximity.waitEnter([c2Sensor]), viztask.waitKeyDown( ["t"] ))
print d
pp_pickedCard = '1'
card02.addAction( vizact.fadeTo(fadeAmount,time=1) )

The error i'm getting is this.
TypeError: 'waitEnter' object is not iterable

I thought adding viztask. in front of vizproximity would work but that results in:
AttributeError: 'module' object has no attribute 'vizproximity'

Does anyone have any tips \ pointers \ advise on how I can do this?

Thank you!

Jeff
07-26-2013, 01:32 PM
If you place the conditions to wait for in a list it should work:
yield viztask.waitAny([vizproximity.waitEnter(c2Sensor),viztask.waitKeyDo wn("t")])

krimble
08-14-2013, 03:14 AM
Ah Jeff, thanks for the reply! Monday I'm able to try, but I.m positive this works.