Did a search and didn't find much for this exact issue:
Have no trouble getting the game to run on Kongregate. Will load in the iframe great and run like a champ except if you move focus off the game (i.e. to type in chat or anything else) the game loses all keyboard control. Mouse controls work fine still, but I can't get the keyboard to respond at all. Clicking back in the game does nothing.
Anyone have this experience and did you find a fix? (or point me towards another post with this exact issue or tutorial please!)
Edit: Fixed my own problem...
Added an event for any mouse click. Gave it the action of Brower -> Focus. Seems to work like a charm. Can click into the Kong chat, type away, then click back on the game and the keyboard responds like it should.