A button is an unfriendly thing from the processor viewpoint. When closing, it always bounces for some milliseconds and feeds multiple closing signals to the processor. Most buttons do the same on opening.
You'd be better off if you polled the button in regular intervals and trusted the output when there are sufficiently many same states read after each other. The common method is to have the intervals from a timer interrupt.