code: def kp_pan_zoom_set(self, viewer, event, data_x, data_y, msg=True):
          
          if self.canpan:
              reg = 1
              with viewer.suppress_redraw:
                  viewer.panset_xy(data_x, data_y)
                  scale_x, scale_y = self._save.get((viewer, 'scale', reg),
                                                    (1.0, 1.0))
                  viewer.scale_to(scale_x, scale_y)
          return True
docs: Sets the pan position under the cursor.