+
    iF  c                   s    ^ RI t ^ RIt^ RIt^ RIt^ RIHtHt ^RIHtH	t	H
t
 ^RIHt  ! R R]4      t ! R R4      tR# )	    N)IteratorUnion)_input_uinputecodes)
InputEventc                   s    ] tR t^tRtR# )
EvdevError N)__name__
__module____qualname____firstlineno____static_attributes__r       4/usr/lib64/python3.14/site-packages/evdev/eventio.pyr   r      s    r   r   c                   s   a  ] tR t^t o RtR tV 3R lR ltV 3R lR ltV 3R lR ltR	 t	R
 t
]	V 3R lR l4       tR tR tRtV tR# )EventIOa  
Base class for reading and writing input events.

This class is used by :class:`InputDevice` and :class:`UInput`.

- On, :class:`InputDevice` it used for reading user-generated events (e.g.
  key presses, mouse movements) and writing feedback events (e.g. leds,
  beeps).

- On, :class:`UInput` it used for writing user-generated events (e.g.
  key presses, mouse movements) and reading feedback events (e.g. leds,
  beeps).
c                s    V P                   # )z
Return the file descriptor to the open event device. This makes
it possible to pass instances directly to :func:`select.select()` and
:class:`asyncore.file_dispatcher`.
)fdself   &r   filenoZEventIO.fileno   s     wwr   c                0   < V ^8  d   QhRS[ S[,          /#    returnr   r   Zformat__classdict__   "r   __annotate__EventIO.__annotate__'   s      8J/ r   c              #  s   "    \         P                   ! V P                  .. . 4      w  rpV P                  4        F  pVx  K	  	  KD  5i)zI
Enter an endless :func:`select.select()` loop that yields input events.
)selectr   read)r   ZrZwZxevents   &    r   	read_loopZEventIO.read_loop'   s;     
 mmTWWIr26GA! %s   AAc                s4   < V ^8  d   QhRS[ S[R3,          /# )r   r   N)r   r   r   r   r   r   r   1   s     & &%
D 01 &r   c                sh    \         P                  ! V P                  4      pV'       d
   \        V!  # R# )z
Read and return a single input event as an instance of
:class:`InputEvent <evdev.events.InputEvent>`.

Return ``None`` if there are no pending input events.
N)r   Zdevice_readr   r   r   r"   s   & r   read_oneZEventIO.read_one1   s+     ""477+u%% r   c                r   r   r   r   r   r   r   r   ?   s     % %hz* %r   c              #  sv   "   \         P                  ! V P                  4      pV F  p\        V!  x  K  	  R# 5i)z
Read multiple input events from device. Return a generator object that
yields :class:`InputEvent <evdev.events.InputEvent>` instances. Raises
`BlockingIOError` if there are no available events at the moment.
N)r   Zdevice_read_manyr   r   )r   eventsr"   s   &  r   r!   ZEventIO.read?   s0      ((1Ee$$ s   79c                sF   a  \         P                  ! S 4      V 3R l4       pV# )z\
Decorator that raises :class:`EvdevError` if there is no write access to the
input device.
c                  s   < V ^ ,          P                   p\        P                  ! V\        P                  4      \        P                  ,          '       d   S! V !  # RV ^ ,          P
                  ,          p\        V4      h)r    zno write access to device "%s")r   fcntlZF_GETFLosZO_RDWRZpathr   )Zargsr   Zmsgfuncs   *  r   wrapperZ#EventIO.need_write.<locals>.wrapperS   sT    aB{{2u}}-		99T{"2T!W\\ACS/!r   )	functoolsZwraps)r)   r*   s   f r   
need_writeZEventIO.need_writeM   s'     
		" 
	" r   c                s    \        VR4      '       d   VP                  pV P                  VP                  VP                  VP
                  4       R# )a  
Inject an input event into the input subsystem. Events are
queued until a synchronization event is received.

Arguments
---------
event: InputEvent
  InputEvent instance or an object with an ``event`` attribute
  (:class:`KeyEvent <evdev.events.KeyEvent>`, :class:`RelEvent
  <evdev.events.RelEvent>` etc).

Example
-------
>>> ev = InputEvent(1334414993, 274296, ecodes.EV_KEY, ecodes.KEY_A, 1)
>>> ui.write_event(ev)
r"   N)Zhasattrr"   writeZtypecodevaluer$   s   &&r   write_eventZEventIO.write_event^   s6    $ 5'""KKE

5::uzz5;;7r   c                s,   < V ^8  d   QhRS[ RS[ RS[ /# )r   etyper.   r/   )Zintr   r   r   r   r   v   s"     3 33 3c 3# 3r   c                sJ    \         P                  ! V P                  WV4       R# )a~  
Inject an input event into the input subsystem. Events are
queued until a synchronization event is received.

Arguments
---------
etype
  event type (e.g. ``EV_KEY``).

code
  event code (e.g. ``KEY_A``).

value
  event value (e.g. 0 1 2 - depends on event type).

Example
---------
>>> ui.write(e.EV_KEY, e.KEY_A, 1) # key A - down
>>> ui.write(e.EV_KEY, e.KEY_A, 0) # key A - up
N)r   r-   r   )r   r1   r.   r/   s   &&&&r   r-   ZEventIO.writeu   s    . 	dgguE2r   c                sd    V P                  \        P                  \        P                  ^ 4       R# )z
Inject a ``SYN_REPORT`` event into the input subsystem. Events
queued by :func:`write()` will be fired. If possible, events
will be merged into an 'atomic' event.
N)r-   r   ZEV_SYNZ
SYN_REPORTr   r   r   synZEventIO.syn   s     	

6==&"3"3Q7r   c                s    R # )Nr   r   r   r   closeZEventIO.close   s    r   r   N)r	   r
   r   r   Z__doc__r   r#   r%   r!   r,   r0   r-   r2   r3   r   Z__classdictcell__)r   s   @r   r   r      sZ      & &% %"8. 3 308 r   r   )r'   r+   r(   r    Ztypingr   r   Z r   r   r   r&   r   Z	Exceptionr   r   r   r   r   <module>r4      s5      	  " % % 	 	H Hr   