Added checking for keyboard input. A little crude but a proof of use.