Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Java Keyboard Event
Index -> Programming, Java -> Java Help
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
S_Grimm




PostPosted: Mon Sep 12, 2011 8:23 am   Post subject: RE:Java Keyboard Event

It seems that he wants the user to be looking at a cmd prompt and being prompted to push an arrow key. He then seems to be wanting to catch the action event and respond to it by outputting text based on what arrow key was pressed.
Sponsor
Sponsor
Sponsor
sponsor
DemonWasp




PostPosted: Mon Sep 12, 2011 11:10 am   Post subject: RE:Java Keyboard Event

Then he may have a difficult time, because that's not what a command prompt is used for. The prompt itself listens to the arrow keys, insert-delete-home-end-pgup-pgdn and other keys. The command prompt is built for line-by-line input, not for listening to individual keys.

If you want to listen to individual keys in an environment like the command prompt, then you will probably have to build the command prompt yourself (a Window with a scrolling text box, usually).
Tony




PostPosted: Mon Sep 12, 2011 11:35 am   Post subject: Re: RE:Java Keyboard Event

DemonWasp @ Mon Sep 12, 2011 11:10 am wrote:
If you want to listen to individual keys in an environment like the command prompt, then you will probably have to build the command prompt yourself

Or use GNU readline library.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
DemonWasp




PostPosted: Mon Sep 12, 2011 12:36 pm   Post subject: Re: RE:Java Keyboard Event

Tony @ Mon Sep 12, 2011 11:35 am wrote:
Or use GNU readline library.


...which has to be wrapped in a Java library to use in a Java program. For example: http://java-readline.sourceforge.net/
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 2  [ 19 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: