Ë
    g
fä`  ã                   óh  — d Z dZdZdZdZdZddlmZ ddlZ ej                  d	d
«       ddlm
Z
 ddlZddlmZ ddlmZ ddlmZ ddlmZ i Zi ZdZdZde
j,                  j.                  z  Zde
j,                  j2                  z  Zdez  Zdez  de
j,                  j.                  z  z  Zdez  de
j,                  j2                  z  z  Zdez  de
j,                  j2                  z  z  de
j,                  j.                  z  z  Zdez  de
j,                  j>                  z  z  Z dez  de
j,                  j.                  z  z  de
j,                  j>                  z  z  Z!de
j,                  j>                  z  Z"de
j,                  j>                  z  de
j,                  j.                  z  z  Z#de
j,                  j2                  z  de
j,                  j.                  z  z  Z$de
j,                  j>                  z  de
j,                  j2                  z  z  de
j,                  j.                  z  z  Z%de
j,                  j.                  z  de
j,                  j2                  z  z  de
j,                  jL                  z  z  de
j,                  jN                  z  z  Z(de
j,                  j>                  z  de
j,                  j.                  z  z  de
j,                  j2                  z  z  de
j,                  jL                  z  z  de
j,                  jN                  z  z  dez  z  Z)e)Z*d„ Z+d„ Z,d„ Z- G d„ d«      Z. G d„ d«      Z/y)zLProvides support for defining keybindings and matching them to input
events.z$Id$z
$Revision$z$Date$z-Copyright (c) 2005-2008 Sun Microsystems Inc.ÚLGPLé    )ÚGdkNÚAtspiz2.0)r   é   )Údebug)Úsettings)Ú
orca_state©Ú_é   c                 ó‚  — | sy| t         vr¬t        j                  j                  «       }t        j                  | «      }|dk(  rydt         | <   |j                  |«      \  }}|D ]Q  }|j                  dk(  r|j                  t         | <    t         |    S t         |    dk(  sŒ<|d   j                  t         | <   ŒS t         |    S )a“  Converts an XKeysym string (e.g., 'KP_Enter') to a keycode that
    should match the event.hw_code for key events.

    This whole situation is caused by the fact that Solaris chooses
    to give us different keycodes for the same key, and the keypad
    is the primary place where this happens: if NumLock is not on,
    there is no telling the difference between keypad keys and the
    other navigation keys (e.g., arrows, page up/down, etc.).  One,
    for example, would expect to get KP_End for the '1' key on the
    keypad if NumLock were not on.  Instead, we get 'End' and the
    keycode for it matches the keycode for the other 'End' key.  Odd.
    If NumLock is on, we at least get KP_* keys.

    So...when setting up keybindings, we say we're interested in
    KeySyms, but those keysyms are carefully chosen so as to result
    in a keycode that matches the actual key on the keyboard.  This
    is why we use KP_1 instead of KP_End and so on in our keybindings.

    Arguments:
    - keysym: a string that is a valid representation of an XKeysym.

    Returns an integer representing a key code that should match the
    event.hw_code for key events.
    r   )Ú_keycodeCacher   ÚKeymapÚget_defaultÚkeyval_from_nameÚget_entries_for_keyvalÚgroupÚkeycode)ÚkeysymÚkeymapÚkeyvalÚsuccessÚentriesÚentrys         ú2/usr/lib/python3/dist-packages/orca/keybindings.pyÚ
getKeycoder   S   sÊ   € ñ4 Øà”]Ñ"Ü—‘×'Ñ'Ó)ˆô ×%Ñ% fÓ-ˆØ�QŠ;Øð !"Œ�fÑØ!×8Ñ8¸Ó@Ñˆ�àò 	;ˆEØ�{‰{˜aÒØ(-¯©”˜fÑ%Øô ˜Ñ Ð ô ˜VÑ$¨Ó)Ø(/°©
×(:Ñ(:”˜fÒ%ð	;ô ˜Ñ Ð ó    c                 ó”  — d}| t         z  rEt        j                  t        j                  k(  r|t	        d«      dz   z  }nC|t	        d«      dz   z  }n1| dt
        j                  j                  z  z  r|t	        d«      dz   z  }| dz  r|t	        d«      dz   z  }| dt
        j                  j                  z  z  r|t	        d«      dz   z  }| dt
        j                  j                  z  z  r|t	        d	«      dz   z  }| t        z  r|t	        d
«      dz   z  }| t        z  r|t	        d«      dz   z  }| t        z  r|t	        d«      dz   z  }|S )zYGets the modifier names of a numeric modifier mask as a human
    consumable string.
    Ú ÚInsertú+Ú	Caps_Lockr   é€   ÚAlt_RÚSuperÚMeta2ÚAltÚCtrlÚShift)ÚORCA_MODIFIER_MASKr   ÚkeyboardLayoutÚGENERAL_KEYBOARD_LAYOUT_DESKTOPr   r   ÚModifierTypeÚ	SHIFTLOCKÚMETA3ÚMETA2ÚALT_MODIFIER_MASKÚCTRL_MODIFIER_MASKÚSHIFT_MODIFIER_MASK)ÚmodsÚtexts     r   ÚgetModifierNamesr6   Œ   sW  € ð
 €DØÔ Ò Ü×"Ñ"¤h×&NÑ&NÒNð ”A�h“K #Ñ%Ñ%‰Dð ”A�k“N SÑ(Ñ(‰DØ	�”e×(Ñ(×2Ñ2Ñ2Ò	3ð 	”�+“ Ñ$Ñ$ˆð ˆc‚zð 	”�'“
˜SÑ Ñ ˆØˆq”E×&Ñ&×,Ñ,Ñ,Ò-ð 	”�'“
˜SÑ Ñ ˆØˆq”E×&Ñ&×,Ñ,Ñ,Ò-ð 	”�'“
˜SÑ Ñ ˆð ÔÒð 	”�%“˜3‘ÑˆØÔ Ò ð 	”�&“	˜C‘ÑˆØÔ!Ò!ð 	”�'“
˜SÑ Ñ ˆØ€Kr   c                 óD   — | dk(  rt        d«      S | dk(  rt        d«      S y)zsReturns a human-consumable string representing the number of
    clicks, such as 'double click' and 'triple click'.é   zdouble clické   ztriple clickr   r
   )Úcounts    r   ÚgetClickCountStringr;   Ä   s/   € ð �‚zô
 �Ó Ð Ø�‚zô
 �Ó Ð Ør   c                   óV   — e Zd ZdZ	 dd„Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zd
„ Zd„ Zd„ Zy)Ú
KeyBindingzcA single key binding, consisting of a keycode, a modifier mask,
    and the InputEventHandler.
    c                 ót   — || _         || _        || _        || _        || _        d| _        || _        g | _        y)aí  Creates a new key binding.

        Arguments:
        - keysymstring: the keysymstring - this is typically a string
          from /usr/include/X11/keysymdef.h with the preceding 'XK_'
          removed (e.g., XK_KP_Enter becomes the string 'KP_Enter').
        - modifier_mask: bit mask where a set bit tells us what modifiers
          we care about (see Atspi.ModifierType.*)
        - modifiers: the state the modifiers we care about must be in for
          this key binding to match an input event (see also
          Atspi.ModifierType.*)
        - handler: the InputEventHandler for this key binding
        - enabled: Whether this binding can be bound and used, i.e. based
          on mode, the feature being enabled/active, etc.
        N)ÚkeysymstringÚmodifier_maskÚ	modifiersÚhandlerÚclick_countr   Ú_enabledÚ	_grab_ids)Úselfr?   r@   rA   rB   rC   Úenableds          r   Ú__init__zKeyBinding.__init__Û   s?   € ð$ )ˆÔØ*ˆÔØ"ˆŒØˆŒØ&ˆÔØˆŒØˆŒØˆ�r   c           	      ó  — | j                   sd| j                  › d�S | j                  rd| j                  › d�}nd| j                  › d�}|› d| j                   › d| j                  › d| j                  › d| j
                  › �	S )	NzUNBOUND BINDING for 'ú'zENABLED BINDING for 'zDISABLED BINDING for 'ú: z mods=z clicks=z
 grab ids=)r?   rB   rD   rA   rC   rE   )rF   Ústrings     r   Ú__str__zKeyBinding.__str__ö   s�   € Ø× Ò Ø*¨4¯<©<¨.¸Ð:Ð:Ø�=Š=Ø,¨T¯\©\¨N¸!Ð<‰Fà-¨d¯l©l¨^¸1Ð=ˆFàˆh�b˜×*Ñ*Ð+¨6°$·.±.Ð1AÀÈ$×JZÑJZÐI[ð \ØŸ™Ð'ð)ð	
r   c                 óª   — | j                   st        | j                  «      | _         | j                   |k(  r|| j                  z  }|| j                  k(  S y)z_Returns true if this key binding matches the given keycode and
        modifier state.
        F)r   r   r?   r@   rA   )rF   r   rA   Úresults       r   ÚmatcheszKeyBinding.matches  sK   € ð �|Š|Ü% d×&7Ñ&7Ó8ˆDŒLà�<‰<˜7Ò"Ø ×!3Ñ!3Ñ3ˆFØ˜TŸ^™^Ñ+Ð+àr   c                 ó   — | j                   S )z+Returns True if this KeyBinding is enabled.©rD   ©rF   s    r   Ú
is_enabledzKeyBinding.is_enabled  s   € ð �}‰}Ðr   c                 ó   — || _         y)z$Set this KeyBinding's enabled state.NrR   )rF   rG   s     r   Úset_enabledzKeyBinding.set_enabled  s   € ð  ˆ�r   c                 óN   — 	 | j                   j                  S # t        $ r Y yw xY w)z8Returns the description of this binding's functionality.r   )rB   ÚdescriptionÚ	ExceptionrS   s    r   rX   zKeyBinding.description  s)   € ð	Ø—<‘<×+Ñ+Ð+øÜò 	Ùð	ús   ‚ ˜	$£$c                 ó    — t        | j                  «      }t        | j                  «      }| j                  }|› |› d|› �}|j                  «       S )zAReturns a more human-consumable string representing this binding.ú )r6   rA   r;   rC   r?   Ústrip)rF   r4   Ú
clickCountr   rL   s        r   ÚasStringzKeyBinding.asString&  sM   € ô   §¡Ó/ˆÜ(¨×)9Ñ)9Ó:ˆ
Ø×"Ñ"ˆØ�6˜&˜  : ,Ð/ˆà�|‰|‹~Ðr   c                 ó(  — g }| j                   st        | j                  «      | _         | j                  t        z  r…t
        j                  }|€|S g }| j                  t         z  }t        j                  D ]G  }t        |«      }|dk(  r|dk(  rt        d«      }|j                  |«      }|j                  ||z  «       ŒI n| j                  g}|D ]?  }t        j                  «       }| j                   |_         ||_        |j                  |«       ŒA |S )z¹ return a list of Atspi key definitions for the given binding.
            This may return more than one binding if the Orca modifier is bound
            to more than one key.
        r   Ú
Shift_Lockr"   )r   r   r?   rA   r*   r	   Údevicer   ÚorcaModifierKeysÚmap_modifierÚappendr   ÚKeyDefinition)	rF   Úretra   ÚmodListÚ	otherModsÚkeyr   ÚmodÚkds	            r   ÚkeyDefszKeyBinding.keyDefs0  s   € ð
 ˆØ�|Š|Ü% d×&7Ñ&7Ó8ˆDŒLà�>‰>Ô.Ò.Ü×&Ñ&ˆFØˆ~Ø�
ØˆGØŸ™Ô*<Ð)<Ñ<ˆIÜ×0Ñ0ò 0�Ü$ S›/�Ø˜a’< C¨<Ò$7Ü(¨Ó5�GØ×)Ñ)¨'Ó2�Ø—‘˜s Y™Õ/ñ0ð —~‘~Ð&ˆGØò 	ˆCÜ×$Ñ$Ó&ˆBØŸ™ˆBŒJØˆBŒLØ�J‰J�r�Nð		ð
 ˆ
r   c                 ó,   — t        | j                  «      S )zIReturns True if there are existing grabs associated with this KeyBinding.)ÚboolrE   rS   s    r   ÚhasGrabszKeyBinding.hasGrabsN  s   € ô �D—N‘NÓ#Ð#r   c                 óH  — | j                   r| j                  syt        j                  €y| j	                  «       D ];  }| j
                  j                  t        j                  j                  |d«      «       Œ= d| › �}t        j                  t        j                  |d«       y)z#Adds key grabs for this KeyBinding.NzGRABS ADDED: T)r?   rD   r	   ra   rl   rE   rd   Úadd_key_grabr   ÚprintMessageÚ
LEVEL_INFO)rF   rk   Úmsgs      r   ÚaddGrabszKeyBinding.addGrabsS  s‡   € ð ×!Ò! d§m¢mØä×ÑÐ$Øà—,‘,“.ò 	LˆBØ�N‰N×!Ñ!¤*×"3Ñ"3×"@Ñ"@ÀÀTÓ"JÕKð	Lð ˜d˜VÐ$ˆÜ×Ñœ5×+Ñ+¨S°$Õ7r   c                 óP  — | j                   r9t        j                  s)d}t        j                  t        j
                  |dd«       y| j                   D ]!  }t        j                  j                  |«       Œ# g | _         d| › �}t        j                  t        j                  |d«       y)z&Removes key grabs for this KeyBinding.z+WARNING: Have grab to remove but no device.TNzGRABS REMOVED: )rE   r	   ra   r   rr   ÚLEVEL_WARNINGÚremove_key_grabrs   )rF   rt   Úids      r   ÚremoveGrabszKeyBinding.removeGrabsb  s‡   € ð �>Š>¤*×"3Ò"3Ø?ˆCÜ×Ñœu×2Ñ2°C¸¸tÔDØà—.‘.ò 	2ˆBÜ×Ñ×-Ñ-¨bÕ1ð	2àˆŒà ˜vÐ&ˆÜ×Ñœ5×+Ñ+¨S°$Õ7r   N)r   T)Ú__name__Ú
__module__Ú__qualname__Ú__doc__rH   rM   rP   rT   rV   rX   r^   rl   ro   ru   rz   © r   r   r=   r=   Ö   sC   „ ñð
 +/óò6

òò$ò
 ò
òòò<$ò
8ó8r   r=   c                   ó~   — e Zd ZdZd„ Zd„ Zdd„Zdd„Zd„ Zdd„Z	dd„Z
d	„ Zd
„ Zdd„Zdd„Zdd„Zd„ Zd„ Zd„ Zd„ Zy)ÚKeyBindingsz<Structure that maintains a set of KeyBinding instances.
    c                 ó   — g | _         y ©N©ÚkeyBindingsrS   s    r   rH   zKeyBindings.__init__u  s
   € ØˆÕr   c                 ó<   — d}| j                   D ]
  }||› d�z  }Œ |S )Nr   ú
r„   )rF   rO   Ú
keyBindings      r   rM   zKeyBindings.__str__x  s2   € ØˆØ×*Ñ*ò 	(ˆJØ˜˜ BÐ'Ñ'‰Fð	(àˆr   c                 ó0  — |j                   r\| j                  |d«      rJd|j                  «       › d|j                  «       › d�}t	        j
                  t        j                  |d«       | j                  j                  |«       |r|j                  «        yy)zOAdds KeyBinding instance to this set of keybindings, optionally updating grabs.Ú
keysNoMaskúKEYBINDINGS: 'ú' (z) already in keybindingsTN)
r?   ÚhasKeyBindingr^   rX   r   rr   rs   r…   rd   ru   )rF   rˆ   ÚincludeGrabsrt   s       r   ÚaddzKeyBindings.add~  s‘   € ð ×"Ò" t×'9Ñ'9¸*ÀlÔ'Sà 
× 3Ñ 3Ó 5Ð6ð 7Ø×)Ñ)Ó+Ð,Ð,DðFð ô ×Ñœu×/Ñ/°°dÔ;à×Ñ×Ñ 
Ô+ÙØ×ÑÕ!ð r   c                 óè  — || j                   vr|| j                  |j                  «      }|syd|d|g}t        j                  t        j
                  |d«       | j                  |j                  «      D ]  }| j                  ||«       Œ y|j                  «       r=|r|j                  «        n*d|dg}t        j                  t        j
                  |d«       | j                   j                  |«       y)zKRemoves KeyBinding from this set of keybindings, optionally updating grabs.Nz5KEYBINDINGS: Warning: No binding in set to remove forzAlternates:TzKEYBINDINGS: Warning:zwill be removed but has grabs.)	r…   ÚgetBindingsForHandlerrB   r   ÚprintTokensrw   Úremovero   rz   )rF   rˆ   rŽ   Ú
candidatesÚtokensÚ	candidates         r   r“   zKeyBindings.removeŒ  sã   € ð ˜T×-Ñ-Ñ-Ø×3Ñ3°J×4FÑ4FÓGˆJñ
 Øð NÈzØ# Zð1ˆFä×Ñœe×1Ñ1°6¸4Ô@Ø!×7Ñ7¸
×8JÑ8JÓKò 5�	Ø—‘˜I |Õ4ð5àà×ÑÔ ÙØ×&Ñ&Õ(ð 2°:Ð?_Ð`�Ü×!Ñ!¤%×"5Ñ"5°v¸tÔDà×Ñ×Ñ 
Õ+r   c                 ó   — | j                    S )zAReturns True if there are no bindings in this set of keybindings.r„   rS   s    r   ÚisEmptyzKeyBindings.isEmpty«  s   € ð ×#Ñ#Ð#Ð#r   c                 óì   — d}|r|d|› �z  }t        j                  t         j                  |d«       | j                  D ]4  }|j	                  «       sŒ|j                  «       rŒ%|j                  «        Œ6 y)z?Adds grabs for all enabled bindings in this set of keybindings.zKEYBINDINGS: Adding key grabsrK   TN)r   rr   rs   r…   rT   ro   ru   ©rF   Úreasonrt   Úbindings       r   ÚaddKeyGrabszKeyBindings.addKeyGrabs°  sl   € ð .ˆÙØ�R˜�x�=Ñ ˆCÜ×Ñœ5×+Ñ+¨S°$Ô7à×'Ñ'ò 	#ˆGØ×!Ñ!Õ#¨G×,<Ñ,<Õ,>Ø× Ñ Õ"ñ	#r   c                 óÊ   — d}|r|d|› �z  }t        j                  t         j                  |d«       | j                  D ]#  }|j	                  «       sŒ|j                  «        Œ% y)z.Removes all grabs for this set of keybindings.zKEYBINDINGS: Removing key grabsrK   TN)r   rr   rs   r…   ro   rz   rš   s       r   ÚremoveKeyGrabszKeyBindings.removeKeyGrabs¼  sa   € ð 0ˆÙØ�R˜�x�=Ñ ˆCÜ×Ñœ5×+Ñ+¨S°$Ô7à×'Ñ'ò 	&ˆGØ×ÑÕ!Ø×#Ñ#Õ%ñ	&r   c                 óH   — | j                   D ]  }|j                  |k(  sŒ y y)z@Returns True if the handler is found in this set of keybindings.TF©r…   rB   ©rF   rB   rœ   s      r   Ú
hasHandlerzKeyBindings.hasHandlerÈ  s-   € ð ×'Ñ'ò 	ˆGØ�‰ 'Ó)Ùð	ð r   c                 ó~   — | j                   D ].  }|j                  |k(  sŒ|j                  j                  «       sŒ. y y)zOReturns True if the handler is found in this set of keybindings and is enabled.TF)r…   rB   rT   r¢   s      r   ÚhasEnabledHandlerzKeyBindings.hasEnabledHandlerÑ  s<   € ð ×'Ñ'ò 	ˆGØ�‰ 'Ó)¨g¯o©o×.HÑ.HÕ.JÙð	ð r   c                 óÎ  — | j                   D �]Õ  }|dk(  r²|j                  sŒ|j                  sŒ#|j                  j                  |j                  j                  k(  sŒQ|j                  |j                  k(  sŒk|j                  |j                  k(  sŒ…|j
                  |j
                  k(  sŒŸ|j                  |j                  k(  sŒ¹ y|dk(  rK|j                  sŒÍ|j                  sŒÚ|j                  j                  |j                  j                  k(  s�Œ	 y|dk(  rn|j                  |j                  k(  s�Œ+|j                  |j                  k(  s�ŒF|j
                  |j
                  k(  s�Œa|j                  |j                  k(  s�Œ| y|dk(  s�Œ…|j                  |j                  k(  s�Œ |j
                  |j
                  k(  s�Œ»|j                  |j                  k(  s�ŒÖ y y)a�  Return True if keyBinding is already in self.keyBindings.

           The typeOfSearch can be:
              "strict":      matches description, modifiers, key, and click count
              "description": matches only description
              "keys":        matches the modifiers, key, modifier mask, and click count
              "keysNoMask":  matches the modifiers, key, and click count
        ÚstrictTrX   ÚkeysrŠ   F)r…   rB   rX   r?   r@   rA   rC   )rF   ÚnewKeyBindingÚtypeOfSearchrˆ   s       r   r�   zKeyBindings.hasKeyBindingÚ  sˆ  € ð ×*Ñ*ó 	 ˆJØ˜xÒ'Ø×%Ó%¨-×*?Ó*?Ø!×)Ñ)×5Ñ5¸×9NÑ9N×9ZÑ9ZÓZØ!×.Ñ.°-×2LÑ2LÓLØ!×/Ñ/°=×3NÑ3NÓNØ!×+Ñ+¨}×/FÑ/FÓFØ!×-Ñ-°×1JÑ1JÓJÙØ Ò.Ø×%Ó%¨-×*?Ó*?Ø!×)Ñ)×5Ñ5¸×9NÑ9N×9ZÑ9ZÔZÙØ Ò'Ø×*Ñ*¨m×.HÑ.HÔHØ!×/Ñ/°=×3NÑ3NÔNØ!×+Ñ+¨}×/FÑ/FÔFØ!×-Ñ-°×1JÑ1JÔJÙØ Ô-Ø×*Ñ*¨m×.HÑ.HÔHØ!×+Ñ+¨}×/FÑ/FÔFØ!×-Ñ-°×1JÑ1JÔJÙð/	 ð2 r   c                 ó  — | j                   D �cg c]  }|j                  sŒ|‘Œ }}|rR|D �cg c]  }|j                  j                  ‘Œ }}t	        |j
                  t        |«      «      D �cg c]  }||   ‘Œ	 }}i }|D ]s  }|j                  «       }|j                  |«      }|�;d|d|j                  «       d|g}	t        j                  t        j                  |	d«       |j                  «       ||<   Œu |S c c}w c c}w c c}w )zÏReturns the KeyBinding instances which are bound to a keystroke.

        Arguments:
        - uniqueOnly: Should alternative bindings for the same handler be
          filtered out (default: False)
        z
