+
    Qir  c                  s   R t ^ RIHt RtRtRtRtRt^ RIt^ RI	t	^ RI
t
^ RIt^ RIHtHt ^ RIt]P                   ! R	R
4       ]P                   ! RR4       ^ RI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 ^RIHt ^RIHt ^RIHt ^RIHt ^RIHt ]'       d   ^RI H!t! Rt"Rt#Rt$Rt% ! R R4      t& ! R  R!]&4      t' ! R" R#]&4      t( ! R$ R%]&4      t) ! R& R']&4      t* ! R( R)4      t+R# )*+Provides support for handling input events.)annotationsz$Id$z
$Revision$z$Date$zQCopyright (c) 2005-2008 Sun Microsystems Inc.Copyright (c) 2011-2016 Igalia, S.L.ZLGPLN)CallableTYPE_CHECKINGAtspiz2.0Gdkz3.0)r   )r   )GLib)debug)focus_manager)keybindings)keynames)messages)orca_modifier_manager)script_manager)settings)AXUtilities)defaultZkeyboardZbraillezmouse:buttonzremote controllerc                  sJ    ] tR t^EtRtR R ltR R ltR R ltR R	 ltR
t	R# )
InputEventr    c                    V ^8  d   QhRRRR/# )   
event_typestrreturnNone Zformat   "5/usr/lib/python3.14/site-packages/orca/input_event.py__annotate__InputEvent.__annotate__H   s     # #3 #4 #    c                sT    Wn         \        P                  ! 4       V n        ^ V n        R# )zCCreates a new KEYBOARD_EVENT, BRAILLE_EVENT, or MOUSE_BUTTON_EVENT.N)typetime_click_count)selfr      &&r   __init__ZInputEvent.__init__H   s     $	99;	!"r   c                   V ^8  d   QhRR/# )r   r   intr   r   r   r   r   r   O   s     ! ! !r   c                    V P                   # )z9Return the count of the number of clicks a user has made.r!   r"      &r   get_click_countZInputEvent.get_click_countO   s        r   c               r   )r   countr&   r   r   r   r   r   r   r   r   T   s     " "S "T "r   c                    Wn         R# )z:Updates the count of the number of clicks a user has made.Nr(   )r"   r,   r#   r   set_click_countZInputEvent.set_click_countT   s
     "r   c               r%   r   r   r   r   r   r   r   r   r   Y   s      s r   c                s    V P                    # ):Returns a single-line string representation of this event.)r   r)   r*   r   as_single_line_stringZ InputEvent.as_single_line_stringY   s     ))r   )r!   r    r   N)
__name__
__module____qualname____firstlineno____doc__r$   r+   r.   r1   __static_attributes__r   r   r   r   r   E   s    5#!
"
 r   r   c                  s  a  ] tR t^^tRtR V 3R lltR R ltR R ltR R	 ltR
 R lt	R R lt
R R ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR  R! ltR" R# ltR$ R% ltR& R' ltR( R) ltR* R+ ltR, R- ltR. R/ ltR0 R1 ltR2 R3 ltR4 R5 ltR6 R7 ltR8 R9 lt R: R; lt!R< R= lt"R> R? lt#R@ RA lt$RB RC lt%RD RE lt&RF RG lt'RHt(V ;t)# )IKeyboardEventz.Provides support for handling keyboard events.c               s0    V ^8  d   QhRRRRRRRRRRR	R
/# )r   pressedboolkeycoder&   keysym	modifierstextr   r   r   r   r   r   r   r   KeyboardEvent.__annotate__c   sF     0= 0=0= 0= 	0=
 0= 0= 
