added functionality to make sure keypresses only get sent to a canvas upon mouse over