def METHOD_NAME(self, window):
    # Ensure that the primary mouse button is the *left* button before
    #  sending events.
    primary_changed = windll.user32.SwapMouseButton(0)
    try:
        # Prepare and send the mouse events.
        zero = pointer(c_ulong(0))
        inputs = [MouseInput(0, 0, flag[1], flag[0], 0, zero)
                  for flag in self._flags]
        array = make_input_array(inputs)
        # Try using Natlink to send input, if appropriate.  Otherwise,
        #  use SendInput.
        if not (self.try_natlink and send_input_array_natlink(array)):
            send_input_array(array)
    finally:
        # Swap the primary mouse button back if it was previously set
        #  to *right*.
        if primary_changed:
            windll.user32.SwapMouseButton(1)