0=r   c                st  < \         SV `  \        4       W0n        V'       d   \        P
                  P                  M\        P
                  P                  V n        W n	        WPn
        V\        P                  P                  ,          V n        V^\        P                  P                  ,          ,          '       d9   V ;P                  ^\        P                  P                  ,          ,          un        \        P                   ! V4      ;'       g    RV n        \"        P"                  ! 4       V n        RV n        RV n        RV n        RV n        RV n        RV n        V P                   P3                  R4      '       d@   V P                  ^\        P                  P                  ,          ,          '       d   RV n        \4        P6                  ! 4       pV P9                  4       '       d   VP;                  V4       VP=                  4       '       d*   V ;P                  \>        P@                  ,          un        R# R# )a0  Creates a new InputEvent of type KEYBOARD_EVENT.

Arguments:
- pressed: True if this is a key press, False for a release.
- keycode: the hardware keycode.
- keysym: the translated keysym.
- modifiers: a bitflag giving the active modifiers.
- text: the text that would be inserted if this key is pressed.
 NFZKPT)!superr$   KEYBOARD_EVENTidr   	EventTypeKEY_PRESSED_EVENTZKEY_RELEASED_EVENTr   hw_code_textr   ModifierTypeZMODIFIER_MASKr=   NUMLOCKkeyval_namer    	timestamp_script_window_obj_handler	_consumer_is_kp_with_numlock
startswithr   get_manageris_orca_modifierZset_pressed_stateZget_pressed_stater	   ORCA_MODIFIER_MASK)r"   r9   r;   r<   r=   r>   Zmodifier_manager	__class__s   &&&&&& r   r$   ZKeyboardEvent.__init__c   s~   $ 	(18EOO--eoo>`>` 		 $
'#*:*:*H*HHU//77788NNqE$6$6$>$>>?N # 7 = =2 $		.204-1	2659). 
 &&t,,~~e&8&8&@&@!@AA+/(0<<>  ""..w7--//NNk<<<N 0r   c               r   r   otherZobjectr   r:   r   r   r   r   r   r?      s      F t r   c                	s    \        V\        4      '       g   R # V P                  VP                  8X  d5   V P                  VP                  8X  d   V P                  VP                  8H  # R # F)
isinstancer8   r   rF   rK   r"   rX   r#   r   __eq__ZKeyboardEvent.__eq__   sG    %//99

"t||u}}'D>>U__44r   c               r%   r/   r   r   r   r   r   r?      s     B B Br   c                	s    V P                  4       '       d   R ;p;p;p;rEMW\        V P                  4      p\        V P                  4      p\        V P                  4      pV P
                  pV P                  pRV P                  P                  P                  4        R2RV R2,           RV R2,           RV R2,           RV R2,           RV R2,           R	V P                   R2,           R
V P                   2,           # )Z*zKEYBOARD_EVENT:  type=
z                 id=z                 hw_code=z                 modifiers=z                 text='z'
z                 keyval_name='z                 timestamp=z                 clickCount=)should_obscurer   rC   rF   r=   rJ   rG   r   
value_nameupperrK   r!   )r"   ZkeyidrF   r=   r>   rJ      &     r   __str__ZKeyboardEvent.__str__   s     ?BBEBGBiB$LE$,,'GDNN+I**K::D'		(<(<(B(B(D'ERH%eWB/0*7)267 -YKr:; )c2	3
 0}C@A -T^^,<B?@ .d.?.?-@AB 	Br   c               r%   r/   r   r   r   r   r   r?      s     	
 	
s 	
r   c                s    V P                  4       '       d   R# RV P                   RV P                   RV P                   RV P                  P
                   2# )r0   
(obscured)'' (z) mods:  )r^   rJ   rF   r=   r   Z
value_nickr)   r*   r   r1   Z#KeyboardEvent.as_single_line_string   sW          !T\\N(4>>:J!yy##$&	
r   c               r%   r   r   r:   r   r   r   r   r   r?      s       r   c                s    V P                   \        P                  ,          '       gO   V P                   \        P                  ,          '       g(   V P                   \        P                  ,          '       d   R# R# )z:Return True if this key is Alt, Control, or Orca modified.TF)r=   r	   ZCTRL_MODIFIER_MASKZALT_MODIFIER_MASKrU   r)   r*   r   is_alt_control_or_orca_modifiedZ-KeyboardEvent.is_alt_control_or_orca_modified   sI     >>K::::nn{<<<<nn{====r   c               r%   rg   r   r   r   r   r   r?      s       r   c                s    \         P                  ! V P                  4      '       g   R# V P                  4       '       g   V P	                  4       '       g   R# V P                  4       '       d   R# R# )z<Returns True if we should obscure the details of this event.FT)r   Zis_password_textrN   is_printable_keyis_spacerh   r)   r*   r   r^   ZKeyboardEvent.should_obscure   sM     ++DII66$$&&t}}//11r   c               r%   rg   r   r   r   r   r   r?      s      4 r   c                s    \         P                  \         P                  \         P                  \         P                  \         P
                  \         P                  .pV P                  V9   # )z(Return True if this is a navigation key.)r   ZKEY_DownZKEY_EndZKEY_HomeZKEY_LeftZ	KEY_RightZKEY_UprC   r"   keys   & r   is_navigation_keyZKeyboardEvent.is_navigation_key   sE     LLKKLLLLMMJJ
 ww$r   c               r%   rg   r   r   r   r   r   r?      s      t r   c                s   \         P                  \         P                  \         P                  \         P                  \         P
                  \         P                  \         P                  \         P                  .pV P                  V9   # )z%Return True if this is an action key.)
r   ZKEY_BackSpaceZ
KEY_DeleteZ
KEY_EscapeZKEY_KP_EnterZKEY_Page_DownZKEY_Page_UpZ
KEY_ReturnZKEY_TabrC   rk   rm   r   is_action_keyZKeyboardEvent.is_action_key   sY     NNNNOONNKK	
 ww$r   c               r%   rg   r   r   r   r   r   r?      s      4 r   c                f    V P                  4       p\        V4      ^8X  g   R# VP                  4       # )z)Return True if this is an alphabetic key.F)get_key_namelenZisalphar"   namerm   r   is_alphabetic_keyZKeyboardEvent.is_alphabetic_key   s,       "4yA~||~r   c               r%   rg   r   r   r   r   r   r?      s     D DD Dr   c                s.   . \         P                  N\         P                  N\         P                  N\         P                  N\         P
                  N\         P                  N\         P                  N\         P                  N\         P                  N\         P                  N\         P                  N\         P                  N\         P                  N\         P                  N\         P                  N\         P                   N\         P"                  N\         P$                  N\         P&                  N\         P(                  N\         P*                  N\         P,                  N\         P.                  N\         P0                  N\         P2                  N\         P4                  N\         P6                  N\         P8                  N\         P:                  N\         P<                  N\         P>                  N\         P@                  N\         PB                  N\         PD                  N\         PF                  N\         PH                  N\         PJ                  N\         PL                  N\         PN                  N\         PP                  N\         PR                  N\         PT                  N\         PV                  N\         PX                  N\         PZ                  N\         P\                  N\         P^                  N\         P`                  N\         Pb                  N\         Pd                  N\         Pf                  N\         Ph                  NpV Pj                  V9   d   R# V Pm                  4       p\o        V4      ^8X  d    \p        Pr                  ! V4      pVR9   d   R# R# )z5Return True if this is a non-spacing diacritical key.TF)ZMnZMcZMe):r   Z
