@Override 
  public void keyPressed(KeyEvent e){

    int keyCode = e.getKeyCode();

    if (gameState == GameState.STARTED){
      if (keyCode == KeyEvent.VK_UP) {
        model.tryRotate();
        view.refresh();
      } 
      else if (keyCode == KeyEvent.VK_LEFT) {
        model.tryMove(-1, 0);
        view.refresh();
      }
      else if (keyCode == KeyEvent.VK_RIGHT) {
        model.tryMove(1, 0);
        view.refresh();
      } 
      else if (keyCode == KeyEvent.VK_DOWN) {
        model.tryMove(0, 1);
        view.refresh();   
      }
    }
    
    if (keyCode == KeyEvent.VK_SPACE) {
      if (gameState == GameState.STOPPED){
        start();
      } 
      else if (gameState != GameState.GAME_OVER) {
        gameState = (gameState == GameState.STARTED ? GameState.PAUSED : GameState.STARTED);
        view.gamePaused(gameState == GameState.PAUSED); 
      }

    }
  }