map.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
int key = e.getKeyCode();
switch(key) {
case KeyEvent.VK_ENTER:execute();break;
case KeyEvent.VK_A:quickenUp();break;
case KeyEvent.VK_D:slowdown();break;
case KeyEvent.VK_DOWN:map.getSnake().move(key);break;
case KeyEvent.VK_UP:map.getSnake().move(key);break;
case KeyEvent.VK_LEFT:map.getSnake().move(key);break;
case KeyEvent.VK_RIGHT:map.getSnake().move(key);break;
}
}
});
}