KEY_dead_AZ
KEY_dead_aZKEY_dead_abovecommaZKEY_dead_abovedotZKEY_dead_abovereversedcommaZKEY_dead_aboveringZKEY_dead_aboveverticallineZKEY_dead_acuteZKEY_dead_belowbreveZKEY_dead_belowcircumflexZKEY_dead_belowcommaZKEY_dead_belowdiaeresisZKEY_dead_belowdotZKEY_dead_belowmacronZKEY_dead_belowringZKEY_dead_belowtildeZKEY_dead_belowverticallineZKEY_dead_breveZKEY_dead_capital_schwaZKEY_dead_caronZKEY_dead_cedillaZKEY_dead_circumflexZKEY_dead_currencyZKEY_dead_dasiaZKEY_dead_diaeresisZKEY_dead_doubleacuteZKEY_dead_doublegraveZ
KEY_dead_EZ
KEY_dead_eZKEY_dead_graveZKEY_dead_greekZKEY_dead_hookZKEY_dead_hornZ
KEY_dead_IZ
KEY_dead_iZKEY_dead_invertedbreveZKEY_dead_iotaZKEY_dead_longsolidusoverlayZKEY_dead_lowlineZKEY_dead_macronZ
KEY_dead_OZ
KEY_dead_oZKEY_dead_ogonekZKEY_dead_perispomeniZKEY_dead_psiliZKEY_dead_semivoiced_soundZKEY_dead_small_schwaZKEY_dead_strokeZKEY_dead_tildeZ
KEY_dead_UZ
KEY_dead_uZKEY_dead_voiced_soundrC   rq   rr   unicodedatacategory)r"   rl   rt   rw      &   r   is_diacritical_keyZ KeyboardEvent.is_diacritical_key   s   5
NN5
NN5
 ##5
 !!	5

 ++5
 ""5
 **5
 5
 ##5
 ((5
 ##5
 ''5
 !!5
 $$5
 ""5
  ##!5
" **#5
$ %5
& &&'5
( )5
*   +5
, ##-5
. !!/5
0 15
2 ""35
4 $$55
6 $$75
8 NN95
: NN;5
< =5
> ?5
@ A5
B C5
D NNE5
F NNG5
H &&I5
J K5
L ++M5
N   O5
P Q5
R NNS5
T NNU5
V W5
X $$Y5
Z [5
\ ))]5
^ $$_5
` a5
b c5
d NNe5
f NNg5
h %%i5
n 77d?  "t9>"++D1H--r   c               r%   rg   r   r   r   r   r   r?   B  s       r   c                s   \         P                  \         P                  \         P                  \         P                  \         P
                  \         P                  \         P                  \         P                  \         P                  \         P                  \         P                  \         P                  .pV P                  V9   # )z&Return True if this is a function key.)r   ZKEY_F1ZKEY_F2ZKEY_F3ZKEY_F4ZKEY_F5ZKEY_F6ZKEY_F7ZKEY_F8ZKEY_F9ZKEY_F10ZKEY_F11ZKEY_F12rC   rk   rm   r   is_function_keyZKeyboardEvent.is_function_keyB  so     JJJJJJJJJJJJJJJJJJKKKKKK
 ww$r   c               r%   rg   r   r   r   r   r   r?   U  s       r   c                s    V P                  4       '       d   V P                  ^8H  # \        P                  \        P                  \        P
                  \        P                  .pV P                  V9   # )z%Return True if this is a locking key.)rT   r!   r   KEY_Caps_LockKEY_Num_LockZKEY_Scroll_LockKEY_Shift_LockrC   rk   rm   r   is_locking_keyZKeyboardEvent.is_locking_keyU  sa       ""$$)) 	
 ww$r   c               r%   rg   r   r   r   r   r   r?   c  s     : : :r   c           	     sb   \         P                  \         P                  \         P                  \         P                  \         P
                  \         P                  \         P                  \         P                  \         P                  .	pV P                  V9   ;'       g    V P                  4       # )z&Return True if this is a modifier key.)r   Z	KEY_Alt_LZ	KEY_Alt_RZKEY_Control_LZKEY_Control_RZ
KEY_Meta_LZ
KEY_Meta_RZKEY_Shift_LZKEY_Shift_RZKEY_ISO_Level3_ShiftrC   rT   rk   rm   r   is_modifier_keyZKeyboardEvent.is_modifier_keyc  sq     MMMMNNNNOOOO$$

 ww$99$"7"7"99r   c               r%   rg   r   r   r   r   r   r?   s  s       r   c                s|   \         P                  \         P                  \         P                  \         P                  \         P
                  \         P                  \         P                  \         P                  \         P                  \         P                  \         P                  \         P                  \         P                  \         P                  \         P                  \         P                   \         P"                  \         P$                  \         P&                  \         P(                  .pV P*                  V9   # )z%Return True if this is a numeric key.)r   ZKEY_0ZKEY_1ZKEY_2ZKEY_3ZKEY_4ZKEY_5ZKEY_6ZKEY_7ZKEY_8ZKEY_9KEY_KP_0ZKEY_KP_1ZKEY_KP_2ZKEY_KP_3ZKEY_KP_4ZKEY_KP_5ZKEY_KP_6ZKEY_KP_7ZKEY_KP_8ZKEY_KP_9rC   rk   rm   r   is_numeric_keyZKeyboardEvent.is_numeric_keys  s     IIIIIIIIIIIIIIIIIIIILLLLLLLLLLLLLLLLLLLL)
, ww$r   c               r%   rg   r   r   r   r   r   r?     s     V V$ Vr   c                s2   V P                   \        P                  8X  dL   V P                  \        P
                  ,          '       d%   \        P                  ! 4       P                  R4      # \        P                  ! 4       P                  V P                  4      # )z-Return True if this is the Orca modifier key.Z	KP_Insert)
rC   r   r   r=   r	   ZSHIFT_MODIFIER_MASKr   rS   rT   rJ   r)   r*   r   rT   ZKeyboardEvent.is_orca_modifier  sb     77cll"t~~8W8W'W'W(446GGTT$002CCDDTDTUUr   c               r%   rg   r   r   r   r   r   r?     s     E E$ Er   c                s    V P                  4       '       d   R# \        V P                  \        P                  ,          4      # )z)Return True if this key is Orca modified.F)rT   r:   r=   r	   rU   r)   r*   r   is_orca_modifiedZKeyboardEvent.is_orca_modified  s0       ""DNN[%C%CCDDr   c               r%   rg   r   r   r   r   r   r?     s     ( (t (r   c                r'   )z5Return True if this is a key pad key with numlock on.)rQ   r)   r*   r   is_keypad_key_with_numlock_onZ+KeyboardEvent.is_keypad_key_with_numlock_on  s     '''r   c               r%   rg   r   r   r   r   r   r?     s     " "$ "r   c                rp   )z'Return True if this is a printable key.F)rq   rr   isprintablers   rm   r   ri   ZKeyboardEvent.is_printable_key  s/       "4yA~!!r   c               r%   rg   r   r   r   r   r   r?     s     > > >r   c                sP    V P                   \        P                  P                  8H  # )z"Returns True if the key is pressed)r   r   rD   rE   r)   r*   r   is_pressed_keyZKeyboardEvent.is_pressed_key  s     yyEOO====r   c               r%   rg   r   r   r   r   r   r?     s     C CD Cr   c                s   . \         P                  N\         P                  N\         P                  N\         P                  N\         P
                  N\         P                  N\         P                  N\         P                  N\         P                  N\         P                  N\         P                  N\         P                  N\         P                  N\         P                  N\         P                  N\         P                   N\         P"                  N\         P$                  N\         P&                  N\         P(                  N\         P*                  N\         P,                  N\         P.                  N\         P0                  N\         P2                  N\         P4                  N\         P6                  N\         P8                  N\         P:                  N\         P<                  N\         P>                  N\         P@                  N\         PB                  N\         PD                  N\         PF                  N\         PH                  N\         PJ                  N\         PL                  N\         PN                  N\         PP                  N\         PR                  N\         PT                  N\         PV                  N\         PX                  N\         PZ                  N\         P\                  N\         P^                  N\         P`                  N\         Pb                  N\         Pd                  N\         Pf                  N\         Ph                  N\         Pj                  N\         Pl                  N\         Pn                  N\         Pp                  N\         Pr                  N\         Pt                  N\         Pv                  N\         Px                  N\         Pz                  N\         P|                  NpV P~                  V9   # )z)Return True if this is a punctuation key.)@r   Z	KEY_acuteZKEY_ampersandZKEY_apostropheZKEY_asciicircumZKEY_asciitildeZKEY_asteriskZKEY_atZKEY_backslashZKEY_barZKEY_braceleftZKEY_bracerightZKEY_bracketleftZKEY_bracketrightZKEY_brokenbarZKEY_cedillaZKEY_centZ	KEY_colonZ	KEY_commaZKEY_copyrightZKEY_currencyZ
