+
     i&  c                   s    ^ RI t ^ RIHt ^ RIt^ RIHtHtHtHtH	t	 ^ RI
Ht ^ RIHtHt ^ RIHtHtHt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 lt R R lt! ! R R4      t" ! R R]4      t#R# )    N)Dict)EV_REL	REL_WHEEL
REL_HWHEELREL_WHEEL_HI_RESREL_HWHEEL_HI_RES)
exceptions)InputCombinationInputConfig)MappingREL_XY_SCALINGWHEEL_SCALINGWHEEL_HI_RES_SCALING)GlobalUInputs)Transformation)MappingHandlerHandlerEnumsInputEventHandler
InputEvent)loggerc                $    V ^8  d   QhR\         /#    returnboolformat   "`/usr/lib/python3.14/site-packages/inputremapper/injection/mapping_handlers/rel_to_rel_handler.py__annotate__r    3   s     J Jt J    c                 j    V P                   \        8H  ;'       d    V P                  \        \        39   # N)typer   coder   r   event   &r   is_wheelr)   3   s'    ::IIEJJ9j2I$IIr!   c                r   r   r   r   r   r   r    r    7   s     X X Xr!   c                 r"   r#   )r$   r   r%   r   r   r&   r(   r   is_high_res_wheelr*   7   s)    ::WWEJJ3CEV2W$WWr!   c                   sP   a  ] tR t^;t o V 3R lR ltV 3R lR ltV 3R ltRtV tR# )	Remainderc                    < V ^8  d   QhRS[ /# )r   scalefloatr   __classdict__   "r   r    Remainder.__annotate__?   s      e r!   c                s     Wn         ^ V n        R# r    N)_scale
_remainder)selfr-      &&r   __init__ZRemainder.__init__?   s    r!   c                s&   < V ^8  d   QhRS[ RS[/# )r   valuer   )r/   intr0   r2   r   r    r3   C   s      5 S r!   c                s    WP                   ,          V P                  ,           p\        P                  ! V^4      V n        \	        V4      # i   )r5   r6   mathZfmodr;   )r7   r:   Zscaleds   && r   inputZRemainder.inputC   s5     $t6))FA.6{r!   c                s2   < V ^8  d   Qh/ S[ ;R&   S[ ;R&   # )r   r5   r6   r.   r0   r2   r   r    r3   ;   s     M  r!   )r6   r5   N)	__name__
__module____qualname____firstlineno__r9   r>   __annotate_func____static_attributes____classdictcell__)r1   s   @r   r+   r+   ;   s          r!   r+   c                   s   a a ] tR t^Mt 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
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R ltV3R lR ltV3R ltRtVtV ;t# )RelToRelHandlerz1Handler which transforms EV_REL to EV_REL events.c                s0   < V ^8  d   QhRS[ RS[RS[RR/# )r   combinationmappingglobal_uinputsr   N)r   r
   r   r0   r2   r   r    RelToRelHandler.__annotate__Z   s3     
 
%
 
 &	
 

