added pre_handle_input to allow ui element to catch input before other when they need to