Automatically switch between HUD and keyboard.

fixes #124