First draft at supporting input events