Check that your game controlers buttons aren't being pushed while stored but hooked up.
I have stick and throttle covers, the ones with the red flag saying 'remove before flight'. At times these covers can activate the buttons and hats ontop of the stick.
Another thing to do is to pop off the space bar on any other keys that are giving you probs and make sure the keyboard bed is clean and free of any sticky stuff.
Last resort is to take the keyboard apart and clean it inside, but when you put it back together make sure it does so easily and the keys are free moving in their slots/holders. If none of these solutions work and the keyboard isn't one that requires specific software to be fully functionable, I've had the same problem as you because of corrupted KB software, then it's time to replace the keyboard, they're really cheap these days.
One last thing. If you are using wireless for both the mouse and KB then simply changing channels for one or the other may work.
YMMV