Hi, i'm making a class which runs on a different thread to the main class. I want this thread class to listen for keyboard events and then I will have specific action from there.

The thing is, I don't know how to even start. I read that setFocus can only be used on components?

The class is:

class InputListener extends Thread
{
	
}

How would I make this listen for keyboard input?