restrict mouse input to canvas