KEY_degreeZKEY_diaeresisZ
KEY_dollarZKEY_EuroSignZ	KEY_equalZ
KEY_exclamZKEY_exclamdownZ	KEY_graveZKEY_greaterZKEY_guillemotleftZKEY_guillemotrightZ
KEY_hyphenZKEY_KP_DecimalZ
KEY_KP_AddZKEY_KP_DivideZKEY_KP_MultiplyZKEY_KP_SubtractZKEY_lessZ
KEY_macronZ	KEY_minusZKEY_notsignZKEY_numbersignZKEY_paragraphZKEY_parenleftZKEY_parenrightZKEY_percentZ
KEY_periodZKEY_periodcenteredZKEY_plusZKEY_plusminusZKEY_questionZKEY_questiondownZKEY_quotedblZKEY_quoteleftZKEY_quoterightZKEY_registeredZKEY_sectionZKEY_semicolonZ	KEY_slashZKEY_sterlingZKEY_underscoreZKEY_yenrC   rk   rm   r   is_punctuation_keyZ KeyboardEvent.is_punctuation_key  s   ?
MM?
?
 ?
 	?

 ?
 ?
 JJ?
 ?
 KK?
 ?
 ?
 ?
   ?
 ?
 OO?
  LL!?
" MM#?
$ MM%?
& '?
( )?
* NN+?
, -?
. NN/?
0 1?
2 MM3?
4 NN5?
6 7?
8 MM9?
: OO;?
< !!=?
> ""??
@ NNA?
B C?
D NNE?
F G?
H I?
J K?
L LLM?
N NNO?
P MMQ?
R OOS?
T U?
V W?
X Y?
Z [?
\ OO]?
^ NN_?
` ""a?
b LLc?
d e?
f g?
h   i?
j k?
l m?
n o?
p q?
r OOs?
t u?
v MMw?
x y?
z {?
| KK}?
@ ww$r   c               r%   rg   r   r   r   r   r   r?     s     ( ($ (r   c                s<    V P                   \        P                  8H  # )z%Return True if this is the space key.)rC   r   Z	KEY_spacer)   r*   r   rj   ZKeyboardEvent.is_space  s     ww#--''r   c               r%   )r   r   zbool | Noner   r   r   r   r   r?     s     / /; /r   c                s   V P                  4       '       g   R# V P                  \        P                  8X  d   \        P
                  P                  pMvV P                  \        P                  8X  d   \        P
                  P                  pM<V P                  \        P                  8X  d   \        P
                  P                  pMR# V P                  ^V,          ,          '       * # )znReturns True if the event locked a locking key, False if the event unlocked it, and None
if not a locking key.N)r~   rC   r   r{   r   rH   Z	SHIFTLOCKr}   ZSHIFTr|   rI   r=   )r"   Zmodrm   r   get_locking_stateZKeyboardEvent.get_locking_state  s     ""$$77c'''$$..CWW***$$**CWW((($$,,C>>Q#X...r   c               r%   r/   r   r   r   r   r   r?     s     
- 
-# 
-r   c                s~    V P                  4       pVf   R# V'       g   \        P                  # \        P                  # )z0Returns the string reflecting the locking state.r@   )r   r   ZLOCKING_KEY_STATE_OFFZLOCKING_KEY_STATE_ON)r"   Zlockedrm   r   get_locking_state_stringZ&KeyboardEvent.get_locking_state_string  s5     '')>111,,,r   c               r%   r/   r   r   r   r   r   r?     s        c  r   c                s   V P                   P                  4       '       d-   V P                   P                  4       '       d   V P                   # \        P                  ! V P
                  4      pVe   V# \        P                  ! V P                  4      pV'       d$   \        V4      pVP                  4       '       d   V# V P
                  # )z5Returns the string to be used for presenting the key.)
rG   Zstripr   r
   rq   rJ   r   Zkeyval_to_unicoderC   Zchr)r"   rt   Zunicode_codepointZcharrx   r   rq   ZKeyboardEvent.get_key_name  s     ::$**"8"8":":::$$T%5%56K11$'':()D!!r   c               r%   r   r   Atspi.Accessible | Noner   r   r   r   r   r?   +  s      3 r   c                r'   )zAReturns the object believed to be associated with this key event.)rN   r)   r*   r   
get_objectZKeyboardEvent.get_object+  s     yyr   c               r   )r   objr   r   r   r   r   r   r   r   r?   0  s      5 $ r   c                    \         P                  ! \         P                  ! 4       ^,          P                  4      pV'       d   VP	                  R4      '       g   \        R4      hWn        R# )z>Sets the object believed to be associated with this key event.input_event+Unauthorized setter of input event propertyN)inspectgetmodulenamestackfilenamerR   PermissionErrorrN   )r"   r   module_name   && r   
set_objectZKeyboardEvent.set_object0  sI     ++GMMOA,>,G,GH 6 6} E E!"OPP	r   c               r%   r   r   r   r   r   r   r?   9  s      3 r   c                r'   )zAReturns the window believed to be associated with this key event.)rM   r)   r*   r   
get_windowZKeyboardEvent.get_window9       ||r   c               r   )r   windowr   r   r   r   r   r   r   r   r?   >  s      !8 T r   c                r   )z>Sets the window believed to be associated with this key event.r   r   N)r   r   r   r   rR   r   rM   )r"   r   r   r   r   
set_windowZKeyboardEvent.set_window>  I     ++GMMOA,>,G,GH 6 6} E E!"OPPr   c               r%   )r   r   default.Script | Noner   r   r   r   r   r?   G  s      1 r   c                r'   )zAReturns the script believed to be associated with this key event.)rL   r)   r*   r   
get_scriptZKeyboardEvent.get_scriptG  r   r   c               r   )r   scriptr   r   r   r   r   r   r   r   r?   L  s      !6 4 r   c                r   )z>Sets the script believed to be associated with this key event.r   r   N)r   r   r   r   rR   r   rL   )r"   r   r   r   r   
set_scriptZKeyboardEvent.set_scriptL  r   r   c               r%   r   r   zInputEventHandler | Noner   r   r   r   r   r?   U  s      5 r   c                r'   )z3Returns the handler associated with this key event.)rO   r)   r*   r   get_handlerZKeyboardEvent.get_handlerU  s     }}r   c               r%   r   r   r   r   r   r   r?   Z  s      #; r   c                	sb    \         P                  P                  V P                  P                  4      pV'       g!    \         P                  P                  R4      pVf   R #  VP                  V 4      pV#   \
         d    R p LQi ; i  \
         d    R p L<i ; i  \
         d    R p T# i ; i)Nr   )r   ZkeyBindingsMapgetrL   r3   	Exceptionget_input_handler)r"   Zbindingshandler   &  r   _get_user_handlerZKeyboardEvent._get_user_handlerZ  s    	..224<<3J3JKH  #2266yA 	006G !  	H	
      	G	s4   3A7 B
 $B 7BB
BBB.-B.c               r%   r   r   r   r   r   r   r   r   r?   p  s     
2 
2$ 
2r   c                	s$   V P                   '       g   R # V P                  4       '       d   V P                   P                  4        V P                   P                  4       P	                  4       '       d   R # V P                   P                  V 4       R # N)rL   r   Zinterrupt_presentationget_learn_mode_presenter	is_activeZpresent_keyboard_eventr)   r*   r   _presentZKeyboardEvent._presentp  s^    |||  LL//1<<002<<>>++D1r   c               r%   r   r   r   r   r   r   r?   |  s     2: 2: 2:r   c                s0   \         P                   ! 4       pV P                  4       pV'       g   RV P                   RV P                   R2pMRp\        P
                  ! \        P                  RV  24       RV P                  P                  P                  4        RV R2p\        P
                  ! \        P                  VR	4       R
V P                  .p\        P                  ! \        P                  VR4       RV P                  .p\        P                  ! \        P                  VR4       RV P                  .p\        P                  ! \        P                  VR4       V P                  '       Ed   V P                  4       ;'       g&    V P                  P                  P!                  V 4      V n        V'       g>   R\%        V P"                  4      .p\        P                  ! \        P                  VR4       V P                  P'                  4       P)                  4       '       dg   V P                  P'                  4       P*                  V n        R\%        V P,                  4      .p\        P                  ! \        P                  VR4       V P/                  4       '       d6   V P0                  ^8X  d%   \2        P4                  ! 4       P7                  V 4       V P9                  4        V P;                  4       '       d~   V P,                  '       gK   V P"                  '       dZ   V P"                  P<                  eB   V P"                  P?                  4       '       d"   \@        PB                  ! ^V PD                  4       R\         P                   ! 4       V,
          R 2p\        P
                  ! \        P                  VR4       RV P                  P                  P                  4        RV R2p\        P
                  ! \        P                  VR	4       R# )zProcesses this input event.rd   re   )rc   r]   z
vvvvv PROCESS :  vvvvvFzSCRIPT:TzWINDOW:z	LOCATION:zHANDLER:z	CONSUMER:NTOTAL PROCESSING TIME: .4fz^^^^^ PROCESS  ^^^^^
)#r    r^   rJ   rF   r   print_message
LEVEL_INFOr   r_   r`   rL   print_tokensrM   rN   r   Zkey_bindingsr   rO   r   r   r   Zhandle_eventrP   rT   r!   r   rS   Ztoggle_modifierr   r   function
is_enabledr   Ztimeout_add_consume)r"   
start_timer^   datamsgtokensra   r   processZKeyboardEvent.process|  s    YY[
,,.t''(DLL>;DDE,,4&k: !5!5!;!;!= >bfME,,c59T\\*5++VT:T\\*5++VT:tyy)5++VT:<<< 224 E E<<,,>>tD M!$c$--&89""5#3#3VTB||446@@BB!%!F!F!H!U!U%s4>>':;""5#3#3VTB  ""t'8'8A'=!--/??E  dnnn}}}!7!7!C}}''))Q.'		j(@'EFE,,c48tyy3399;<BtfHME,,c59r   c               r%   rg   r   r   r   r   r   r?     s      $ r   c                s8   \         P                   ! 4       pRV P                   RV P                   R2pRV P                  P                  P                  4        RV R2p\        P                  ! \        P                  VR4       V P                  '       dR   RV P                  P                   2p\        P                  ! \        P                  VR	4       V P                  V 4       MV P                  '       d   V P                  P                  e~   V P                  P                  4       '       d^   RV P                   2p\        P                  ! \        P                  VR	4        V P                  P                  V P                  V 4       M(Rp\        P                  ! \        P                  VR	4       R\         P                   ! 4       V,
          R 2p\        P                  ! \        P                  VR	4       RV P                  P                  P                  4        RV R2p\        P                  ! \        P                  VR4       R#   \        P                    d6   pRT 2p\        P                  ! \        P"                  TR	4        R
p?LR
p?ii ; i)zMConsumes this input event after a timeout. Returns False to stop the timeout.rd   re   r   z
vvvvv CONSUME r   r   FzKEYBOARD EVENT: Consumer is TNzKEYBOARD EVENT: Handler is z4KEYBOARD EVENT: Exception calling handler function: z.KEYBOARD EVENT: No enabled handler or consumerr   r   z^^^^^ CONSUME r   )r    rJ   rF   r   r_   r`   r   r   r   rP   r2   rO   r   r   rL   r   ZGErrorZLEVEL_WARNING)r"   r   r   r   Zerror   &    r   r   ZKeyboardEvent._consume  s    YY[
4##$C~Q7 !5!5!;!;!= >bfME,,c59>>>01H1H0IJC 0 0#t<NN4 ]]]t}}55AdmmF^F^F`F`/?C 0 0#t<D&&t||T:
 CC 0 0#t<'		j(@'EFE,,c48tyy3399;<BtfHME,,c59 ;; DLUGT##E$7$7dCCDs   '&I J$+JJ)rP   rO   rQ   rN   rL   rG   rM   rF   rC   rJ   r=   rK   r   )*r2   r3   r4   r5   r6   r$   r\   rb   r1   rh   r^   rn   ro   ru   ry   rz   r~   r   r   rT   r   r   ri   r   r   rj   r   r   rq   r   r   r   r   r   r   r   r   r   r   r   r7   __classcell__rV      @r   r8   r8   ^   s    80= 0=jB&	
DL&: 6VE(
">
CJ(
/$
- $



,
22:h r   r8   c                  sV   a  ] tR tRtRtR V 3R lltR R ltR R ltR	 tR
 t	Rt
V ;t# )BrailleEventi  z-Provides support for handling braille events.c               r   )r   eventZdictr   r   r   r   r   r   r   BrailleEvent.__annotate__  s     _ _d _t _r   c                	s   < \         SV `  \        4       Wn        \        P
                  ! 4       P                  4       V n        R # r   )rA   r$   BRAILLE_EVENTr   r   rS   get_active_scriptrL   r"   r   rV      &&r   r$   ZBrailleEvent.__init__  s.    ' 