r!   c                s  < \         SV `  WV4       VP                  \        R 7      pWPn        ^V n        \        \        4      V n        \        \        4      V n
        \        \        4      V n        \        ^RV P                  P                  V P                  P                   V P                  P"                  R7      V n        R# ))Ztype_)Zmax_Zmin_deadzonegainexpoNi)Zsuperr9   Zfind_analog_input_configr   _input_config_max_observed_inputr+   r   r6   r   _wheel_remainderr   _wheel_hi_res_remainderr   rH   rK   rL   rM   
_transform)r7   rG   rH   rI   Z_Zinput_config	__class__s   &&&&, r   r9   ZRelToRelHandler.__init__Z   s     	~> #;;&;I)#$ #N3 )- 8'01E'F$(\\**""""
r!   c                s     R V P                    2# )zRelToRelHandler for )rN   r7   r(   r   __str__ZRelToRelHandler.__str__y   s    %d&8&8%9::r!   c                sJ    R \        V 4       R\        \        V 4      4       R2# )Z< at Z>)ZstrZhexZidrT   r(   r   __repr__ZRelToRelHandler.__repr__|   s#    3t9+T#bh-22r!   c                sb    R V P                   P                   RV P                   P                   2# )z	maps to: rV   )rH   output_codetarget_uinputrT   r(   r   childZRelToRelHandler.child   s+    4<<334D9S9S8TUUr!   c                r,   )r   r'   r   r0   r2   r   r    rJ      s     M M Mr!   c                sH    VP                   V P                  P                   8H  # )z7Check if this input event is relevant for this handler.)Zinput_match_hashrN   )r7   r'   r8   r   _should_mapZRelToRelHandler._should_map   s    %%););)L)LLLr!   c                sF   < V ^8  d   QhRS[ RS[P                  RS[RS[/# )r   r'   sourcesuppressr   )r   evdevZInputDevicer   r0   r2   r   r    rJ      s?     t tt !!t 	t
 
tr!   c                s   V P                  V4      '       g   R #  \        VP                  4      pVP                  '       d   V\        ,          pM-VP
                  '       d   V\        ,          pMV\        ,          p\        V4      V P                  8  d   \        V4      V n	        V P                  W@P                  ,          4      pWPP                  ,          pV P                  P                  4       pV P                  P                  4       pV P                  P                  \        \         39   p V'       g	   V'       d}   T P#                  V'       d   \         M\$        V P&                  P)                  V4      4       T P#                  V'       d   \        M\*        V P,                  P)                  V4      4       R# V P#                  V P                  P                  V P.                  P)                  V4      4       R#   \0         d    \2        P4                  ! RT4        R# \6        P8                  \6        P:                  3 d     R # i ; i)FTzOverflowError while handling %s)r[   r/   r:   Zis_wheel_eventr   Zis_wheel_hi_res_eventr   r   ZabsrO   rR   rH   is_wheel_outputZis_high_res_wheel_outputrX   r   r   _writer   rP   r>   r   rQ   r6   ZOverflowErrorr   Zerrorr   ZUinputNotAvailableZEventNotHandled)	r7   r'   r\   r]   Zinput_valueZtransformedr_   Zis_hi_res_wheel_outputZ
horizontals	   &&&&     r   notifyZRelToRelHandler.notify   s    &&3	j EKK( =(K(((//K
 >)K{d666'*;'7D$
 ook4L4L&LM///,,668!%!F!F!H\\--2
 


	"8 ",J)))//< )3%9I0066{C  LL,,OO))+6
  	LL:EB--z/I/IJ 		s6   2G? G? <G? *G? >?G? ?"I$"IIIc                s   < V ^8  d   QhRR/# )r   r   N r0   r2   r   r    rJ      s      t r!   c                    R # r#   rb   rT   r(   r   resetZRelToRelHandler.reset   s    r!   c                s&   < V ^8  d   QhRS[ RS[ /# )r   r%   r:   )r;   r0   r2   r   r    rJ      s     
 
3 
s 
r!   c                s    V^ 8X  d   R# V P                   P                  \        W3V P                  P                  4       R# r4   )rI   Zwriter   rH   rY   )r7   r%   r:   s   &&&r   r`   ZRelToRelHandler._write   s5    A:!!T!LL&&	
r!   c                r,   r   r   r0   r2   r   r    rJ   	  s     + + +r!   c                s2    \        V P                  4      ^8  # r<   )Zleninput_configsrT   r(   r   needs_wrappingZRelToRelHandler.needs_wrapping	  s    4%%&**r!   c                s$   < V ^8  d   QhRS[ RR/# )r   handlerr   N)r   r0   r2   r   r    rJ     s      '8 T r!   c                rc   r#   rb   )r7   rg   r8   r   set_sub_handlerZRelToRelHandler.set_sub_handler  s    r!   c                s6   < V ^8  d   QhRS[ S[S[3,          /# r   )r   r   r   r0   r2   r   r    rJ     s      4 0, >? r!   c                s|    V P                  4       '       d&   \        V P                  4      \        P                  /# / # r#   )rf   r   re   r   Z
axisswitchrT   r(   r   	wrap_withZRelToRelHandler.wrap_with  s2      $T%7%78,:Q:QRR	r!   c                sb   < V ^8  d   Qh/ S[ ;R&   S[;R&   S[;R&   S[;R&   S[;R&   S[;R&   # )r   rN   rO   rR   r6   rP   rQ   )r	   r/   r   r+   r0   r2   r   r    rJ   M   sS       
          '& r!   )rN   rO   r6   rR   rQ   rP   )F)r?   r@   rA   rB   Z__doc__r9   rU   rW   ZpropertyrZ   r[   ra   rd   r`   rf   rh   ri   rC   rD   rE   Z__classcell__)rS   r1   s   @@r   rF   rF   M   s     ;
 
>;3 V VM Mt tl 
 
+ +  E  r!   rF   )$r=   Ztypingr   r^   Zevdev.ecodesr   r   r   r   r   Zinputremapperr   Z"inputremapper.configs.input_configr   r	   Zinputremapper.configs.mappingr
   r   r   r   Z&inputremapper.injection.global_uinputsr   Z7inputremapper.injection.mapping_handlers.axis_transformr   Z8inputremapper.injection.mapping_handlers.mapping_handlerr   r   r   Zinputremapper.input_eventr   Zinputremapper.logging.loggerr   r)   r*   r+   rF   rb   r!   r   <module>rj      sk   (     % L  A R 
 1 /JX $En Er!   