[Touche] Intercepter la séquence ALT+F4
Salut à tous, j'ai une petite question :
Comment faire pour intercepter le fameux ALT+F4 ?
Moi, j'ai fait ça :
Code:
1 2 3 4 5 6 7 8 9 10 11
|
public void keyPressed (KeyEvent e)
{
System.out.println ("Une touche a été appuyé");
if ( (e.getKeyCode () == KeyEvent.VK_F4) &&
(e.getModifiers () ==
java.awt.event.InputEvent.ALT_MASK))
{
System.out.println ("Il s'agit de ALT + F4");
}
} |
Ceci est la méthode et c'est sur ma fenêtre principale que j'ai fait écouter (mainFrame.getInstance().addKeyListener (...);
Mais ca marche po :(
Merci