+
     h3  c                   s    ^ RI t ^ RIHt ^RIHt ^ RIt] ! R R4      4       t ! R R]4      t ! R R	]4      t ! R
 R]4      t	RR lt
R tR t] P                  P                  R4      '       g
   ]! 4        R# R# )i    N)total_ordering)Libevdevc                   s<   a  ] tR t^t o RtR tR tR tR tRt	V t
R# )EvdevBita  
Base class representing an evdev bit, comprised of a name and a value.
These two properties are guaranteed to exist on anything describing an
event code, event type or input property that comes out of libevdev::

    >>> print(libevdev.EV_ABS.name)
    EV_ABS
    >>> print(libevdev.EV_ABS.value)
    3
    >>> print(libevdev.EV_SYN.SYN_REPORT.name)
    SYN_REPORT
    >>> print(libevdev.EV_SYN.SYN_REPORT.value)
    0
    >>> print(libevdev.INPUT_PROP_DIRECT.name)
    INPUT_PROP_DIRECT
    >>> print(libevdev.INPUT_PROP_DIRECT.value)
    1

.. attribute:: value

    The numeric value of the event code

.. attribute:: name

    The string name of this event code
c                sN    R P                  V P                  V P                  4      # )z{}:{})formatnamevalueself   &3/usr/lib/python3.14/site-packages/libevdev/const.py__repr__ZEvdevBit.__repr__;   s    ~~dii44    c                s4    V P                   VP                   8H  # Nr   r   Zother   &&r	   __eq__ZEvdevBit.__eq__>   s    zzU[[((r   c                s4    V P                   VP                   8  # r   r   r   r   r	   __lt__ZEvdevBit.__lt__A   s    zzEKK''r   c                    V P                   # r   r   r   r   r	   __int__ZEvdevBit.__int__D       zzr    N)__name__
__module____qualname____firstlineno____doc__r
   r   r   r   __static_attributes____classdictcell__Z__classdict__   @r	   r   r      s#     65)( r   r   c                   sB   a  ] tR t^Ht o Rt]P                  tR tRtV t	R# )	EventCodea  
.. warning ::

    Do not instantiate an object of this class, all objects you'll ever need
    are already present in the libevdev namespace. Use :func:`evbit()`
    to get an :class:`EventCode` from numerical or string values.

A class representing an evdev event code, e.g. libevdev.EV_ABS.ABS_X.
To use a :class:`EventCode`, use the namespaced name directly::

    >>> print(libevdev.EV_ABS.ABS_X)
    ABS_X:0
    >>> print(libevdev.EV_ABS.ABS_Y)
    ABS_X:1
    >>> code = libevdev.EV_REL.REL_Y
    >>> print(code.type)
    EV_REL:2
    >>> int(code)
    1

.. attribute:: value

    The numeric value of the event code. This value is also returned when
    the object is converted to ``int``.

.. attribute:: name

    The string name of this event code. Where the name is not defined, a
    fake name is generated by this module, consisting of the prefix and
    the uppercase hexadecimal value, e.g. ``REL_0B``. These generated
    names (see :func:`EventCode.is_defined()`) should never be used as
    input.

    Note that even defined names are not a stable API. From time to time
    the kernel introduces a new name and aliases the old one. The same
    numeric event code may then return a different name than before.
    This does not affect the :func:`evbit()` function which continues to
    return the correct event code.

.. attribute:: type

    The :class:`EventType` for this event code

.. attribute:: is_defined

    ``True`` if this event bit has a ``#define`` in the kernel header.
    :class:`EventCode` objects not defined in the header have a name
    composed of the type name plus the hex code, e.g. ``KEY_2E8``.

    Usually you will not need to check this property unless you need to
    filter for known codes only.
