Bugfix for pause/play using spacebar

When using the space bar to pause or play, it pauses then immediately resumes due to a bug in the key handler.