+
    i2  c                   s   ^ RI t ^ RIt^ RIHtHtHtHtHtHtH	t	H
t
HtHt ^RIHtHtHt  ^RIHtHt ]
! R]]4      t ! R R]4      t ! R R	]4      t ! R
 R]4      t ! R R]]],          4      tR#   ] d    ^RIHtHt  LQi ; i)i    N)
DictGenericIteratorListLiteral
NamedTupleTupleTypeVarUnionoverload)_inputecodesutil)
EvdevErrorEventIO_AnyStrc                   s6   a  ] tR t^t o RtR tV 3R ltRtV tR# )AbsInfoah  Absolute axis information.

A ``namedtuple`` with absolute axis information -
corresponds to the ``input_absinfo`` struct:

Attributes
---------
value
  Latest reported value for the axis.

min
  Specifies minimum value for the axis.

max
  Specifies maximum value for the axis.

fuzz
  Specifies fuzz value that is used to filter noise from the
  event stream.

flat
  Values that are within this value will be discarded by joydev
  interface and reported as 0 instead.

resolution
  Specifies resolution for the values reported for the axis.
  Resolution for main axes (``ABS_X, ABS_Y, ABS_Z``) is reported
  in units per millimeter (units/mm), resolution for rotational
  axes (``ABS_RX, ABS_RY, ABS_RZ``) is reported in units per
  radian.

Note
----
The input core does not clamp reported values to the ``[minimum,
maximum]`` limits, such task is left to userspace.

c                s"    R P                   ! V !  # )z2value {}, min {}, max {}, fuzz {}, flat {}, res {}formatself   &3/usr/lib64/python3.14/site-packages/evdev/device.py__str__ZAbsInfo.__str__=   s    CJJDQQ    c                sb   < V ^8  d   Qh/ S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   # )   valueminmaxfuzzflat
resolutionintr   __classdict__   "r   __annotate__ZAbsInfo.__annotate__   sY     N JO P 
HQ R 
HS T IU V IW X OY r    N	__name__
__module____qualname____firstlineno____doc__r   Z__annotate_func____static_attributes____classdictcell__r#      @r   r   r      s     $ZR]  r   r   c                   s6   a  ] tR t^At o RtR tV 3R ltRtV tR# )KbdInfozKeyboard repeat rate.

Attributes
----------
delay
  Amount of time that a key must be depressed before it will start
  to repeat (in milliseconds).

repeat
  Keyboard repeat rate in characters per second.
c                sN    R P                  V P                  V P                  4      # )zdelay {}, repeat {})r   delayrepeatr   r   r   r   ZKbdInfo.__str__Q   s    $++DJJDDr   c                s2   < V ^8  d   Qh/ S[ ;R&   S[ ;R&   # )r   r2   r3   r    r"   r$   r   r%   ZKbdInfo.__annotate__A   s      J  K r   r&   Nr'   r/   r0   r   r1   r1   A   s     
E!  r   r1   c                   sB   a  ] tR t^Ut o RtV 3R lR ltV 3R ltRtV tR# )
DeviceInfoz6
Attributes
----------
bustype
vendor
product
version
c                    < V ^8  d   QhRS[ /# r   returnstrr"   r$   r   r%   DeviceInfo.__annotate__d   s     ! ! !r   c                s&    R pVP                   ! V !  # )z:bus: {:04x}, vendor {:04x}, product {:04x}, version {:04x}r   r   Zmsg   & r   r   ZDeviceInfo.__str__d   s    Jzz4  r   c                sJ   < V ^8  d   Qh/ S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   # )r   ZbustypeZvendorZproductversionr    r"   r$   r   r%   r:   U   s5      L  K  L  L r   r&   Nr'   r/   r0   r   r4   r4   U   s     ! !  r   r4   c                   s:  a a ] tR t^it oRtR0tV3R lR ltV3R lR ltR1V3R lR llt]	R2V3R lR	 ll4       t
]	R3V3R
 lR ll4       t
