I have my class extending KeyAdapter and with the keyPressed method I can recieve clicks for all keys on my keyboard except for the Tab key, and yes, my Tab key actually works. I want this key, why can’t I get it?
Tab is a special key - it’s for switching the focus around… therefore you have to handle it seperately.
implement KeyEventPostProcessor
KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventPostProcessor();
public boolean postProcessKeyEvent(KeyEvent e)
{
System.out.println("<-p"); //this one catches tab
return true;
}
Thanks that worked fine!