Added functions to control keyboard inputs.