Keyboard Input Output Problems on Mac OS X

Hey guys,
I'm at college studying Java, however my teacher and the rest of the class all use the Kawa IDE, I've been using Project Builder, provided with Mac OS X. Our tutor gave us a class made up of various methods which the college designed to handle keyboard Input and Output, however when I import it I get unpredictable results. I've put it online at: http://www.lostroom.co.uk/inout/
All I'm trying to do is run a simple program;
import InOut;
class CostReckoner
public static void main(String[] args)
// Declare the variables
int quantity;
double unitCost, basicCost, vatCost, totalCost;
double vatRate = 0.175;
// Input the number of items and the cost per item
System.out.print("What is the unit cost of the items?");
unitCost = InOut.readDouble();
System.out.print("How many items in the order?");
quantity = InOut.readInt();
// Calculate the cost of the order
basicCost = unitCost * quantity;
vatCost = basicCost * vatRate;
totalCost = basicCost + vatCost;
//Output the total cost of the order
System.out.println("Cost �"+InOut.format(basicCost,2));
System.out.println("Vat �"+InOut.format(vatCost,2));
System.out.println("Total �"+InOut.format(totalCost,2));
I seem to need to press space bar after I input anything, as it doesn't recognise "Return" without it. Any ideas ??
Strange thing is it seems to work fine on the PC Kawa IDE within college. Any advice you guys could offer would be really appreciated. Send me an email at: <[email protected]> if you can help.
Regards, Gareth

Hi thanks for your help, I tried compiling the code you gave me to read the streams, however I seem to be have problems with it.
ERROR
keys.java:18: unreported exception java.io.IOException; must be caught or declared to be thrown
n=stream.read();
HERE IS THE CODE I'M TRYING TO COMPILE
import java.io.*;
public class keys {
public static void main(String[]arguments)
BufferedInputStream stream = new BufferedInputStream(System.in);
int n=0;
while(true){
n=stream.read();
System.out.println(Integer.toHexString(n));
if (n==0x30) break;// this termination condition is optional
Any ideas ??

Similar Messages

  • Audio input/output problems with Mac Mini

    at first, my sound just stopped working all together and for some reason the monitor was getting no signal from the mac mini. i unplugged everything for a minute and plugged it back in and the monitor was working again, but still nothing with the sound. no sound coming out from even the internal speaker, and the audio in jack (which i use frequently) stopped working as well.
    this is the really strange part: after tinkering around trying to fix the problem i realized the only sound that comes out it is from the internal speaker, but it only comes out when i have something connected to the headphones jack.
    has anyone ever had a problem like this? i'm just trying to figure out if it is something i can take care of myself, or if i might need some repairs done.

    OK, then two things to do.
    First reset parameter RAM - it's an area of non-volatile memory used for system settings and hardware configuration. It it gets corrupted, it can cause odd problems.
    Reset PRAM
    -Shut down the computer.
    -Locate the following keys on the keyboard: Command, Option, P, and R. You will need to hold these keys down simultaneously in the next step but one.
    -Turn on the computer.
    -Press and hold the Command-Option-P-R keys. You must press this key combination before the gray screen appears.
    -Hold the keys down until the computer restarts and you hear the startup sound for the second time.
    -Release the keys.
    Next, perform an SMC reset. The SMC is the device which controls system hardware and devices, so if there is a problem with hardware components not functioning, it could be that.
    To reset the SMC on an Intel mini:
    -From the Apple menu, choose Shut Down (or if the computer is not responding, hold the power button until it turns off).
    -Unplug all cables from the computer, including the power cord and any display cables.
    -Wait at least 15 seconds.
    -Plug the power cord back in, making sure the power button is not being pressed at the time.
    -Then reconnect your keyboard and mouse to the computer.
    -Press the power button on the back to start up your computer.

  • Installed rdesktop - but keyboard input still goes to Mac Terminal??

    My work PC has been "upgraded" to Windows 7 which made the Microsoft Remote Desktop Connection v2.0.1 stop working (it connects OK, I can login and see my work PC screen, but as soon as I try to do something I am "disconnected" from the PC).  I can't install RDC 2.1 because I have a PPC G5.
    So I searched for alternative remote desktop apps.  Cord 0.5.0 crashes on my machine and 0.5.5 won't even start up.
    I ended up installing rdesktop (www.rdesktop.org)
    It looks promising - very fast, and gets me to my PC login screen.  My mouse pointer can click on the screen buttons, but any keyboard input appears in my G5 Terminal window and is not sent to the Windows 7 PC.  This makes it impossible to enter my Windows 7 password to login!
    I'm sure this is a simple problem to solve but I have no idea on how to solve it.
    Any clues appreciated.  Thanks.

    Try:
    rdesktop -x m -r clipboard:"CLIPBOARD" -g 1280x1024 -u<username> <hostip>
    I do recommend using ssh tunnel for RDP over internet. Is more secure and limits open ports to only ssh port in firewall.
    There are instructions about on how to use cygwin with RSA key login, turn off ssh password login when working properly.

  • Input-Output problem :)

