I couldn't really say how to fix it without looking at the code, but maybe you have an if-else somewhere for checking the keypresses?
Like if(right){...} else if (space) {...} ?
If so, it might be good to move the if(space) out completely.
Let me know if you get something right?