def METHOD_NAME(self, event, capture_mouse=True):
    self._original_xy = (event.x, event.y)
    if self.constrain_key is not None:
        if getattr(event, self.constrain_key + "_down"):
            self.constrain = True
            self._auto_constrain = True
            self.constrain_direction = None
    self.event_state = "panning"
    if capture_mouse:
        event.window.set_pointer(self.drag_pointer)
        event.window.set_mouse_owner(self, event.net_transform())
    event.handled = True