Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.chainon-marquant.org!nntpfeed.proxad.net!proxad.net!feeder1-1.proxad.net!198.186.194.247.MISMATCH!news-out.readnews.com!transit3.readnews.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: read DEL and BACK key from stdin Date: Fri, 9 Dec 2011 08:19:07 -0800 (PST) Organization: http://groups.google.com Lines: 28 Message-ID: <26099855.1318.1323447547152.JavaMail.geo-discussion-forums@pril5> References: Reply-To: comp.lang.java.programmer@googlegroups.com NNTP-Posting-Host: 173.164.137.214 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1323447649 9275 127.0.0.1 (9 Dec 2011 16:20:49 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 9 Dec 2011 16:20:49 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=173.164.137.214; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T User-Agent: G2/1.0 X-Google-Web-Client: true Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:10623 xdevel1999 wrote: > Is it possible to read DEL and BACKSPACE keys from standard in? > > If I use: > > System.in.read() > > these keys are never returned. It is only possible to read what the OS puts into the input stream. What is the behavior of stdin from the OS point of view? On your platform and most that we know, the OS buffers input on that stream until it receives an end-of-line. That line is passed entire to Java to wrap as an 'InputStream' input. It follows trivially that the Java stream cannot see the characters you describe unless you escape them. Have you escaped them? "Never" is a very strong word. public static final InputStream in -- Lew