WARNING: 'rŒ   z) also matches:T)r…   r?   rB   rX   ÚmapÚindexÚsetr^   Úgetr   r’   rs   )
rF   Ú
uniqueOnlyÚkbÚboundÚhandlersÚiÚbindingsrL   Úmatchr•   s
             r   ÚgetBoundBindingszKeyBindings.getBoundBindingsÿ  só   € ð #×.Ñ.ÖB˜°"·/³/’ÐBˆÐBÙØ9>Ö?°2˜Ÿ
™
×.Ó.Ð?ˆHÐ?Ü'*¨8¯>©>¼3¸x»=Ó'IÖJ !�U˜1“XÐJˆEÐJàˆØò 	0ˆBØ—[‘[“]ˆFØ—L‘L Ó(ˆEØÐ Ø&¨°°r·~±~Ó7GÐIZÐ\aÐb�Ü×!Ñ!¤%×"2Ñ"2°F¸DÔAØ!Ÿ~™~Ó/ˆH�VÒð	0ð ˆùò Cùâ?ùÚJs   �C7¡C7­C<Á-Dc                 óf  — |r)| j                   D �cg c]  }|j                  sŒ|‘Œ }}d}n| j                   }d}|D �cg c]  }|j                  «       sŒ|‘Œ }}dt        |«      › d|› dt        | j                   «      › d�}t	        j
                  t        j                  |d«       |S c c}w c c}w )z>Returns the KeyBindings instances which can be bound and used.zbound bindingsrµ   zKEY BINDINGS: r[   z found out of ú.T)r…   r?   rT   Úlenr   rr   rs   )rF   Ú	boundOnlyr±   rµ   ÚboundStringrG   rt   s          r   ÚgetEnabledBindingszKeyBindings.getEnabledBindings  s©   € ñ Ø%)×%5Ñ%5ÖI˜r¸¿»šÐIˆHÐIØ*‰Kà×'Ñ'ˆHØ$ˆKà (Ö<˜"¨B¯M©M­O’2Ð<ˆÐ<Øœs 7›|˜n¨A¨k¨]¸.ÌÈT×M]ÑM]ÓI^ÐH_Ð_`ÐaˆÜ×Ñœ5×+Ñ+¨S°$Ô7Øˆùò Jùò =s   ‘B)£B)¾B.ÁB.c                 ó`   — | j                   D �cg c]  }|j                  |k(  sŒ|‘Œ c}S c c}w )z9Returns the KeyBinding instances associated with handler.r¡   )rF   rB   r±   s      r   r‘   z!KeyBindings.getBindingsForHandler&  s)   € ð "×-Ñ-ÖG�r°·±¸wÓ1F’ÒGÐGùÒGs   �+¤+c           	      ól  — t         j                  t         j                  kD  ry t        |«      dk  ry t        t	        t        d„ |«      «      «      t        |«      k(  ry d„ }d|j                  «       › ddj                  t        ||«      «      › �}t        j                  t         j                  |d«       y )Nr   c                 ó   — | j                   S rƒ   ©rC   ©Úxs    r   ú<lambda>z4KeyBindings._checkMatchingBindings.<locals>.<lambda>4  s
   €  §¡€ r   c                 ó:   — | j                   › d| j                  › d�S )Nz (zx))rB   rC   rÂ   s    r   ÚtoStringz4KeyBindings._checkMatchingBindings.<locals>.toString7  s   € Ø—i‘i�[  1§=¡= /°Ð4Ð4r   r‹   z' matches multiple handlers: z, T)	r   Ú
debugLevelrs   rº   r®   r¬   ÚasSingleLineStringÚjoinrr   )rF   ÚkeyboardEventrO   rÆ   rt   s        r   Ú_checkMatchingBindingsz"KeyBindings._checkMatchingBindings+  s¦   € Ü×Ñœe×.Ñ.Ò.Øô ˆv‹;˜!ÒØô Œs”3Ñ.°Ó7Ó8Ó9¼SÀ»[ÒHØò	5ð ˜]×=Ñ=Ó?Ð@ð A*Ø*.¯)©)´C¸À&Ó4IÓ*JÐ)KðMð 	ô 	×Ñœ5×+Ñ+¨S°$Õ7r   c                 óV  — g }g }|j                  «       }| j                  D ]€  }|j                  |j                  |j                  «      sŒ*|j
                  |j                  k(  r |j                  |k(  r|j                  |«       |j                  sŒp|j                  |«       Œ‚ d|j                  «       › d�|g}t        j                  t        j                  |d«       | j                  ||«       |r|d   j                  S |j                  «       ryd|j                  «       › d�|g}t        j                  t        j                  |d«       |j!                  t#        j$                  d„ «      ¬«       | j                  ||«       |D ]  }|j                  |k  sŒ|j                  c S  y)	z‡Returns the input handler of the key binding that matches the
        given keycode and modifiers, or None if no match exists.
        zKEYBINDINGS: z matchesTr   Nz fallback candidatesc                 ó4   — |j                   | j                   z
  S rƒ   rÁ   )rÃ   Úys     r   rÄ   z-KeyBindings.getInputHandler.<locals>.<lambda>e  s   € ¸a¿m¹mÈaÏmÉmÑ>[€ r   )ri   )ÚgetClickCountr…   rP   Úhw_coderA   r@   rC   rd   r?   rÈ   r   r’   rs   rË   rB   ÚisKeyPadKeyWithNumlockOnÚsortÚ	functoolsÚ
