• Post Reply Bookmark Topic Watch Topic
  • New Topic

In Java equivalent of kbhit() function is?

 
harsh garg
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I search a Java equivalent of the C kbhit() function which return if a key has been pressed (return=1) or not (return=0).
Could you help me please ?
Thanks
 
g Peshone
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would not be that like press button or push button or press key?
 
Campbell Ritchie
Marshal
Posts: 52580
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The usual procedure in Java is to add a Listener to the Button. I have googled for tutorials which avoid that abomination "addActionListener(this)" and found this.

That is usually done for Swing/AWT Components, which is usually discussed in the Swing forum, so I shall move this thread.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!