Implement input handling to Dfterm3 plugin.

This is needed for Dfterm3 to be able to have clients play the game through
Dfterm3.