cmp_to_key)rF   rÊ   rP   r”   r]   rˆ   r•   r–   s           r   ÚgetInputHandlerzKeyBindings.getInputHandler@  s‘  € ð
 ˆØˆ
Ø"×0Ñ0Ó2ˆ
Ø×*Ñ*ò 		2ˆJØ×!Ñ! -×"7Ñ"7¸×9PÑ9PÕQØ×+Ñ+¨}×/FÑ/FÒFØ×)Ñ)¨ZÒ7Ø—N‘N :Ô.ð ×*Ó*Ø×%Ñ% jÕ1ð		2ð " -×"BÑ"BÓ"DÐ!EÀXÐNÐPWÐXˆÜ×Ñœ%×*Ñ*¨F°DÔ9à×#Ñ# M°7Ô;ÙØ˜1‘:×%Ñ%Ð%à×1Ñ1Ô3Øà! -×"BÑ"BÓ"DÐ!EÐEYÐZØðˆä×Ñœ%×*Ñ*¨F°DÔ9ð 	�‰œI×0Ñ0Ñ1[Ó\ˆÔ]Ø×#Ñ# M°:Ô>Ø#ò 	)ˆIØ×$Ñ$¨
Ó2Ø ×(Ñ(Ò(ð	)ð r   c           
      ó  — |D ]l  }|d   }|d   }|d   }|d   }	 |d   }||v r"| j                  t        |||||   |«      «       ŒCd|dg}	t        j                  t        j
                  |	d«       Œn y	# t         $ r d}Y Œ`w xY w)
