Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

listening to two keys simultaneously  RSS feed

 
kedar kanade
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have written a key listener for the keypressed event. the problem is that when a key is pressed and held the listener does not respond to any other key pressed. i want different keys recognized independently and simultaneously.how should i use multithreading and event handling in this case?
kindly note that i am using awt package in an applet.
waiting for your reply
kedar
 
Tiago Albineli Motta
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I develop a solution for this problem. An KeyListener adapter that have the keyDown and keyUp events. You can get it here: http://programandosemcafeina.blogspot.com/2007/06/download-da-timotta-api.html and you can see an example of use here: http://programandosemcafeina.blogspot.com/2008/09/keydown-e-keyup-para-applets-java.html
 
Campbell Ritchie
Sheriff
Posts: 53769
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch

And thank you for the link to your downloads. It is quite large, but the code itself is quite short.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!