Press Space to flag or unflag a square. Press space and click on a number to uncover all the squares around it if the flags are placed.