
    iz$                         d Z ddlZddlmZmZ ddlmZ  G d dej                        Z G d de	      Z
 G d	 d
e      Zy)z
This module contains the base implementation.

The actual interface to mouse classes is defined here, but the implementation
is located in a platform dependent module.
    N)AbstractListenerprefix)_loggerc                        e Zd ZdZdZdZdZdZy)ButtonzThe various buttons.

    The actual values for these items differ between platforms. Some
    platforms may have additional buttons, but these are guaranteed to be
    present everywhere.
    r            N)__name__
__module____qualname____doc__unknownleftmiddleright     \/home/obispo/Crisostomo_bridge/mision_env/lib/python3.12/site-packages/pynput/mouse/_base.pyr   r   !   s#     G D F Er   r   c                       e Zd ZdZd Zed        Zej                  d        Zd Zd Z	d Z
d Zdd	Zd
 Zd Zd Zd Zd Zd Zd Zy)
ControllerzAA controller for sending virtual mouse events to the system.
    c                 8    t        | j                        | _        y N)r   	__class___logselfs    r   __init__zController.__init__8   s    DNN+	r   c                 "    | j                         S )zThe current position of the mouse pointer.

        This is the tuple ``(x, y)``, and setting it will move the pointer.
        )_position_getr   s    r   positionzController.position;   s     !!##r   c                 &    | j                  |       y r   )_position_setr   poss     r   r!   zController.positionC   s    3r   c                 (    | j                  ||       y)a9  Sends scroll events.

        :param int dx: The horizontal scroll. The units of scrolling is
            undefined.

        :param int dy: The vertical scroll. The units of scrolling is
            undefined.

        :raises ValueError: if the values are invalid, for example out of
            bounds
        N)_scrollr   dxdys      r   scrollzController.scrollG   s     	Rr   c                 &    | j                  |       y)zpEmits a button press event at the current position.

        :param Button button: The button to press.
        N)_pressr   buttons     r   presszController.pressU   s    
 	Fr   c                 &    | j                  |       y)ztEmits a button release event at the current position.

        :param Button button: The button to release.
        N)_releaser.   s     r   releasezController.release\   s    
 	fr   c                 ^    t        d t        | j                  ||f      D              | _        y)a  Moves the mouse pointer a number of pixels from its current
        position.

        :param int dx: The horizontal offset.

        :param int dy: The vertical offset.

        :raises ValueError: if the values are invalid, for example out of
            bounds
        c              3   2   K   | ]  }t        |        y wr   )sum).0is     r   	<genexpr>z"Controller.move.<locals>.<genexpr>n   s     Kc!fKs   N)tuplezipr!   r(   s      r   movezController.movec   s%     Kc$--"b.JKKr   c                     | 5 }t        |      D ]$  }|j                  |       |j                  |       & 	 ddd       y# 1 sw Y   yxY w)zEmits a button click event at the current position.

        The default implementation sends a series of press and release events.

        :param Button button: The button to click.

        :param int count: The number of clicks to send.
        N)ranger0   r3   )r   r/   count
controller_s        r   clickzController.clickp   sM      	+Z5\ +  (""6*+	+ 	+ 	+s   3A  A	c                     | S )a	  Begins a series of clicks.

        In the default :meth:`click` implementation, the return value of this
        method is used for the calls to :meth:`press` and :meth:`release`
        instead of ``self``.

        The default implementation is a no-op.
        r   r   s    r   	__enter__zController.__enter__~   s	     r   c                      y)z!Ends a series of clicks.
        Nr   )r   exc_typevalue	tracebacks       r   __exit__zController.__exit__   s     	r   c                     t               )zuThe implementation of the getter for :attr:`position`.

        This is a platform dependent implementation.
        NotImplementedErrorr   s    r   r    zController._position_get       
 "##r   c                     t               )zuThe implementation of the setter for :attr:`position`.

        This is a platform dependent implementation.
        rK   r$   s     r   r#   zController._position_set   rM   r   c                     t               )zoThe implementation of the :meth:`scroll` method.

        This is a platform dependent implementation.
        rK   r(   s      r   r'   zController._scroll   rM   r   c                     t               )znThe implementation of the :meth:`press` method.

        This is a platform dependent implementation.
        rK   r.   s     r   r-   zController._press   rM   r   c                     t               )zpThe implementation of the :meth:`release` method.

        This is a platform dependent implementation.
        rK   r.   s     r   r2   zController._release   rM   r   N)r   )r   r   r   r   r   propertyr!   setterr+   r0   r3   r<   rB   rD   rI   r    r#   r'   r-   r2   r   r   r   r   r   5   su    , $ $ __   L+	
