dugmad Alt+tab, alt+f4 pomocu kalse Robot, korisnik ne moze spustiti ekran aplikacije.
public void run() {
// TODO Auto-generated method stub
try
{
Robot robot = new Robot();
while (working)
{
robot.keyRelease(KeyEvent.VK_ALT);
robot.keyRelease(KeyEvent.VK_TAB);
try {
Thread.sleep(10);
} catch(Exception e) {
}
}
} catch (Exception e) {
e.printStackTrace();
System.exit(-1);
}
}
Meni je problem kako ovo uraditi sa tasterom windows, pokusao na sl. nacin, ali ovo ne funkcionise :
@Override
public boolean dispatchKeyEvent(KeyEvent e) {
// TODO Auto-generated method stub
if (e.getID() == KeyEvent.KEY_TYPED) {
int code = e.getKeyChar();
if (KeyEvent.VK_WINDOWS == code) {
return true;
}
}
return false;
}
I kako ovo uraditi sa kombinacijom tastera crtl+alt+del ?