    The thing that I do not understand is : How can System.out.println(tmp)
    prints Name and Id at the same time: Is it possible?
    tmp has two variables,name and id...

    Hi Gallimaufry,
    Prorok is right. If you want to get your specific output
    Name : ....
    ID : ....
    you need to overwrite the toString() method inherited from java.lang.Object and format your output in that method. Then you just print it with System.out.println(tmp).

  • Firefox and Thunderbird are suddenly not accepting keyboard input

    Keyboard shortcuts still work just input in any kind of input field fails so I can still use ctrl+C / CTRL+V to somewhat use firefox and Thunderbird But all input fields are completely unresponsive to keyboard input
    The problem suddenly arose while I was browsing.
    I have the same issue on all program's based on the Gecko engine and I confirmed them so far in Firefox, waterfox, instantbird, thunderbird and fossamail. However chromium / windows / basically everythign n
    To fix it I tried the following:
    Restarting firefox
    Restarting firefox in savemode
    Rebooting
    Changing the keyboard layout in windows
    Using a different keyboard
    Again rebooting
    Pressing F7 to check for caret mode which was disabled
    pressing winkey + F9 (Whatever that does)
    I am running windows 8.1(x64)

    Solved, Changing the keyboard layout again and rebooting fixed it. I tried using the on screen keyboard which worked so I changed the keyboard layout again and rebooted and now it works just fine. I still wonder what caused a Gecko wide issue like this?

  • GT72 SERIOUS KEYBOARD INPUT LAG (MSI OFFICIALS TAKE A LOOK)

    First of all hi to the community..! 
    I m a GT72 2QE 629TR owner and GT72 has a SERIOUS keyboard input lag problem..maybe all of you guys cant feel that in fps or 3rd person games as i do but i have been playing STREET FIGHTER 4 for 5 years...in which game inputs are very sensetive..! I cant do neither combos nor plinking with this stupid keyboard.. but i can do that stuff easily in any keyboard even on my wireless logitech keyboard but in this steelseries keyboard CANT because of the serious lag..some combos need one frame link means 1/60 seconds bla bla..
    but i realized after uninstalled steelseries keyboard utility lag reduced a little bit but still there is some..I dont know which cause to this problem.. 
    Another request keyboard lights which depends on steelseries utility means we cant turn it on or off the light from keyboard shortcuts unless we are in windows...This is stupid...!    it should be also BIOS controlled..In a darker environment i cant see the buttons in windows LOG ON screen to enter the password why? because of this utility works after logged in so the lights dont work which is very STUPID again..  In my other 600$ Lenovo laptop you can control the light from the FN+SPACE keys even you are in bios or dos environment...because its controlled from the bios itself..
    Another bug  the dot(point) button right next to the 0(zero) button in numerical buttons area...it shows POINT on that button but when you press it comma comes on screen ? shhhh..which one is true comma or dot 
    MSI..! Do something to fix those problems IMMEDIATELY in the next BIOS update or whatever..! or go for
    Note: I m on E1781IMS.10R bios (appreciated the CPU C STATES enable/disable option because disabling this removed some stuttering with games also gives performance boost ) with 1781EMS1.510 EC Firmware and dont be offended we love MSI preferred over asus and others

    The keyboard should light up in red during POST. At least I saw GS70 has red keyboard light when it is turning on and the color turns to its setting while SSE is on.

  • I have a new mac book pro (sept 2014) and am suddenly stuck on the log-in screen. Keyboard input not working to enter my password. Already tried a basic restart and a cmmnd/ cntrl/ pwr troubleshoot to no effect.

    I have a new mac book pro (sept 2014) and am suddenly stuck on the log-in screen. Keyboard input is not working to enter my password. Seems to be a log in issue as keyboard works for forced troubleshooting. (And b/c when I first noticed the problem, I was able to enter my log in password but then everything sort of froze. Now, no ability to enter the password.) Already tried a basic restart and a cmmnd/ cntrl/ pwr troubleshoot to no effect.

    Reset PRAM:   http://support.apple.com/kb/PH14222
    Start up in Safe Mode.
    http://support.apple.com/kb/ph14204
    A new Mac is in warranty for 1 year from the date of purchase.
    A new Mac comes with 90 days of free tech support from AppleCare.
    AppleCare: 1-800-275-2273
    Call AppleCare or take it to the Apple store to have it checked out.
    Genius Bar reservation
    http://www.apple.com/retail/geniusbar/
    Best.

  • Restoring .dmg image from external to Mac HD in Disk Utility: "Unable to scan image (Input/output error)"

    Hi guys,
    So I've got a problem with restoring the image backup I did (using Disk Utility) of my 500GB HD on my MBP which was acting weird or maybe even crashed a few months ago. After creating the backup image and putting it on my external device, I installed Mavericks back to see if everything was alright (mainly the HD) and everything seems okay.
    I did try restoring the backup image through disk utility before installing mavericks (thus erasing everything again on the HD) AND after. But nothing..
    The whole process starts fine and then it starts scanning the image when after maybe a good 10-15min in I get a message that says that it was unable to scan the image. I tried verifying the disk(s), everything came out "OK". Also tried scanning it through Images > Scan image for Restore... with the same results.
    While searching I've seen people getting messages like "Unable to scan filename.dmg (Invalid argument)" and "Unable to scan filename.dmg
    (Internal error)" but none have (Input/output error)
    The screen grab is below.
    I also came across something about using terminal/commands but I'm not that savvy with it, especially considering that those there had issues with either mounting or trouble finding the image.
    I've also tried moving the backup image to a different external device 2TB and also the desktop because I read it may have to do with the format of the externals or maybe free space. But THEN I would get a message saying
    "The Finder can't complete the operation because some data in "Mac HD Backup.dmg" can't be read or written. Error code -36"
    Fyi ALL my externals are HFS+/Journaled and the backup image format was compressed.
    I REALLY don't know what to do next. Was it the wrong move to create a dmg image? Have I lost everything? Is there still a way out?
    If anyone can help, THANKS!
    2012 MacBook Pro, Mac OS X (10.9.3)

    Make a "Genius" appointment at an Apple Store, or go to another authorized service provider. You may have to leave the machine there for several days.
    Back up all data on the internal drive(s) before you hand over your computer to anyone. There are ways to back up a computer that isn't fully functional—ask if you need guidance.
    If privacy is a concern, erase the data partition(s) with the option to write zeros* (do this only if you have at least two complete, independent backups, and you know how to restore to an empty drive from any of them.) Don’t erase the recovery partition, if present.
    Keeping your confidential data secure during hardware repair
    Apple also recommends that you deauthorize a device in the iTunes Store before having it serviced.
    *An SSD doesn't need to be zeroed.

  • How to have same keyboards input source in Mac and Windows???

    I use Canadian French-CSA on my Mac keyboards input source. Using Windows 7, I can't find the good setting for my keyboards to be the same when I it keys.
    I run Windows over Parallels Desktop
    Can anybody help?
    Thank you

