ADD: SDL event handeling function.