Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Hardware - Troubleshooting and Discussion > Mac Notebooks > KeyboarReader.class for Mac OS X

KeyboarReader.class for Mac OS X
Thread Tools
Fresh-Faced Recruit
Join Date: Oct 2006
Status: Offline
Reply With Quote
Oct 14, 2006, 08:57 PM
 
Hi...

I had just got new MacBook and I like to use KeyboardReader.class in Java programming. Could anyone let me know where should i place those class to make it work?


Thanks


Imperial...
     
Junior Member
Join Date: Sep 2004
Status: Offline
Reply With Quote
Oct 14, 2006, 09:54 PM
 
The Java 2 v1.5 (also called Java 5) API has no such class. It will not be on your MacBook unless you download it. Having never heard of - much less used - this class, I did a search and came up with the following website. Download link is in section 4.

KeyboardReader and Script (Java)

Note that this is only one implementation of a KeyboardReader class. Others exist.
PowerBook G4 17-inch 1GHz (March 2003)
iBook G4 12-inch 1.33GHz (July 2005)
iMac 20-inch 2.0GHz Intel Core Duo (January 2006)
     
Junior Member
Join Date: Sep 2004
Status: Offline
Reply With Quote
Oct 14, 2006, 10:02 PM
 
I would suggest using InputStreamReader and a BufferedReader to wrap it instead of this KeyboardReader. While it may seem slightly more complex to do the same operations, this route is supported by the Java 5 API and as such will run on any machine that has the JRE installed.

First create the BufferedReader object and supply it with an InputStreamReader, like so:

InputStreamReader stdin = new InputStreamReader(System.in);
BufferedReader console = new BufferedReader(stdin);

Then you can use any of the methods in the BufferedReader class to read your input. You will likely only use one method, and that is the readLine() method - which returns a String object, used as below:

String input = console.readLine();

I know this thread will probably be moved as it is in the wrong forum, but if you have any Java questions, feel free to PM me.
PowerBook G4 17-inch 1GHz (March 2003)
iBook G4 12-inch 1.33GHz (July 2005)
iMac 20-inch 2.0GHz Intel Core Duo (January 2006)
     
Fresh-Faced Recruit
Join Date: Oct 2006
Status: Offline
Reply With Quote
Oct 15, 2006, 04:07 AM
 
Ok, Thanks for your help... Will look at it.... :-)
     
   
Thread Tools
Forum Links
Forum 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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 03:40 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2