.<.H.H.J.\.\.^r   c               r%   r/   r   r   r   r   r   r     s     3 3 3r   c                	sT    V P                   P                  4        R V P                   2# )rf   )r   r`   r   r)   r*   r   rb   ZBrailleEvent.__str__  s#    ))//#$Adjj\22r   c               r%   r   r   r   r   r   r   r     s      5 r   c                s    V P                   f   Q h T P
                  R,          pRp\        P                  pT P                   P                  T9   d   Y@P                   P                  ,          pMTP                  R4      pT'       d?   Y#9   d9   Y2,          pRT R2T.p\        P                  ! \        P                  TR4       T# T P                   P                  P                  T4      pRT R2T.p\        P                  ! \        P                  TR4       T#   \         d/    RT .p\        P                  ! \        P                  TR4        R# i ; i)	z/Returns the handler associated with this event.Nz)BRAILLE EVENT: No active script found forTcommandr   z(BRAILLE EVENT: User handler for command z isz#BRAILLE EVENT: Handler for command )rL   ZAssertionErrorr   r   r   r   r   ZbrailleBindingsMaprt   r   Zbraille_bindings)r"   r   r   Zuser_bindingsZuser_bindings_mapr   ra   r   r   ZBrailleEvent.get_handler  s-   	<<+++ zz),%)"*"="=<< 11-ll.?.?@M-11)<MW50=0FG@	MwWFu//>N,,//33G<7yDgN5++VT:-  	A4HFu//>	s   D 5EEc                s   RV R.p\         P                  ! \         P                  VR4       \        P                  ! 4       pV P	                  4       pR\        P                  ! 4       V,
          R 2p\         P
                  ! \         P                  VR4       RV R.p\         P                  ! \         P                  VR4       V# )zProcesses this event.z
