+
     i  c                   s    ^ RI HtHtHt ^ RI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Ht ^ RIHtHt ^ R	IHt ^ R
IHt  ! R R]4      tR# )    )DictTupleHashableN)InputCombination)InputConfig)Mapping)GlobalUInputs)MappingHandlerHandlerEnumsInputEventHandlerContextProtocol)
InputEventEventActions)logger)get_device_hashc                   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RV3R lR l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# )AxisSwitchHandleraW  Enables or disables an axis.

Generally, if multiple events are mapped to something in a combination, all of
them need to be triggered in order to map to the output.

If an analog input is combined with a key input, then the same thing should happen.
The key needs to be pressed and the joystick needs to be moved in order to generate
output.
c                s2   < V ^8  d   QhRS[ RS[RS[RS[/# )   combinationmappingcontextglobal_uinputs)r   r   r   r   Zformat__classdict__   "a/usr/lib/python3.14/site-packages/inputremapper/injection/mapping_handlers/axis_switch_handler.py__annotate__AxisSwitchHandler.__annotate__:   s3      %  !	
 &    c                s4  < \         SV `  WV4       \        ;QJ d    . R  V 4       F  NK  	  5M! R  V 4       4      p\        V4      ^8  g   Q hVP	                  4       ;p'       g   Q hWpn        W`n        RV n        ^ V n        RV n	        RV n
        W0n        R# )c              3   sb   "   T F%  pVP                   '       d   K  VP                  x  K'  	  R # 5iN)defines_analog_inputinput_match_hash)Z.0events   & r   Z	<genexpr>Z-AxisSwitchHandler.__init__.<locals>.<genexpr>C   s(      
$-- #E""$s   //FN)Zsuper__init__ZtupleZlenZfind_analog_input_config	_map_axis_trigger_keys_active_last_value_axis_source_forward_devicer   )	selfr   r   r   r   Z_Ztrigger_keysZmap_axis	__class__s	   &&&&&,  r   r!   ZAxisSwitchHandler.__init__:   s     	~>u 
$
uu 
$
 

 < A%%%'@@BBBCB!) #r   c                s4    R V P                   P                   2# )zAxisSwitchHandler for )r"   type_and_coder(      &r   __str__ZAxisSwitchHandler.__str__T   s    '(D(D'EFFr   c                sJ    R \        V 4       R\        \        V 4      4       R2# )Z<z at Z>)ZstrZhexZidr+   r,   r   __repr__ZAxisSwitchHandler.__repr__W   s#    3t9+T#bh-22r   c                s    V P                   # r   )_sub_handlerr+   r,   r   childZAxisSwitchHandler.childZ   s       r   c                    < V ^8  d   QhRS[ /# r   r    r   r   r   r   r   r   ^   s     , ,z ,r   c                s^   \        VP                  4      pV P                  V8X  d   R# W n        V P                  f   R# V'       g   \        P
                  ! RV P                  P                  4       \        ^ ^ .V P                  P                  O^ N5R\        P                  3RV P                  P                  / pV P                  P                  WP                  4       R# V P                  P                   \"        P$                  P&                  8X  d   \        P
                  ! RV P                  P                  4       \        ^ ^ .V P                  P                  OV P(                  N5RV P                  P                  / pV P                  P                  WP                  4       R# R# )zIf a key is pressed, allow mapping analog events in subhandlers.

Analog events (e.g. ABS_X, REL_Y) that have gone through Handlers that
transform them to buttons also count as keys.
FTzStopping axis for %sZactionsorigin_hashzStarting axis for %s)boolvaluer$   r&   r   Zdebugr   Zinput_combinationr   r"   r*   r   Zrecenterr4   r/   notifyZtypeevdevZecodesZEV_ABSr%   )r(   r    Zkey_is_presseds   && r   _handle_key_inputZ#AxisSwitchHandler._handle_key_input^   sf    ekk*<<>)%$LL/1O1OP -- 	
 &..0 !NN66E $$U,=,=>>>%,,"5"55 LL/1O1OP --   	
 !NN66E $$U,=,=>r   c                r1   r2   r3   r   r   r   r   r      s     
 
 
r   c                s    VP                   V P                  9   ;'       g$    VP                   V P                  P                   8H  # r   )r   r#   r"   )r(   r    s   &&r   _should_mapZAxisSwitchHandler._should_map   s?    ""d&8&88 I I%%)H)HH	
r   c                sF   < V ^8  d   QhRS[ RS[P                  RS[RS[/# )r   r    sourcesuppressreturn)r   r8   InputDevicer5   r   r   r   r   r      s9       !! 	
 
r   c                s   V P                  V4      '       g   R # VP                  '       d   V P                  V4      # V P                  f   W n        V P                  f,   \        V4      pV P                  P                  V4      V n        VP                  V n	        V P                  '       d   V P                  P                  WV4      # R # F)r:   Zis_key_eventr9   r&   r'   r   r   Zget_forward_uinputr6   r%   r$   r/   r7   )r(   r    r;   r<   Zdevice_hashs   &&&& r   r7   ZAxisSwitchHandler.notify   s     &&))%00 $ &')&1K#'<<#B#B;#OD  !;;<<<$$++E8DDr   c                s   < V ^8  d   QhRR/# )r   r=   N r   r   r   r   r      s     " "t "r   c                sV    ^ V n         RV n        V P                  P                  4        R# )r    FN)r%   r$   r/   resetr+   r,   r   rA   ZAxisSwitchHandler.reset   s#    !r   c                r1   r   r=   )r5   r   r   r   r   r      s       r   c                s    R # )Tr@   r+   r,   r   needs_wrappingZ AxisSwitchHandler.needs_wrapping   s    r   c                s6   < V ^8  d   QhRS[ S[S[3,          /# rB   )r   r   r	   r   r   r   r   r      s"     I I4 0, >? Ir   c                s    V P                    Uu. uF  qP                  '       d   K  VNK  	  pp\        V4      \        P                  /# u upi r   )Zinput_configsr   r   r	   r   )r(   Zconfigr   s   &  r   	wrap_withZAxisSwitchHandler.wrap_with   sJ    !%!3!3
!3v;V;VFF!3 	 
 !-|/G/GHH
s
   A
A
c                s   < V ^8  d   Qh/ S[ ;R&   S[S[R3,          ;R&   S[;R&   S[;R&   S[P                  ;R&   S[P                  ;R&   S[;R&   # )	r   r"   .r#   r$   r%   r&   r'   r/   )	r   r   r   r5   Zintr8   r>   ZUInputr
   r   r   r   r   r   '   sr        3''  M    ###   \\!! " $## r   )r$   r&   r'   r%   r"   r#   r   r?   )Z__name__Z
__module__Z__qualname__Z__firstlineno__Z__doc__r!   r-   r.   Zpropertyr0   r9   r:   r7   rA   rC   rD   Z__annotate_func__Z__static_attributes__Z__classdictcell__Z__classcell__)r)   r   s   @@r   r   r   '   sz     $ 4G3 ! !, ,\
 
 :" "
 I Ia  r   r   )Ztypingr   r   r   r8   Z"inputremapper.configs.input_configr   r   Zinputremapper.configs.mappingr   Z&inputremapper.injection.global_uinputsr   Z8inputremapper.injection.mapping_handlers.mapping_handlerr   r	   r
   r   Zinputremapper.input_eventr   r   Zinputremapper.logging.loggerr   Zinputremapper.utilsr   r   r@   r   r   <module>rE      sA   ( ) (  ? : 1 @  ? / /TI TIr   