View Single Post
  #9  
Old 06-26-2008, 01:28 PM
Uttama_vizard Uttama_vizard is offline
Member
 
Join Date: Sep 2007
Posts: 60
Hello,

Many thanks for the code. It is working perfectly. Your suggestions are really great.

May be, my nested if loop has been interpreted wrongly. What I was trying to say was that nested loop using if statements.

def onKeyDown(key):
if key=='A':
print 'abcd'
if key=='B':
print 'pqrs'
viz.callback(viz.KEYDOWN_EVENT,onKeyDown)

When, I was using the above code and I was pressing 'A' on keyboard, I was getting a printout of 'abcd'. This implies, that the first if statement was checking the conditionality. Thus, once in the first if loop, when I was subsequently pressing the 'B' button on keyboard, I was not getting any output. Does it not imply that it was not taking the second sequential input from keyboard? or may be the 'key' was not taking in the 'B' input.

Thanks

Uttama
Reply With Quote