R4V3R lR llt
R5V3R lR lltR5V3R lR lltV3R lR ltR tV3R lR ltV3R lR ltR tV3R lV 3R lltV3R lR ltV3R lR lt]P,                  V3R  lR! l4       tV3R" lR# ltV3R$ lR% lt]R& 4       t]P8                  V3R' lR( l4       tR5V3R) lR* lltV3R+ lR, ltR6V3R- lR. lltR/t Vt!V ;t"# )7InputDevicez;
A linux input device from which input events can be read.
c                s4   < V ^8  d   QhRS[ S[R3,          /# )r   devzos.PathLike[_AnyStr])r   r   r"   r$   r   r%   InputDevice.__annotate__p   s"     *D *DE'+A"AB *Dr   c                s   \        VR4      '       g   TMVP                  4       V n         \        P                  ! V\        P
                  \        P                  ,          4      pW n	        \        P                  ! V P                  4      p\        VR,          !  V n        V^,          V n        V^,          V n        V^,          V n        \        P"                  ! V P                  4      V n        \        P&                  ! V P                  4      V n        \        P*                  ! V P                  4      V n        R#   \         d?    \        P                  ! T\        P                  \        P                  ,          4      p ELi ; i)zE
Arguments
---------
dev : str|bytes|PathLike
  Path to input device

__fspath__:Ni   NN)hasattrrA   pathosZopenZO_RDWRZ
O_NONBLOCKOSErrorZO_RDONLYfdr
   Zioctl_devinfor4   infonamephysuniqZioctl_EVIOCGVERSIONr=   Zioctl_capabilities_rawcapabilitiesZioctl_EVIOCGEFFECTSff_effects_count)r   r?   rF   Zinfo_res   &&  r   __init__ZInputDevice.__init__p   s    )0\(B(BSHX		;bii"--78B
  ''0 -	 "!	 "!	 "!	 #66tww? !' 9 9$'' B !' : :477 C9  	;bkkBMM9:B	;s   :D; ;AFFc                   < V ^8  d   QhRR/# r   r7   Nr&   r"   r$   r   r%   r@      s       r   c                s    \        V R 4      '       d$   V P                  e    V P                  4        R# R# R#   \        \        \
        3 d     R# i ; i)rF   N)rB   rF   closerE   ImportErrorZAttributeErrorr   r   r   __del__ZInputDevice.__del__   sI    4477#6

 $7 [.9 s   8 AAc                r5   )r   absinfoboolr"   r$   r   r%   r@      s      T r   c                st   / pV P                   P                  4        F  w  r4V F  pVP                  V. 4      p\        V\        4      '       dQ   V'       d/   V^,          p\        V!  pVP                  V^ ,          V34       Ka  VP                  V^ ,          4       K{  VP                  V4       K  	  K  	  V# )   )rK   ZitemsZ
setdefault
isinstanceZtupler   Zappend)	r   rT   ZresZetypeZ_ecodesZcodeZlZaZis	   &&       r   _capabilitiesZInputDevice._capabilities   s    "3399;NENN5"-dE** G#QK$q'1.a)HHTN   < 
r   c          	      s`   < V ^8  d   QhRS[ R,          RS[RS[S[S[S[,          3,          /# )r   verboseFrT   r7   )r   rV   r    r!   r   r"   r$   r   r%   r@      s9      GEN 4 RVWZ\`ad\eWeRf r   c                    R # Nr&   r   rZ   rT      &&&r   capabilitiesInputDevice.capabilities       r   c                s   < V ^8  d   QhRS[ R,          RS[RS[S[S[S[3,          S[S[S[S[3,          ,          3,          /# )r   rZ   TrT   r7   )r   rV   r    r   r9   r!   r   r"   r$   r   r%   r@      sP      GDM D 4PUVY[^V^P_aefkloqtltfuavPvKw r   c                r[   r\   r&   r]   r^   r   r_   r`      ra   r   c                s   < V ^8  d   QhRS[ RS[ RS[S[S[S[S[,          3,          S[S[S[S[3,          S[S[S[S[3,          ,          3,          3,          /# )r   rZ   rT   r7   )rV   r   r    r!   r   r   r9   r"   r$   r   r%   r@      s     +/ +/D +/4 +/5QUVY[_`c[dVdQegklqruwzrzl{  ~B  CH  IL  NQ  IQ  CR  ~S  mS  hT  RT  LU +/r   c                s    V'       d/   \        \        P                  ! V P                  V4      4      4      # V P                  V4      # )a8  
Return the event types that this device supports as a mapping of
supported event types to lists of handled event codes.

Example
--------
>>> device.capabilities()
{ 1: [272, 273, 274],
  2: [0, 1, 6, 8] }

If ``verbose`` is ``True``, event codes and types will be resolved
to their names.

::

  { ('EV_KEY', 1): [('BTN_MOUSE', 272),
                    ('BTN_RIGHT', 273),
                    ('BTN_MIDDLE', 273)],
    ('EV_REL', 2): [('REL_X', 0),
                    ('REL_Y', 1),
                    ('REL_HWHEEL', 6),
                    ('REL_WHEEL', 8)] }

Unknown codes or types will be resolved to ``'?'``.

If ``absinfo`` is ``True``, the list of capabilities will also
include absolute axis information in the form of
:class:`AbsInfo` instances::

  { 3: [ (0, AbsInfo(min=0, max=255, fuzz=0, flat=0)),
         (1, AbsInfo(min=0, max=255, fuzz=0, flat=0)) ]}

Combined with ``verbose`` the above becomes::

  { ('EV_ABS', 3): [ (('ABS_X', 0), AbsInfo(min=0, max=255, fuzz=0, flat=0)),
                     (('ABS_Y', 1), AbsInfo(min=0, max=255, fuzz=0, flat=0)) ]}

)Zdictr   Zresolve_ecodes_dictrY   r]   r^   r   r_   r`      s:    P 001C1CG1LMNN%%g..r   c                r5   r   rZ   rU   r"   r$   r   r%   r@      s      4 r   c                s    \         P                  ! V P                  4      pV'       d&   \        P                  ! \
        P                  V4      # V# )a  
Get device properties and quirks.

Example
-------
>>> device.input_props()
[0, 5]

If ``verbose`` is ``True``, input properties are resolved to their
names. Unknown codes are resolved to ``'?'``::

[('INPUT_PROP_POINTER', 0), ('INPUT_PROP_POINTING_STICK', 5)]

)r
   Zioctl_EVIOCGPROPrF   r   resolve_ecodesr   Z
INPUT_PROP)r   rZ   Zprops   && r   input_propsZInputDevice.input_props   s9     ''0&&v'8'8%@@r   c                r5   rb   rU   r"   r$   r   r%   r@      s      D r   c                    \         P                  ! V P                  \        P                  4      pV'       d&   \
        P                  ! \        P                  V4      # V# )a  
Return currently set LED keys.

Example
-------
>>> device.leds()
[0, 1, 8, 9]

If ``verbose`` is ``True``, event codes are resolved to their
names. Unknown codes are resolved to ``'?'``::

[('LED_NUML', 0), ('LED_CAPSL', 1), ('LED_MISC', 8), ('LED_MAIL', 9)]

)r
   ioctl_EVIOCG_bitsrF   r   EV_LEDr   rc   ZLED)r   rZ   ledsrd   r   ri   ZInputDevice.leds   s=     ''?&&vzz488r   c                s*   < V ^8  d   QhRS[ RS[ RR/# )r   led_numr   r7   Nr    r"   r$   r   r%   r@     s"     2 2s 23 24 2r   c                sF    V P                  \        P                  W4       R# )z\
Set the state of the selected LED.

Example
-------
>>> device.set_led(ecodes.LED_NUML, 1)
N)Zwriter   rh   )r   rj   r   r^   r   set_ledZInputDevice.set_led  s     	

6=='1r   c                s    \        WP                  4      ;'       d;    V P                  VP                  8H  ;'       d    V P                  VP                  8H  # )zC
Two devices are equal if their :data:`info` attributes are equal.
)rX   	__class__rG   rC   )r   Zother   &&r   __eq__ZInputDevice.__eq__  sC     %0hhTYY%**5LhhQUQZQZ^c^h^hQhhr   c                r5   r6   r8   r"   r$   r   r%   r@   "  s     L L Lr   c                s    R pTP                  V P                  V P                  V P                  V P                  ;'       g    R4      # )z*device {}, name "{}", phys "{}", uniq "{}" )r   rC   rH   rI   rJ   r;   r<   r   r   ZInputDevice.__str__"  s2    :zz$))TYY		499??KKr   c                r5   r6   r8   r"   r$   r   r%   r@   &  s     ' '# 'r   c                sf    V P                   P                  V P                  3pR P                  ! V!  # )z{}({!r}))rl   r(   rC   r   r;   r<   r   __repr__ZInputDevice.__repr__&  s+    ~~&&		2  #&&r   c                s    V P                   # r\   )rC   r   r   r   rA   ZInputDevice.__fspath__*  s    yyr   c                rO   rP   r&   r"   r$   r   r%   r@   -  s      t r   c                s   < V P                   R8  d9    \        SV `	  4        \        P                  ! V P                   4       RV n         R# R#   RT n         i ; i)rW   Ni)rF   ZsuperrQ   rD   )r   rl   s   &r   rQ   ZInputDevice.close-  sC    77R<! 
 s   .A 	Ac                rO   rP   r&   r"   r$   r   r%   r@   5  s     + +d +r   c                sH    \         P                  ! V P                  ^4       R# )a  
Grab input device using ``EVIOCGRAB`` - other applications will
be unable to receive events until the device is released. Only
one process can hold a ``EVIOCGRAB`` on a device.

Warning
-------
Grabbing an already grabbed device will raise an ``OSError``.
Nr
   Zioctl_EVIOCGRABrF   r   r   r   grabZInputDevice.grab5  s     	tww*r   c                rO   rP   r&   r"   r$   r   r%   r@   B  s     
+ 
+ 
+r   c                sH    \         P                  ! V P                  ^ 4       R# )z
Release device if it has been already grabbed (uses `EVIOCGRAB`).

Warning
-------
Releasing an already released device will raise an
``OSError('Invalid argument')``.
Nrq   r   r   r   ungrabZInputDevice.ungrabB  s     	tww*r   c                s.   < V ^8  d   QhRS[ R,          /# rP   )r   r"   r$   r   r%   r@   O  s      htn r   c              #  sV   "   V P                  4        Rx  V P                  4        R# 5i)zv
A context manager for the duration of which only the current
process will be able to receive events from the device.
N)rr   rs   r   r   r   grab_contextZInputDevice.grab_contextN  s      			s   ')c                rO   )r   effectz	ff.Effectr&   r"   r$   r   r%   r@   X  s      K r   c                sz    \        V4      P                  4       p\        P                  ! V P                  V4      pV# )z<
Upload a force feedback effect to a force feedback device.
)Z
memoryviewZtobytesr
   upload_effectrF   )r   ru   Zdataff_idrM   r   rv   ZInputDevice.upload_effectX  s2    
 &!))+$$TWWd3r   c                rO   rP   r&   r"   r$   r   r%   r@   a  s     , ,T ,r   c                sH    \         P                  ! V P                  V4       R# )zP
Erase a force effect from a force feedback device. This also
stops the effect.
N)r
   erase_effectrF   )r   rw   rm   r   rx   ZInputDevice.erase_effecta  s     	DGGU+r   c                sP    \        \        P                  ! V P                  4      !  # )z]
Get or set the keyboard repeat rate (in characters per
minute) and delay (in milliseconds).
)r1   r
   Zioctl_EVIOCGREPrF   r   r   r   r3   InputDevice.repeati  s     ..tww788r   c                s6   < V ^8  d   QhRS[ S[S[3,          /# )r   r   )r   r!   r"   r$   r   r%   r@   s  s     7 7E#s(O 7r   c                sF    \         P                  ! V P                  .VO5!  # r\   )r
   Zioctl_EVIOCSREPrF   )r   r   rm   r   r3   ry   r  s    %%dgg666r   c                r5   rb   rU   r"   r$   r   r%   r@   v  s      4 r   c                rf   )z
Return currently active keys.

Example
-------

>>> device.active_keys()
[1, 42]

If ``verbose`` is ``True``, key codes are resolved to their
verbose names. Unknown codes are resolved to ``'?'``. For
example::

  [('KEY_ESC', 1), ('KEY_LEFTSHIFT', 42)]

)r
   rg   rF   r   ZEV_KEYr   rc   ZKEY)r   rZ   active_keysrd   r   rz   ZInputDevice.active_keysv  s>    " ..twwF&&vzz;??r   c                r5   )r   axis_numr    r"   r$   r   r%   r@     s     C C Cr   c                sR    \        \        P                  ! V P                  V4      !  # )a  
Return current :class:`AbsInfo` for input device axis

Arguments
---------
axis_num : int
  EV_ABS keycode (example :attr:`ecodes.ABS_X`)

Example
-------
>>> device.absinfo(ecodes.ABS_X)
AbsInfo(value=1501, min=-32768, max=32767, fuzz=0, flat=128, resolution=0)
)r   r
   Zioctl_EVIOCGABSrF   )r   r{   rm   r   rT   ZInputDevice.absinfo  s      ..twwABBr   c                s$   < V ^8  d   QhRS[ RR/# )r   r{   r7   Nr    r"   r$   r   r%   r@     s     ? ?C ?sw ?r   c                sJ   V P                  V4      p\        Ve   TMVP                  Ve   TMVP                  Ve   TMVP                  Ve   TMVP
                  Ve   TMVP                  Ve   TMVP                  4      p	\        P                  ! V P                  W4       R# )aw  
Update :class:`AbsInfo` values. Only specified values will be overwritten.

Arguments
---------
axis_num : int
  EV_ABS keycode (example :attr:`ecodes.ABS_X`)

Example
-------
>>> device.set_absinfo(ecodes.ABS_X, min=-2000, max=2000)

You can also unpack AbsInfo tuple that will overwrite all values

>>> device.set_absinfo(ecodes.ABS_Y, *AbsInfo(0, -2000, 2000, 0, 15, 0))
N)rT   r   r   r   r   r   r   r   r
   Zioctl_EVIOCSABSrF   )
r   r{   r   r   r   r   r   r   Zcur_absinfoZnew_absinfos
   &&&&&&&&  r   set_absinfoZInputDevice.set_absinfo  s    $ ll8,&EK,=,=?C?C$D+*:*:$D+*:*:$0Jk6L6L
 	tww>r   )	rK   rF   rL   rG   rH   rC   rI   rJ   r=   )	rC   rF   rG   rH   rI   rJ   rK   r=   rL   )T)..).)FT)F)NNNNNN)#r(   r)   r*   r+   r,   Z	__slots__rN   rS   rY   r	   r_   re   ri   rk   rn   r   rp   rA   rQ   rr   rs   
contextlibZcontextmanagerrt   rv   rx   Zpropertyr3   Zsetterrz   rT   r|   r-   r.   Z__classcell__)rl   r#   s   @@r   r>   r>   i   sJ     rI*D *DX  $     +/ +/Z * *2 2iL L' ' + +
+ 
+   , , 9 9 ]]7 7 .C C ? ? ?r   r>   )r}   rD   Ztypingr    r   r   r   r   r   r   r   r   r	   ro   r
   r   r   Zeventio_asyncr   r   rR   Zeventior9   Zbytesr   r   r1   r4   r>   r&   r   r   <module>r~      s     	 f f f " "-2 )S%
(/Rj /RdEj E(! !(O?'77+ O?A  -,,-s   A4 4BB