add input functions for mouse event