$$$$$r   r   c                   (     e Zd ZdZ	 	 d fd	Z xZS )Listenerag  A listener for mouse events.

    Instances of this class can be used as context managers. This is equivalent
    to the following code::

        listener.start()
        try:
            listener.wait()
            with_statements()
        finally:
            listener.stop()

    This class inherits from :class:`threading.Thread` and supports all its
    methods. It will set :attr:`daemon` to ``True`` when created.

    All callback arguments are optional; a callback may take less arguments
    than actually passed, but not more, unless they are optional.

    :param callable on_move: The callback to call when mouse move events occur.

        It will be called with the arguments ``(x, y, injected)``, where ``(x,
        y)`` is the new pointer position and ``injected`` whether the event was
        injected and thus not generated by an actual input device. If this
        callback raises :class:`StopException` or returns ``False``, the
        listener is stopped.

        Please note that not all backends support ``injected`` and will always
        set it to ``False``.

    :param callable on_click: The callback to call when a mouse button is
        clicked.

        It will be called with the arguments ``(x, y, button, pressed,
        injected)``, where ``(x, y)`` is the new pointer position, ``button``
        is one of the :class:`Button`, ``pressed`` is whether the button was
        pressed and ``injected`` whether the event was injected and thus not
        generated by an actual input device.

        If this callback raises :class:`StopException` or returns ``False``,
        the listener is stopped.

        Please note that not all backends support ``injected`` and will always
        set it to ``False``.

    :param callable on_scroll: The callback to call when mouse scroll
        events occur.

        It will be called with the arguments ``(x, y, dx, dy, injected)``,
        where ``(x, y)`` is the new pointer position, and ``(dx, dy)`` is the
        scroll vector and ``injected`` whether the event was injected and thus
        not generated by an actual input device.

        If this callback raises :class:`StopException` or returns ``False``,
        the listener is stopped.

        Please note that not all backends support ``injected`` and will always
        set it to ``False``.

    :param bool suppress: Whether to suppress events. Setting this to ``True``
        will prevent the input events from being passed to the rest of the
        system.

    :param kwargs: Any non-standard platform dependent options. These should be
        prefixed with the platform name thus: ``darwin_``, ``xorg_`` or
        ``win32_``.

        Supported values are:

        ``darwin_intercept``
            A callable taking the arguments ``(event_type, event)``, where
            ``event_type`` is any mouse related event type constant, and
            ``event`` is a ``CGEventRef``.

            This callable can freely modify the event using functions like
            ``Quartz.CGEventSetIntegerValueField``. If this callable does not
            return the event, the event is suppressed system wide.

        ``win32_event_filter``
            A callable taking the arguments ``(msg, data)``, where ``msg`` is
            the current message, and ``data`` associated data as a
            `MSLLHOOKSTRUCT <https://docs.microsoft.com/en-gb/windows/win32/api/winuser/ns-winuser-msllhookstruct>`_.

            If this callback returns ``False``, the event will not
            be propagated to the listener callback.

            If ``self.suppress_event()`` is called, the event is suppressed
            system wide.
    c                    t        | j                        | _        t        t        | j                        }|j                         D ci c]%  \  }}|j                  |      r|t        |      d  |' c}}| _        t        t        | +  | j                  |d      | j                  |d      | j                  |d      |       y c c}}w )Nr
      )on_moveon_click	on_scrollsuppress)r   r   r   r   rU   items
startswithlen_optionssuperr   _wrap)
r   rX   rY   rZ   r[   kwargsoption_prefixkeyrG   r   s
            r   r   zListener.__init__  s    DNN+	x8 %lln.U~~m, M"#$e+. 	h&JJw*ZZ!,jjA.	 	' 		.s   	*C)NNNF)r   r   r   r   r   __classcell__)r   s   @r   rU   rU      s    Wp ?C r   rU   )r   enumpynput._utilr   r   pynputr   Enumr   objectr   rU   r   r   r   <module>rk      sC   "  1 TYY (z$ z$|e er   