403Webshell
Server IP : 182.53.201.61  /  Your IP : 216.73.217.175
Web Server : Apache/2.2.15 (Fedora)
System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/11490/root/usr/lib/python2.6/site-packages/orca/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/11490/root/usr/lib/python2.6/site-packages/orca/keybindings.pyo
z#Jc@sdZdZdZdZdZdZyddkZWnej
onXddkZddk	Z	ddk
Z
ddkZddkl
Z
hZhZd	Zd
ZdZddd
YZdddYZdS(sLProvides support for defining keybindings and matching them to input
events.s$Id$s
$Revision$s$Date$s-Copyright (c) 2005-2008 Sun Microsystems Inc.tLGPLiN(t_cCs*|tjo|gt|<tii|}|djotii}|i|}d}|o5x2|D]&}|ddjo|d}PqkqkWn|djot|i|}|oZxW|D]K}|d}tii|}|o"||jot|i|qqWqqq"nt|S(sGiven a keysym, find all other keysyms associated with the key
    that is mapped to the given keysym.  This allows us, for example,
    to determine that the key bound to KP_Insert is also bound to KP_0.ii(	t
_keysymsCachetgtktgdktkeyval_from_nametkeymap_get_defaulttget_entries_for_keyvaltget_entries_for_keycodetkeyval_nametappend(tkeysymtkeyvaltkeymaptentriestkeycodetentrytname((s4/usr/lib/python2.6/site-packages/orca/keybindings.pyt
getAllKeysyms1s.






)cCs|pdS|tjotii}tii|}|djodSdt|<|i|}|o`x]|D]Q}|ddjo|dt|<Pnt|djo|ddt|<qsqsWqnt|S(sConverts 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.
    ii(t
_keycodeCacheRRRRR(RR
RRR((s4/usr/lib/python2.6/site-packages/orca/keybindings.pyt
getKeycode]s$


"cCsCd}|ti@o|tdd7}n|d@o|tdd7}n|dti>@o|tdd7}n|dti>@o|tdd7}n|ti@o|td	d7}n|ti@o|td
d7}n|dti>@o|tdd7}n|ti	@o|tdd7}n|S(
sYGets the modifier names of a numeric modifier mask as a human
    consumable string.
    ttOrcat+itAlt_RitSupertMeta2tAlt_LtCtrlt	Caps_LocktShift(
tsettingstORCA_MODIFIER_MASKRtpyatspitMODIFIER_META3tMODIFIER_META2tALT_MODIFIER_MASKtCTRL_MODIFIER_MASKtMODIFIER_SHIFTLOCKtSHIFT_MODIFIER_MASK(tmodsttext((s4/usr/lib/python2.6/site-packages/orca/keybindings.pytgetModifierNamess$t
KeyBindingcBs#eZdZddZdZRS(scA single key binding, consisting of a keycode, a modifier mask,
    and the InputEventHandler.
    icCs:||_||_||_||_||_d|_dS(seCreates 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 pyatspi.MODIFIER_*)
        - modifiers: the state the modifiers we care about must be in for
          this key binding to match an input event (see also
          pyatspi.MODIFIER_*)
        - handler: the InputEventHandler for this key binding
        N(tkeysymstringt
modifier_maskt	modifiersthandlertclick_counttNoneR(tselfR,R-R.R/R0((s4/usr/lib/python2.6/site-packages/orca/keybindings.pyt__init__s					cCsS|ipt|i|_n|i|jo||i@}||ijStSdS(s_Returns true if this key binding matches the given keycode and
        modifier state.
        N(RRR,R-R.tFalse(R2RR.tresult((s4/usr/lib/python2.6/site-packages/orca/keybindings.pytmatchess	

(t__name__t
__module__t__doc__R3R6(((s4/usr/lib/python2.6/site-packages/orca/keybindings.pyR+stKeyBindingscBsYeZdZdZdZdZdZdZddZdZ	d	Z
RS(
s<Structure that maintains a set of KeyBinding instances.
    cCs
g|_dS(N(tkeyBindings(R2((s4/usr/lib/python2.6/site-packages/orca/keybindings.pyR3scCsWd}x@|iD]5}|d|i|i|i|i|iif7}qW|d7}|S(Ns[
s  [%x %x %s %d %s]
t](R;R-R.R,R0R/tdescription(R2R5t
keyBinding((s4/usr/lib/python2.6/site-packages/orca/keybindings.pyt__str__s

cCs|ii|dS(sGAdds the given KeyBinding instance to this set of keybindings.
        N(R;R
(R2R>((s4/usr/lib/python2.6/site-packages/orca/keybindings.pytaddscCsIxBtdt|iD](}||i|jo|i|=qqWdS(sLRemoves the given KeyBinding instance from this set of keybindings.
        iN(trangetlenR;(R2R>ti((s4/usr/lib/python2.6/site-packages/orca/keybindings.pytremovescCs_t|i}xI|djo;|i|di|jo|i|d=n|d}qWdS(sLRemoves the given KeyBinding instance from this set of keybindings.
        iiN(RBR;R/(R2R/RC((s4/usr/lib/python2.6/site-packages/orca/keybindings.pytremoveByHandlers
tstrictcCst}x|iD]u}|djos|ii|iijoV|i|ijoC|i|ijo0|i|ijo|i|ijo
t}qq|djo'|ii|iijo
t}qq|djoZ|i|ijoC|i|ijo0|i|ijo|i|ijo
t}qq|djoG|i|ijo0|i|ijo|i|ijo
t}qqqW|S(sReturn 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, and modifier mask,
                             and click count
              "keysNoMask":  matches the modifiers, key, and click count
        RFR=tkeyst
keysNoMask(	R4R;R/R=R,R-R.R0tTrue(R2t
newKeyBindingttypeOfSearchthasItR>((s4/usr/lib/python2.6/site-packages/orca/keybindings.pyt
hasKeyBindingsL

	




	








cCstipdSg}tii}xf|iD][}|i|i|io<|i|ijo|i	|jo|i
S|i|q.q.W|idddt
x&|D]}|i	|jo|i
SqWdS(sReturns the input handler of the key binding that matches the
        given keycode and modifiers, or None if no match exists.
        tcmpcSs|i|iS((R0(txty((s4/usr/lib/python2.6/site-packages/orca/keybindings.pyt<lambda>istreverseN(t
orca_statetactiveScriptR1t
getClickCountR;R6thw_codeR.R-R0R/R
tsortRI(R2t
keyboardEventt
candidatest
clickCountR>t	candidate((s4/usr/lib/python2.6/site-packages/orca/keybindings.pytgetInputHandlerSs&


cCsot}|i|}|oOt}|itijo2y|i||Wqgtiti	qgXqkn|S(sAttempts to consume the given keyboard event.  If these
        keybindings have a handler for the given keyboardEvent, it is
        assumed the event will always be consumed.
        (
R4R\RIttypeR!tKEY_PRESSED_EVENTtprocessInputEventtdebugtprintExceptiontLEVEL_SEVERE(R2tscriptRXtconsumedR/((s4/usr/lib/python2.6/site-packages/orca/keybindings.pytconsumeKeyboardEventqs(R7R8R9R3R?R@RDRERMR\Re(((s4/usr/lib/python2.6/site-packages/orca/keybindings.pyR:s						4	(((R9t__id__t__version__t__date__t
__copyright__t__license__RtImportErrorR!R`RRSt	orca_i18nRRRRRR*R+R:(((s4/usr/lib/python2.6/site-packages/orca/keybindings.pyt<module>s*	,	9	1.

Youez - 2016 - github.com/yon3zu
LinuXploit