1. In java is there any way to capture what key a user pressed, even when the application is minimized? (I couldn't get KeyListener to do this)
2. How can I make java block a certain key from being pressed? For example, I want to replace a key with another. If I could block 'e' from doing anything, then I could use the robot class to make it do what I want.
The reason I want to do this is a little complicated. If you care for an expanation, please ask, but otherwise, it's irrelivent (no, I am not trying to screw up someone's computer).
P.S. I am nice! This thread is nice! I am being nice!
Java will only see key strokes if it's the application in front. You could probably use JNI to tap into the native OS key handling code directly - that might enable you to read all key strokes.
As to the 2nd question, can't you simply ignore those key strokes? Check for them in your handler and don't do anything about them? Maybe I'm misunderstanding what you're trying to do, because I don't know where the Robot class would fit in.
That's really too low-level and platform-dependent for Java. If this is on Windows, use a Microsoft language and program directly to the Win32 (or .NET) API. Otherwise, use what's appropriate to that platform. You're not going to be able to do this in Java.