vvvvv PROCESSZvvvvvFr   r   z^^^^^ PROCESSz^^^^^)r   r   r   r    _processr   )r"   r   r   Zresultr   r   r   r   ZBrailleEvent.process  s     $T735++VU;YY[
'		j(@'EFE,,c59!415++VU;r   c                	s   V P                  4       pV'       g   V P                  P                  4       P                  4       '       d-   R V .p\        P
                  ! \        P                  VR4       R# RV .p\        P
                  ! \        P                  VR4       R# VP                  '       dG   RV.p\        P
                  ! \        P                  VR4       VP                  V P                  V 4       R# )z+BRAILLE EVENT: Learn mode presenter handlesTz#BRAILLE EVENT: No handler found forFzBRAILLE EVENT: Handler is:)r   rL   r   r   r   r   r   r   )r"   r   r   r   r   r   ZBrailleEvent._process  s    ""$||446@@BBGN""5#3#3VTB;TBFu//>2G<Fu//>T\\40r   )rL   r   )r2   r3   r4   r5   r6   r$   rb   r   r   r   r7   r   r   r   r   r   r     s+    7_ _
3: r   r   c                  s   a  ] tR tRtRt ]P                  P                  4       t]P                  P                  ]4      t
]
P                  4       tV 3R ltR tRtV ;t#   ] d    Rt Li ; i)MouseButtonEventi  z2Provides support for handling mouse button events.Nc                	s  < \         SV `  \        4       VP                  V n        VP
                  V n        VP                  P                  R 4      V n	        VP                  \        R4      R V n        \        P                  ! 4       P                  4       V n        \         P                  ! 4       P#                  4       V n        RV n        V P                  '       d   V P)                  4        V P                  '       g   R# \*        P,                  ! V P$                  4      '       g   \*        P.                  ! 4       V n        V P$                  '       g   R# \*        P0                  ! V P$                  4      V n        R# )Zpzmouse:button:Ni)rA   r$   MOUSE_BUTTON_EVENTZdetail1xZdetail2yr   Zendswithr9   rr   buttonr   rS   r   rL   r   Zget_active_windowr   app_validate_coordinatesr   Zcan_be_active_windowZfind_active_windowZget_applicationr   r   r   r$   ZMouseButtonEvent.__init__&  s    +,zz**3/jj_!5b9%113EEG#//1CCE<<<&&(|||//<<%88:DK{{{..t{{;r   c           	     	s   V P                   '       g   R # V P                   P                  4       R,          w  r\        P                  ! V P                  V,
          ^,          V P
                  V,
          ^,          ,           4      ^8  d   R # RV P                   RV P
                   RV RV R2	p\        P                  ! \        P                  VR4       WuV n        V n        R # )N:i   NNzWARNING: Event coordinates (z, z) may be bogus. Updating to (r   T)	_pointerZget_positionmathZsqrtr   r   r   r   r   )r"   r   r   r   rx   r   r   Z&MouseButtonEvent._validate_coordinates>  s    }}}}}))+B/99dffqj1_