c                s    \        V\        4      '       g   R # V P                  VP                  8H  ;'       d    V P                  VP                  8H  # )F)
isinstancer   r   typer   r   r	   r   ZEventCode.__eq__   s:    %++zzU[[(DDTYY%**-DDr   r   N
r   r   r   r   r   super__hash__r   r   r   r   r   r	   r   r   H   s"     3h ~~HE Er   r   c                   sH   a  ] tR t^t o Rt]P                  tR tR tRt	V t
R# )	EventTypea"  
.. warning ::

    Do not instantiate an object of this class, all objects you'll ever need
    are already present in the libevdev namespace. Use :func:`evbit()`
    to get an :class:`EventType` from numerical or string values.

A class represending an evdev event type (e.g. EV_ABS). All event codes
within this type are available as class constants::

    >>> print(libevdev.EV_ABS)
    EV_ABS:3
    >>> print(libevdev.EV_ABS.ABS_X)
    ABS_X:0
    >>> print(int(libevdev.EV_ABS.ABS_Y))
    1
    >>> print(libevdev.EV_ABS.max)
    63
    >>> print(libevdev.EV_ABS.ABS_MAX)
    63
    >>> for code in libevdev.EV_ABS.codes[:3]:
    ...     print(code)
    ...
    ABS_X:0
    ABS_Y:1
    ABS_Z:2

.. attribute:: value

    The numeric value of the event type. This value is also returned when
    the object is converted to ``int``.

.. attribute:: name

    The string name of this event type

.. attribute:: codes

    A list of :class:`EventCode` objects for this type

.. attribute:: max

    The maximum event code permitted in this type as integer
c                d    \        V\        4      '       g   Q hV P                  VP                  8H  # r   )r    r%   r   r   r   r	   r   ZEventType.__eq__   s(    %++++zzU[[((r   c                r   r   r   r   r   r	   r   ZEventType.__int__   r   r   r   N)r   r   r   r   r   r#   r$   r   r   r   r   r   r   r	   r%   r%      s%     +X ~~H) r   r%   c                   sB   a  ] tR t^t o Rt]P                  tR tRtV t	R# )InputPropertyaN  
.. warning ::

    Do not instantiate an object of this class, all objects you'll ever need
    are already present in the libevdev namespace. Use :func:`propbit()`
    to get an :class:`InputProperty` from numerical or string values.

A class representing an evdev input property::

    >>> print(libevdev.INPUT_PROP_DIRECT)
    INPUT_PROP_DIRECT:1
    >> int(libevdev.INPUT_PROP_DIRECT)
    1

.. attribute:: value

    The numeric value of the property. This value is also returned when
    the object is converted to ``int``.

.. attribute:: name

    The string name of this property
c                r&   r   )r    r'   r   r   r   r	   r   ZInputProperty.__eq__   s(    %////zzU[[((r   r   Nr"   r   r   r	   r'   r'      s     . ~~H) )r   r'   c                s   Rp\         P                   F)  pVP                  V 8X  g   VP                  V 8X  g   K'  Tp M	  Vfo   \	        V \
        4      '       dY   V P                  R4      '       gB   \         P                   F-  pVP                   F  pVP                  V 8X  g   K  Vu u # 	  K/  	  Ve   Vf   V# RpVP                   F)  pVP                  V8X  g   VP                  V8X  g   K'  TpK+  	  V# )a  
Takes an event type and an (optional) event code and returns the Enum
representing that type or code, whichever applies. For example::

    >>> print(libevdev.evbit(0))
    EV_SYN:0

    >>> print(libevdev.evbit(2))
    EV_REL:2

    >>> print(libevdev.evbit(2, 1))
    REL_Y:1

    >>> print(libevdev.evbit(3, 4))
    ABS_RY:4

    >>> print(libevdev.evbit('EV_ABS'))
    EV_ABS:3

    >>> print(libevdev.evbit('EV_ABS', 'ABS_X'))
    ABS_X:0

A special case is the lookup of an string-based event code without
the type. Where the string identifier is unique, this will return the
right value.

    >>> print(libevdev.evbit('ABS_X'))
    ABS_X:0

The return value can be used in the libevdev API wherever an
:class:`EventCode` or :class:`EventType` is expected.

Notable behavior for invalid types or names:

* If the type does not exist, this function returns None
* If the type exists but the event code's numeric value does not have a
  symbolic name (and is within the allowed max of the type), this
  function returns a valid event code
* If the code is outside the allowed maximum for the given type, this
  function returns None
* If the type name exists but the string value is not a code name, this
  function returns None

Examples for the above behaviour::

    >>> print(libevdev.evbit(8))
    None
    >>> print(libevdev.evbit('INVALID'))
    None
    >>> print(libevdev.evbit('EV_ABS', 62))
    ABS_3E:62
    >>> print(libevdev.evbit('EV_ABS', 5000))
    None
    >>> print(libevdev.evbit('EV_ABS', 'INVALID'))
    None

:param evtype: the numeric value or string identifying the event type
:param evcode: the numeric value or string identifying the event code
:return: An event code value representing the code
:rtype: EventCode or EventType
NZEV_)libevdevtypesr   r   r    ZstrZ
startswithcodes)ZevtypeZevcodeZetypetcZecodes   &&    r	   evbitr-      s    | E^^77f& 0E 
 ~*VS11&:K:KE:R:RAWW66V#H   
 }E[[77f& 0E  Lr   c                s     \         P                   Uu. uF(  qP                  V 8X  g   VP                  V 8X  g   K&  VNK*  	  up^ ,          # u upi   \         d     R# i ; i)a  
Takes a property value and returns the :class:`InputProperty`
representing that property::

    >>> print(libevdev.propbit(0))
    INPUT_PROP_POINTER:0
    >>> print(libevdev.propbit('INPUT_PROP_POINTER'))
    INPUT_PROP_POINTER:0
    >>> print(libevdev.propbit(1000))
    None
    >>> print(libevdev.propbit('Invalid'))
    None

:param prop: the numeric value or string identifying the property
:return: the converted :class:`InputProperty` or None if it does not exist
:rtype: InputProperty
N)r(   propsr   r   Z
IndexError)Zpropps   & r	   propbitr0   1  sO    $#>>O>aWW_$>OPQRRO s'   A #AA	A A A A c                 s^   \        4        \         P                  ! R4      p V f   Q h. p\        V ^,           4       EF9  p\         P                  ! V4      pVf   K   \         P                  ! V4      p\        V\        3RVRVRV/4      pV! 4       p\        \        W64       VP                  V4       Vf   \        VR. 4       K  . p\        V^,           4       F  p\         P                  ! W(4      p	T	p
V	RJpV	f+   RP                  VR,          V4      p
R	P                  V
4      p	\        V	\        3R
VRV
RVRV/4      pV! 4       p\        WiV4       VP                  V4       K  	  \        VRV4       EK<  	  \        \        RV4       \         P                  ! R4      pVf   Q h. p\        V^,           4       F^  p\         P                  ! V4      pVf   K  \        V\        3RVRV/4      pV! 4       p\        \        VV4       VP                  V4       K`  	  \        \        RV4       R# )a!  
Loads all event type, code and property names and makes them available
as enums in the module. Use as e.g. libevdev.EV_SYN.SYN_REPORT.

Available are::

libevdev.types ... an list containing all event types, e.g.
                     libevdev.EV_TYPES.EV_REL

libevdev.EV_REL ... an enum containing all REL event types, e.g.
                    libevdev.EV_REL.REL_X. The name of each enum value
                    is the string of the code ('REL_X'), the value is the integer
                    value of that code.

libevdev.EV_ABS ... as above, but for EV_ABS

libevdev.EV_BITS ... libevdev.EV_FOO as an enum

Special attributes are (an apply to all EV_foo enums):
    libevdev.EV_REL.type ... the EV_TYPES entry of the event type
    libevdev.EV_REL.max  ... the maximum code in this event type
ZEV_MAXNr   r   Zmaxr*   z	{}_{:02X}:i   NNz_{}r!   Z
is_definedr)   ZINPUT_PROP_MAXr.   )r   Zevent_to_valueZrangeZevent_to_nameZtype_maxr!   r%   Zsetattrr(   Zappendr   r   Zproperty_to_valueZproperty_to_namer'   )Ztmaxr)   r+   ZtnameZcmaxZ	new_classZtype_objectr*   r,   Zcnamer   Zhas_nameZcode_objectZpmaxr.   r/   ZpnameZprop_objects                     r	   _load_constsr1   I  s   . J""8,DE4!8_&&q)=  #!1 %'(	
  k%-[!<K"-taxA**10EDD(H
 }"))%)Q7T*UYM$k$d%q*H67I
 $+KK4LL%' !* 	We,W \ Hgu%%%&67DE4!8_))!,= 1!1 %)*	  k%-[!  Hgu%r   ZREADTHEDOCSr   )ZosZ	functoolsr    Z_clibr   r(   r   r   r%   r'   r-   r0   r1   ZenvironZgetr   r   r	   <module>r2      s   . 
 $   & & &R;E ;E|4 4n)H )>Rj0^&B 
zz~~m$$N %r   