Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

another question

 
Adam Jones
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, i need to add a Press any Key to Continue to my program....i know i can do a
*****.readLine();
to get input and then use a Unicode value and get the semi-desired results, but i want the user to be able to hit any key at all just like it says... easy way out there>?
thanks in advance
adam jones
 
Paul LaBrier
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I needed the same thing for a console app I was writing for a class.
What I settled on was:

It worked ok. The user could type until their fingers fell off and nothings happened until they pressed enter.
Paul LaBrier
 
Adam Jones
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the reply, but what i was looking for was a press any key...i used the unicode value for enter "2324 and then just did a readLine() and it gave me the same results, but that is not what the prof wants i mean it worked just fine by me, but you know how professors are
is there just a way to pause and wait for any response at all from the keyboard?
i am very sure there has to be, but how would that be done?
thanks again for your input
adam
 
Snigdha Solanki
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone know how to do this in java? In C/C++ it is possible to do it with getchar(). InputStream's read()method blocks until the user types the <return> key at the end of a line, at which point the whole line is available for read().
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic