+
     i  c                   s    ^ RI t ^ RIt^ RIHtHtHt ^ RIHt ^ RIH	t	 ^ RI
Ht ^ RIHt ^ RIHt ^ RIHtHtHt ^ R	IHt ^ R
IHt  ! R R]4      tR# )i    N)DictCallableTuple)InputCombination)Mapping)GlobalUInputs)Macro)Parser)ContextProtocolMappingHandlerHandlerEnums)
InputEvent)loggerc                   s   a a ] tR t^&t oRtV3R lV 3R lltR tR t]R 4       t	V3R lR lt
V3R	 lR
 ltV3R lR ltV3R lR ltV3R lR ltV3R lR ltV3R ltRtVtV ;t# )MacroHandlerz"Runs the target macro if notified.c                s2   < V ^8  d   QhRS[ RS[RS[RS[/# )   combinationmappingglobal_uinputscontext)r   r   r   r   format__classdict__   "[/usr/lib/python3.14/site-packages/inputremapper/injection/mapping_handlers/macro_handler.py__annotate__MacroHandler.__annotate__-   s9     Q Q%Q Q &	Q !Q    c               s   < \         SV `  WV4       / V n        R V n        V P                  P
                  f   Q h\        P                  ! V P                  P
                  WB4      V n        R# )FN)	Zsuper__init___pressed_keys_activer   Zoutput_symbolr   Zparse_macro)selfr   r   r   r   	__class__s   &&&&$r   r   ZMacroHandler.__init__-   sU     	~>9;||))555ll4<<#=#=wPr   c                    R # )r    r      &r   __str__ZMacroHandler.__str__;   s    r   c                sJ    R \        V 4       R\        \        V 4      4       R2# )Z<z at Z>)ZstrZhexZidr#   r$   r   __repr__ZMacroHandler.__repr__>   s#    3t9+T#bh-22r   c                sN    R V P                    RV P                  P                   2# )zmaps to z on )r   r   target_uinputr#   r$   r   childZMacroHandler.childA   s$    $++d4<<+E+E*FGGr   c                    < V ^8  d   QhRS[ /# )r   handler)r   r   r   r   r   r   E   s     " "x "r   c                s   "    V P                   P                  V4      G Rj  xL
  R#  L  \         dV   p\        P                  ! RT P                   P
                  \        T4      4       \        P                  ! 4         Rp?R# Rp?ii ; i5i)z)Run the macro with the provided function.NzMacro "%s" failed with %s)	r   ZrunZ	Exceptionr   Zerrorcodetype	tracebackZ	print_exc)r   r*   Z	exceptions   && r   	run_macroZMacroHandler.run_macroE   s]     	"++//'*** 	"LL4dkk6F6FYX!!	"s7   B+ )+ B+ BA
B BBBc                s&   < V ^8  d   QhRS[ RS[/# )r   eventreturn)r   boolr   r   r   r   r   M   s      J T r   c                sJ  a  VP                   ^8X  dp   RS n        S P                  P                  4        S P                  P                  '       d   R# R V 3R llp\
        P                  ! S P                  V4      4       R# RS n        S P                  P                  4        R# )i   Tc                s    V ^8  d   QhRR/# r   r0   Nr"   )r   s   "r   r   Z)MacroHandler.notify.<locals>.__annotate__T   s      t r   c                s   < SP                  WV34       SP                  P                  WV3SP                  P                  4       R# )zHandler for macros.N)_remember_pressed_keysr   writer   r'   )Ztype_r+   valuer   s   &&&r   r*   Z$MacroHandler.notify.<locals>.handlerT   s?    ++U%,@A##))%(LL..r   F)	r5   r   r   Zpress_triggerZrunningasyncioZensure_futurer.   Zrelease_trigger)r   r/   Z_Z__r*   s   f&*, r   notifyZMacroHandler.notifyM   sy    ;;!DLKK%%'{{"""  !!$.."9: DLKK'')r   c                s   < V ^8  d   QhRR/# r2   r"   r   r   r   r   r   e   s      t r   c                s   R V n         V P                  P                  4        F\  w  w  rpV^8X  g   K  \        P                  ! RWV34       V P
                  P                  W^ 3V P                  P                  4       K^  	  R# )FzReleasing key %sN)	r   r   Zitemsr   Zdebugr   r4   r   r'   )r   r,   r+   r5   s   &   r   resetZMacroHandler.resete   sn     $(#5#5#;#;#=LT%z/$e1DE##))OLL.. $>r   c                r)   r   r0   )r1   r   r   r   r   r   r   s       r   c                r!   )Tr"   r#   r$   r   needs_wrappingZMacroHandler.needs_wrappingr   s    r   c                s6   < V ^8  d   QhRS[ S[S[3,          /# r9   )r    r   r
   r   r   r   r   r   u   s"     P P4 0, >? Pr   c                sL    \        V P                  4      \        P                  /# N)r   Zinput_configsr
   r   r#   r$   r   	wrap_withZMacroHandler.wrap_withu   s     !3!34l6N6NOOr   c                s>   < V ^8  d   QhRS[ S[S[S[3,          RR/# )r   r/   r0   N)r   Zintr   r   r   r   r   x   s&     1 1E#sC-,@ 1T 1r   c                s.    Vw  r#pW@P                   W#3&   R # r;   )r   )r   r/   r,   r+   r5   s   &&   r   r3   Z#MacroHandler._remember_pressed_keysx   s    !E+0D<(r   c                s2   < V ^8  d   Qh/ S[ ;R&   S[;R&   # )r   r   r   )r   r1   r   r   r   r   r   &   s      M	 
 M r   )r   r   r   )Z__name__Z
__module__Z__qualname__Z__firstlineno__Z__doc__r   r%   r&   Zpropertyr(   r.   r7   r8   r:   r<   r3   Z__annotate_func__Z__static_attributes__Z__classdictcell__Z__classcell__)r    r   s   @@r   r   r   &   sz     ,Q Q3 H H" " 0  P P1 1e  r   r   )r6   r-   Ztypingr    r   r   Z"inputremapper.configs.input_configr   Zinputremapper.configs.mappingr   Z&inputremapper.injection.global_uinputsr   Z$inputremapper.injection.macros.macror   Z$inputremapper.injection.macros.parser   Z8inputremapper.injection.mapping_handlers.mapping_handlerr   r	   r
   Zinputremapper.input_eventr   Zinputremapper.logging.loggerr   r   r"   r   r   <module>r=      sB   (   ( ( ? 1 @ 6 7 
 1 /T1> T1r   