I had similar issues, but I eventually figured out that the game was losing keyboard focus somehow when I interacted with the rest of itch. It may be more about the embedding in itch.io than the game itself.