%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3/dist-packages/libevdev/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3/dist-packages/libevdev/__pycache__/event.cpython-312.pyc

�

�o�Z
��*�ddlmZmZGd�de�Zy)�)�	EventType�	EventCodec�L�eZdZdZd	d�Zed��Zed��Zd
d�Zd�Z	d�Z
y)�
InputEventaN
    Represents one input event of type struct input_event as defined in
    ``linux/input.h`` and returned by ``libevdev_next_event()``.

    Comparison between events can be done via the :func:`matches()` function
    or by comparing two input events. Two events match when their most
    precise attribute match and all other attributes are None::

        >>> e = InputEvent(libevdev.EV_REL.REL_X, value=1)
        >>> e == InputEvent(libevdev.EV_REL)
        True
        >>> e == InputEvent(libevdev.EV_ABS)
        True
        >>> e == InputEvent(libevdev.EV_REL.REL_X)
        True
        >>> e == InputEvent(libevdev.EV_REL.REL_Y)
        False
        >>> e == InputEvent(libevdev.EV_REL.REL_X, value=1)
        True
        >>> e == InputEvent(libevdev.EV_REL.REL_X, value=2)
        False

    .. attribute:: code

        The :class:`EventCode` or :class:`EventType` for this input event

    .. attribute:: value

        The (optional) value for the event's axis

    .. attribute:: sec

        The timestamp, seconds

    .. attribute:: usec

        The timestamp, microseconds
    Nc���t|t�st|t�sJ�t|t�r|j|_||_n||_d|_||_||_||_y�N)	�
isinstancerr�type�_type�_code�sec�usec�value)�self�coderr
rs     �0/usr/lib/python3/dist-packages/libevdev/event.py�__init__zInputEvent.__init__BsZ���$�	�*�j��y�.I�I�I��d�I�&����D�J��D�J��D�J��D�J������	���
�c��|jS)zY
        :return: the EventCode for this event or None
        :rtype: EventCode
        )r�rs rrzInputEvent.codeO����z�z�rc��|jS)zR
        :return: the event type for this event
        :rtype: EventType
        )rrs rr
zInputEvent.typeWrrc��|�|j�|j|k7ryt|t�r|j|k(S|j|k(S)a
        :param code: the event type or code
        :type code: EventType or EventCode
        :param value: optional, the event value
        :return: True if the type matches this event's type and this event's
                 code matches the given code (if any) and this event's value
                 matches the given value (if any)

        Check if an event matches a given event type and/or code. The
        following invocations show how to match on an event type, an event
        code and an event code with a specific value::


                if ev.matches(libevdev.EV_REL):
                        pass

                if ev.matches(libevdev.EV_REL.REL_X):
                        pass

                if ev.matches(libevdev.EV_REL.REL_X, 1):
                        pass
        F)rr	rrr)rrrs   r�matcheszInputEvent.matches_sI��0�����!7�D�J�J�%�<O���d�I�&��:�:��%�%��:�:��%�%rc���t|t�sy|j�|j�&|j|j|j
�S|j|j|j
�S)NF)r	rrrr
r)r�others  r�__eq__zInputEvent.__eq__sT���%��,���9�9���
�
� 2��<�<��
�
�E�K�K�8�8��|�|�E�J�J����4�4rc��|jj}d}|j�|jj}dj|||j�S)NzInputEvent({}, {}, {}))r
�namer�formatr)r�tname�cnames   r�__repr__zInputEvent.__repr__�sD���	�	�������9�9� ��I�I�N�N�E�'�.�.�u�e�T�Z�Z�H�Hr)N�r$r)�__name__�
__module__�__qualname__�__doc__r�propertyrr
rrr#�rrrrsF��%�N���������&�@5�IrrN)�constrr�objectrr*rr�<module>r-s��.(�sI��sIr

Zerion Mini Shell 1.0