I didn't modify the spacebar because you don't need to press it, but you can press it by accident, so maybe I should add that...
What I gave you prevents what the spacebar would 'normally' do, if that helps. You can still use it for your game, of course. :)