Integrate inputManager in main program

Now the main program can be notified of keyboard input events and
act accordingly.