swamynathan wrote:
hello,
i am doing a small virtual piano program in python..
i have a situation where i need to get multiple keystrokes from key board
and send it to a function
the  function accepts only char..

eg if i press 'a'  , 'a' is passed to the function
if i press 'a','d' then the function should be called simultaneously

  i tried using threads it dint seem to work


or any other suggestion

I think you are approaching the problem the wrong way. Keyboard cannot give you multiple inputs for the different keys. The standard way to handle it in games and other places is to have a separate thread that monitors for keys and you look for time difference between keys to say if they are pressed simultaneously or they are pressed with significant time difference.

Keyboard and mouse are serial devices and will only send only key at a time.

Best of luck with the virtual piano..

Vaidhy
begin:vcard
fn:Vaidhy
n:Mayilrangam Gopalan;Vaidhyanathan 
org:Serendio
email;internet:vai...@svapas.com
title:CTO
tel;work:+91 44 22238717
tel;cell:+91 9790911996
x-mozilla-html:FALSE
version:2.1
end:vcard

_______________________________________________
To unsubscribe, email ilugc-requ...@ae.iitm.ac.in with 
"unsubscribe <password> <address>"
in the subject or body of the message.  
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc

Reply via email to