I think it has to do with whether or not the program was coded in XCode.
I don't run into this problem with Safari, or TextEdit. but I do almost all the time with Chrome and the First Class programs which I'm pretty sure are not coded with Apple's development environment. But sometimes I can type correctly even in Chrome. I'm using a Razer Black Wido ultimate keyboard.
When the problem comes up, the space bar does NOTHING.