    Can I use an AirPort Extreme Base Station "n"
    Yes.
    and if so, will my MacBook work with this at maximum download / upload speed (i.e. equivalent to the cable)
    The speed of your internal network generally is much much faster than the speed of your internet connection. Unless he has an internet connection faster than approx 6Mbps then even dropping down to the old 802.11b Airport would not seen any decrease in speed of downloads etc...
    and will my brother's PC's also be able to connect?
    If his PC is 802.11b/g-compliant, it shouldn't have any problems connecting to the AirPort base station.
    Or is there another Airport base station?
    The other AirPorts would work, but the AirPort Express & older 802.11g AirPort Extreme base stations have a max. range of 150 feet.
    OR-- should I head down to "Generic Computer Store" and just by a wireless router (WiFi)(think that's what they call them) and connect this to his cable modem? IF SO WILL THAT WORK FOR MY MAC?
    That is always an option as well, especially since he will be the primary user throughout the year. I'd suggest going with a brand name, like Belkin, D-Link, or Linksys for the wireless router choice.

  • Hello!  I am having trouble deleting any emails on my Mac OS X.  I keep getting this error message "this operation couldn't be completed.  Input/Output err."  Any suggestions?  I have rebooted.

    Hello,
    I have a Mac OS X.  I just had some memory installed and had to update my Mail and had a ton of old mail still there.  Since then, my mail has crawled so slow and I have tried to delete my old emails and I keep getting this error message "the operation couldn't be completed.  Input/Output error".  Any suggestions? 
    Thanks!

    The next time you have the problem, note the exact time: hour, minute, second.
    If you have more than one user account, these instructions must be carried out as an administrator.
    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Scroll back in the log to the time you noted above. Select any messages timestamped from then until the end of the episode, or until they start to repeat. Copy them to the Clipboard (command-C). Paste into a reply to this message (command-V).
    When posting a log extract, be selective. In most cases, a few dozen lines are more than enough.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some private information, such as your name, may appear in the log. Anonymize before posting.

  • Keyboard input or Console Output

    I'm self teaching java... I got stuck with one of the exercises that is supposed to demonstrate the basic input and output through entering data on console...
    I went about writing the code as:
    public class Program2 {
    public static void main(final String [ ] args) {
    KeyboardInput in = new KeyboardInput () ;
    System.out.print ("Type your name: ") ;
    It doesn't compile:((((.... it says "KeyboardInput" is not a type...
    I would really appreciate if somebody could respond to this silly problem.

    For keyboard input from console the program would be
    public class Console{
      public static void main(String[] args){
        try{
          BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
          System.out.print("Enter Your Name: ");
          String name = reader.readLine();
          System.out.println("Your Name is "+name);
        }catch(Exception ex){
          ex.printStackTrace();
    }

  • I am in mavericks disk utility recovery mode as my mac book will not boot up & stays only on the grey apple screen. When I verify the disk I get open error5 :input /output error on Syst stuck on 1 minute pouring out over 50 error messages & still counting

    I am in Mavericks disk utility recovery mode as my mac book pro will not boot up &amp; stays on the Apple grey screen . When I verify disk permissions I get
    Open error 5:"input/ output error" on syst with over 50 of this messages &amp; still counting . Disk Utility says 1 minute
    But this has been going on for over 10 mins .
    I can not verify disk or repair disk .
    I have tried to reinstall mavericks operating system but it says my hard drive is locked which is very strange .
    Does anyone know what is going on here ?
    My system looks like it has been totally corrupted . Thanks Andrew

    Could be. The "lock" isn't actually looking for a password.
    WARNING: This will completely erase the ENTIRE hard drive.
    What you would need to do is boot to recovery > disk utility > select the MAIN drive on the left side > partition > change partition layout from CURRENT to 1 PARTITION > ensure on the right side it says Format : Mac OSX Extended (Journaled) then push APPLY.
    Then if it will allow us, close the windows until you see the 4 options popup again and select "Reinstall Mac OS X" select the Mac HD and you should be good to go!

  • I had a problem with the hard disk on a 2010 macbook pro. Replaced the hard disk with an Hitachi 1TB and when I tried to erase and format It fails with input/output error. Any help much appreciated!

    I had a problem with the hard disk on a 13" 2010 macbook pro. Replaced the hard disk with an Hitachi 1TB disk but when I tried to erase and format, it fails with input/output error and at other times saying unable to allocate memory. Any help much appreciated!

    Zap the PRAM and Reset the SMC, then try again.

  • Mac mini audio output problems

    This is similar to a problem that appeared before, but with a different twist.
    On 4 July all was well. On 5 July I switched on and there was no "chord" from the Mac. When I collected my mail - no sound from my speakers (which are part of my screen). Logged on to a couple of sites - no sound.
    The System Profiler, under the "Audio (Built In)" category, says: "No Built-in Audio." I know that's wrong because it's always worked before and when I plug my headset in it works fine.
    When I go to the Sound preferences panel in System Preferences, it finds the headset but if I unplug that it finds nothing.
    I tried running the hardware test (by putting in the OS X install disc and holding D during startup.) It couldn't find a problem.
    So, as far as I can see, audio output is fine for the USB headset output but not for the others. Is there a simple fix? The nearest Apple store is about 200 miles away and I don't fancy the idea of posting the Mac off.
    (And I think it's still under warranty for a couple more weeks.)
    Mac mini   Mac OS X (10.4.10)  

    hello mini users with the "no audio output" problem
    it seems that there are faulty output jacks in the macbook and the mac mini
    there are two things you can try:
    i tried everything and began thinking about what new software i had installed. it was "macam" which enables you to use older webcams on OSX. i needed that to use my webcam on skype.
    macam installs a file called "macam.component"
    if you have the same, do this - take that file out of:
    (your hard drive)/library/quicktime - macam.component
    and just put it on your desktop
    restart, then in your sound pref's choose your audio output (if doesn't work restart again)
    the first time i took it out, i had my sound back instantly, another time i had to choose audio output in sound prefs. you kind of have to try different things. after you get your sound back, you can put back "macam.component" to use your webcam.
    it seems macam causes the problem, the two can not work at the same time.
    the second thing: if you dont have "maccam" try plugging and unplugging output jack a few times and restarting until you have sound.
    the problem still could be with the OSX 10.4.10 update / quicktime...or maybe even a hardware problem like others with macbooks were saying (with the red light), not sure.
    people with macbooks and who have the red light on, say to use a paperclip to turn off the switch inside.
    my mini does not have a red light on. i tried using a paperclip but it doesnt work.
    hope this helps, beleive me i feel your pain!!!!
    what good is a computer without sound?
    extremely annoying problem that i hope apple looks into and fixes
    -andrew

  • Frequency problem in input-output control loop, LabviewRT

    Hello,
    I want to write a cotrol loop in LabView real-time. My target is to acquire a data from 5 channel in frequncy about 100 kHz, integrate the data and send them to the output in frequency about 10 kHz (every 10th sample). I made twou time-loops. One for acquiring and integrating, second for sending them to output. This loops are connected throug the rt fifo. 
    My problem is with a speed of acquisition. When I use "Hardware-timed single point" for acquiring, the result frequency is about 50 kHz. Continous sample and finite samples give me the desired frequency, but the output is not in in the same time as input (output waits until the input collects all data). Is there any problem with communication with the input and output channels in the same time?
    My Hardware: 
    Computer: NI PXIe-8108 in NI PXIe-1062Q
    card: NI PXIe-6358
    My vi is attached
    Attachments:
    rt_headless_v1.2.vi ‏133 KB

    Dear Kocman,
    thanks for including your VI, it is useful to understand better your application.
    However, the detailed requirements are still not entirely clear for me.
    I think, starting with the right architecture and proper timing and synchronization schemes could save you a lot of effort while they ensure proper operation.
    First, it should be defined what kind of timing your application requires. More specifically, if it needs to be hardware or software timed.
    From your description it sounds like you would need hardware timed aquisition synchronized with generation, although your code tries to implement it using timed loops, which are inherently software timed.
    You can find some useful additional information about the two methods and a nice white paper about synchronization techniques here:
    http://zone.ni.com/reference/en-XX/help/370466V-01/TOC11.htm
    http://www.ni.com/white-paper/4322/en
    Probably it helps to review them or even try to test some of the methods to get a better feeling about it.
    I hope this helps you to get to the proper solution.
    Best Regards,
    Adam Cseh
    Applications/Systems Engineer
    National Instruments

Maybe you are looking for