public void keyPressed(KeyEvent e) {

        if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
            debug.write("Right key pressed");
        }
        if (e.getKeyCode() == KeyEvent.VK_LEFT) {
            debug.write("Left key pressed");
        }
        if (e.getKeyCode() == KeyEvent.VK_DOWN) {
            debug.write("Down key pressed");
        }
        if (e.getKeyCode() == KeyEvent.VK_UP) {
            debug.write("Up key pressed");
        }

    }