Bugfix for pause/play using spacebar

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