處理input event,fix #12