moved onKeyDown to its own function.