Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to read char by char input from stdin?  RSS feed

 
Nai Kwok
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for this newbie type question, but all the examples I've seen in java requires the input to be confirmed by hitting the enter key before it it reads the input.
I need the input to be read as it is typed. Can someone give me some pointers as to how that is done? ie, instead of:
input: a(enter)
output: a
I need to do
input: a
output: a

Thanks in advance.
N
[ January 08, 2002: Message edited by: Nai Kwok ]
 
Rashid Ali
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that for this purpose you will have to handle KeyEvent event class to listen char from keyboard and print it to the consol.
It's just a hint.
Good luck
Rashid Ali
[ January 09, 2002: Message edited by: Rashid Ali ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!