Try this
sudo ibus restart
Answer from here…https://askubuntu.com/questions/416504/phpstorm-losing-keyboard-input#answer-420131
This may switch your keyboard input by the way so reselect your keyboard input in the Ubuntu toolbar (I set mine to En1)
Not sure what causes this though, I’m using Guake and Compiz and have seen these tools behave a bit odd sometimes