I have a class that implements KeyListener like so:

Code:
public class ErrorChecker extends JFrame implements ActionListener, KeyListener
Inside of the constructor I made sure to add listeners for all of the components in the GUI, so that the keyboard shortcuts work no matter which component is in focus:

Code:
	    // add key listener to the textarea and all buttons (except quit)
	    textArea.addKeyListener(this);
	    openButton.addKeyListener(this);
	    clearButton.addKeyListener(this);
	    verboseButton.addKeyListener(this);

I have implemented the actionPerformed() and keyTyped() methods and they work exactly how I expect them to...at least on Linux. Then I had my friend checkout my latest code from SVN on his Windows box and none of the keyboard shortcuts work! I fired up the program in the eclipse debugger and set a breakpoint inside of keyTyped() -- no matter what you press or what is in focus, the breakpoint is never hit -- meaning Windows doesn't even seem to send the event to my Java program.

So in summary:

1. On Linux:
- actionPerformed() works perfectly
- keyTyped() works perfectly


2. On Windows:
- actionPerformed() works perfectly (i.e. listens for buttons to be clicked)
- keyTyped() seems to be ignored entirely


Here is the keyTyped() method:

Code:
public void keyTyped(KeyEvent e)
{
	// Only rely on the key char if the event is a key typed event.
        if (e.getID() == KeyEvent.KEY_TYPED)
        {
            // get the key typed
            int c = e.getKeyChar();
        
            // check for modifiers
            int modifiersEx = e.getModifiersEx();
            String modCode = KeyEvent.getModifiersExText(modifiersEx);

            
            
            /* Not sure why but Ctrl with some keys produces some weird codes.
    		 * Here is a list of some codes we are looking for (some are expected
    		 * such as 127 for 'Del' while Ctrl-O is funky):
    		 * 
    		 * Ctrl-O = 15
    		 * Delete = 127
    		 */
            if (c == '-' && modCode.equals("Ctrl"))
            	decreaseFont();
            else if (c == '=' && modCode.equals("Ctrl"))
            	increaseFont();
            else if (c == 15 && modCode.equals("Ctrl"))
            	actionPerformed(new ActionEvent(openButton, 0, ""));
            else if (c == 127 && modCode.equals("Shift"))
            	textArea.setText("");
        }
}

Any ideas why keyTyped() is flat out useless on Windows yet works perfectly on Linux? The JRE version doesn't seem to matter because we have different version of Sun Java 1.6 installed (and both fail). I also have IBM Java 1.5 installed on a Windows VM and key presses are also ignored on this system. I haven't tried on OS X yet, but I can give it a shot when I get home tonight.

Thanks!