Modify handle_key_input function for responding the onKeyReleased