I've noticed that it seems to happen when I'm pressing a lot of buttons at once, for instance, I was flying an AH99 and holding the chat button and all that and the keyboard froze will I was pressing W, so the helicopter nose dived into the ground and there was nothing I could do about it.
Also, my keyboard is plugged into my laptop (Don't ask), it's not a desktop computer. Only the keyboard freezes, the laptop keys work as they should.