JDK-4530318 : RFE: Need beefed up System.in in order to write console interfaces
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 1.3.1
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2001-11-21
  • Updated: 2002-12-16
  • Resolved: 2002-12-16
Related Reports
Duplicate :  
Description

Name: ddT132432			Date: 11/21/2001


java version "1.3.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)

It is IMPOSSIBLE to write a decent command line interface program (a console
based application) in Java!

This is entirely due to the following defects of System.in:
--it does not report individual key events as they happen; rather, you must
wait for the user to press enter, and then all the keys pressed since the last
enter are made available to System.in
--it does not report non-ascii key events (e.g. arrow keys, or control
modifiers)

It would also be nice if you had some way to erase previous chars that were
written by System.out

Before writing you guys, I first started a thread on one of the JDC forums.
All the guys who wrote back confirmed what I wrote above; see their comments
for yourself:

    http://forum.java.sun.com/thread.jsp?forum=4&thread=192144

(If that URL does not work, look for the topic "How can detect Arrow keys from
a console app?" that was submitted on Nov. 17th the the Advanced Language
Topics list.)
(Review ID: 136034) 
======================================================================

Comments
WORK AROUND Name: ddT132432 Date: 11/21/2001 None ======================================================================
11-06-2004

EVALUATION These requirements will be considered as input to 4050435. -- ###@###.### 2002/12/16
12-10-0182