I used to run into a similar issue as the OP so I just stopped running the game through Steam and opted to all tab instead. The keyboard doesn't stop working, but you have to re-click on the client because it's almost as if it were in the background where you lost control of the game itself. Obviously, I would prefer to run everything through Steam, but it screwed me over a few times so I said the heck with it.