Q67"< +466("TVVH =3b1& 	 	E,,c48r   )rL   r   r   r9   r   r   r   )r2   r3   r4   r5   r6   r   ZDisplayZget_defaultZdisplayZget_default_seatZseatZget_pointerr   r   r$   r   r7   r   r   r   r   r   r     sd    <++))+{{++G4##%<0 7  s   AA 	A+*A+r   c                  s,   a  ] tR tRtRtV 3R ltRtV ;t# )RemoteControllerEventiM  zHA simple input event whose main purpose is identification of the origin.c                	s.   < \         SV `  \        4       R # r   )rA   r$   REMOTE_CONTROLLER_EVENT)r"   rV   s   &r   r$   ZRemoteControllerEvent.__init__P  s    01r   r   )r2   r3   r4   r5   r6   r$   r7   r   r   r   r   r   r   M  s    R2 2r   r   c                  sZ    ] tR tRtRtRR R lltR R ltR R ltR	 R
 ltR R lt	Rt
R# )InputEventHandleriS  zA handler for an input event.c          
     s,    V ^8  d   QhRRRRRRRRRR	/# )
r   r   zCallable[..., bool]descriptionr   learn_mode_enabledr:   enabledr   r   r   r   r   r   r   InputEventHandler.__annotate__V  s<     
& 
&%
& 
& !	
&
 
& 

&r   c                	s6    Wn         W n        W0n        W@n        R # r   )r   r   r   _enabled)r"   r   r   r   r   s   &&&&&r   r$   ZInputEventHandler.__init__V  s     .6 +(:%r   c               r   rW   r   r   r   r   r   r   b  s     / /F /t /r   c                	sd    \        V\        4      '       g   R # V P                  VP                  8H  # rY   )rZ   r   r   r[   r#   r   r\   ZInputEventHandler.__eq__b  s&    %!233}}..r   c               r%   r/   r   r   r   r   r   r   g  s     @ @ @r   c                	s:    V P                    R V P                   R2# )z (enabled: r   )r   r   r)   r*   r   rb   ZInputEventHandler.__str__g  s     ""#;t}}oQ??r   c               r%   rg   r   r   r   r   r   r   j  s      D r   c                s    RV P                    RV P                   2p\        P                  ! \        P                  VR4       V P                  # )z(Returns True if this handler is enabled.zINPUT EVENT HANDLER: z is enabled: T)r   r   r   r   r   )r"   r   rm   r   r   ZInputEventHandler.is_enabledj  sC     &d&6&6%7}T]]OTE,,c48}}r   c               r   )r   r   r:   r   r   r   r   r   r   r   r   q  s        4  D  r   c                r-   )z#Sets enabled state of this handler.N)r   )r"   r   r#   r   set_enabledZInputEventHandler.set_enabledq  s	      r   )r   r   r   r   N)TT)r2   r3   r4   r5   r6   r$   r\   rb   r   r   r7   r   r   r   r   r   S  s$    '
&/
@   r   r   ),r6   Z
__future__r   Z__id__Z__version__Z__date__Z__copyright__Z__license__r   r   r    rv   Ztypingr   r   ZgiZrequire_versionZgi.repositoryr   r   r   r@   r   r   r	   r
   r   r   r   r   Zax_utilitiesr   Zscriptsr   rB   r   r   r   r   r8   r   r   r   r   r   r   r   <module>r      s   4 2 #7     * 	   7E "   5%           #   % # -  2p	J p	dH: HT1z 1f2J 2!  ! r   