a4   Takes the keymappings and tries to find a matching named
           function in handlers.
           keymap is a list of lists, each list contains 5 elements
           If addUnbound is set to true, then at the end of loading all the
           keybindings, any remaining functions will be unbound.
        r   r   r8   r9   é   zKEYBINDINGS: Could not findzhandler for keybinding.TN)rY   r�   r=   r   r’   rs   )
rF   r   r³   r´   r?   ÚmodifierMaskrA   rB   r]   r•   s
             r   ÚloadzKeyBindings.loadm  s³   € ð ò 	BˆAØ˜Q™4ˆLØ˜Q™4ˆLØ˜!™ˆIØ˜‘dˆGðØ˜q™T�
ð ˜(Ñ"Ø—‘œØ  ,°	¸8ÀGÑ;LÈjóZõ [ð 8¸ÐB[Ð\�Ü×!Ñ!¤%×"2Ñ"2°F¸DÕAñ	Bøô ò Ø’
ðús   ›A3Á3BÂ BN)F)r   )r§   )r{   r|   r}   r~   rH   rM   r�   r“   r˜   r�   rŸ   r£   r¥   r�   r·   r½   r‘   rË   rÕ   rÙ   r   r   r   r�   r�   q  s[   „ ñòòó"ó,ò>$ó

#ó
&òòó#óJó0òHò
8ò*+óZBr   r�   )0r~   Ú__id__Ú__version__Ú__date__Ú__copyright__Ú__license__Úgi.repositoryr   ÚgiÚrequire_versionr   rÓ   r   r   r   r	   Ú	orca_i18nr   Ú_keysymsCacher   ÚMODIFIER_ORCAÚNO_MODIFIER_MASKr-   ÚALTr1   ÚCONTROLr2   r*   ÚORCA_ALT_MODIFIER_MASKÚORCA_CTRL_MODIFIER_MASKÚORCA_CTRL_ALT_MODIFIER_MASKÚSHIFTÚORCA_SHIFT_MODIFIER_MASKÚORCA_ALT_SHIFT_MODIFIER_MASKr3   ÚSHIFT_ALT_MODIFIER_MASKÚCTRL_ALT_MODIFIER_MASKÚSHIFT_ALT_CTRL_MODIFIER_MASKr0   r/   ÚCOMMAND_MODIFIER_MASKÚNON_LOCKING_MODIFIER_MASKÚdefaultModifierMaskr   r6   r;   r=   r�   r   r   r   ú<module>rô      sv  ðñ(ð €Ø€Ø€Ø?€Ø€å ã 	Ø €× Ñ �7˜EÔ "Ý ã å Ý Ý å à€Ø€à€Ø!"Ð Ø!" e×&8Ñ&8×&<Ñ&<Ñ!<Ð Ø!" e×&8Ñ&8×&@Ñ&@Ñ!@Ð Ø!" mÑ!3Ð Ø!" mÑ!3Ø!" e×&8Ñ&8×&<Ñ&<Ñ!<ñ"=Ð à!" mÑ!3Ø!" e×&8Ñ&8×&@Ñ&@Ñ!@ñ"AÐ à!" mÑ!3Ø!" e×&8Ñ&8×&@Ñ&@Ñ!@ñ"Aà!" e×&8Ñ&8×&<Ñ&<Ñ!<ñ"=Ð ð "# mÑ!3Ø!" e×&8Ñ&8×&>Ñ&>Ñ!>ñ"?Ð à!" mÑ!3Ø!" e×&8Ñ&8×&<Ñ&<Ñ!<ñ"=à!" e×&8Ñ&8×&>Ñ&>Ñ!>ñ"?Ð ð "# e×&8Ñ&8×&>Ñ&>Ñ!>Ð Ø!" e×&8Ñ&8×&>Ñ&>Ñ!>Ø!" e×&8Ñ&8×&<Ñ&<Ñ!<ñ"=Ð à!" e×&8Ñ&8×&@Ñ&@Ñ!@Ø!" e×&8Ñ&8×&<Ñ&<Ñ!<ñ"=Ð à!" e×&8Ñ&8×&>Ñ&>Ñ!>Ø!" e×&8Ñ&8×&@Ñ&@Ñ!@ñ"Aà!" e×&8Ñ&8×&<Ñ&<Ñ!<ñ"=Ð ð "# e×&8Ñ&8×&<Ñ&<Ñ!<Ø!" e×&8Ñ&8×&@Ñ&@Ñ!@ñ"Aà!" e×&8Ñ&8×&>Ñ&>Ñ!>ñ"?ð "# e×&8Ñ&8×&>Ñ&>Ñ!>ñ"?Ð ð "# e×&8Ñ&8×&>Ñ&>Ñ!>Ø!" e×&8Ñ&8×&<Ñ&<Ñ!<ñ"=à!" e×&8Ñ&8×&@Ñ&@Ñ!@ñ"Að "# e×&8Ñ&8×&>Ñ&>Ñ!>ñ"?ð "# e×&8Ñ&8×&>Ñ&>Ñ!>ñ	"?ð
 "# mÑ!3ñ"4Ð ð 0Ð ò7!òr6òp÷$Y8ñ Y8÷vVBò VBr   