Just wondering, the code Greenfoot.isKeyDown("tab") doesn't ever pick up, is it not recognized by Greenfoot? In the API it does list tab, so just wondering.


1 2 3 4 5 6 7 8 9 10 11 12 | JPanel panel = WorldHandler.getInstance().getWorldCanvas(); panel.addKeyListener( new KeyListener() { public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_TAB) { /*action here*/ };} public void keyReleased(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_TAB) { /*action here*/ };} public void keyTyped(KeyEvent e) {} }); panel.setFocusTraversalKeysEnabled( false ); panel.setFocusable( true ); |