Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 10-11-2002, 08:52 AM   #1
LQ Newbie
Registered: Oct 2002
Location: New Jersey
Distribution: Red Hat 8.0
Posts: 20

Rep: Reputation: 0
Can Java detect keyboard escape codes?

I am writing a specialized shell in java (no Swing or AWT). This is an application that will run in text-only mode with the user typing commands.

How can Java detect if the user hit the "up arrow" or "down arrow"?
I tried using the read() method of InputStream to get one byte from the
stream, but it blocks until the user hits a carriage return.

Any ideas?
Old 10-13-2002, 09:37 AM   #2
Registered: May 2001
Location: New York
Distribution: Debian, Ubuntu
Posts: 83

Rep: Reputation: 15
I'm assuming inputsteam is the class that reads things...i use 2 different classes called easy reader and easywriter(not written by me). There are no methods in my class to do what you are trying to do. Uou should look on website and look at all the method or try to a class somebody wrote to handle that. It def. sounds possible. Remember to read the documentation...sorry im not much help

Last edited by mikez; 10-13-2002 at 09:39 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using escape codes to print barcodes c2tidis Linux - Software 0 09-29-2005 12:44 PM
Are the hex codes for colors in a jpg the same codes as used in html? abefroman Linux - Security 3 07-31-2005 04:21 PM
LFS system - customizing keyboard - what scan codes..? Yerp Linux From Scratch 2 01-15-2005 08:22 PM
Kernel 2.6 and Extended Keyboard Codes davecs Linux - Hardware 1 05-30-2004 10:09 PM
Keyboard scan codes... jinksys Programming 1 09-03-2003 05:52 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:45 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration