+
     Bi~;                        R t ^ RIHtHtHtHt ^ RIHtHtH	t	H
t
HtHt ^ RIHt ^ RIHt ^ RIt^ RItRt]! ]P(                  ]P*                  ,           4      t]! R4      tRtRtRt]],           ],           ],           ],           ],           tR t ! R R	]4      t ! R
 R]4      t]R8X  d"   ^ RI H!t! ]!! R^RR7       ^ RI"H#t# ]#! ]4       R# R# )z6
Dialog for building Tkinter accelerator key bindings
)ToplevelListbox	StringVarTclError)FrameButtonCheckbuttonEntryLabel	Scrollbar)
messagebox)_setup_dialogNz~!@#%^&*()_-+={}[]|;:,.<>/?c                b   / RRbRRbRRbRRbR	R
bRRbRRbRRbRRbRRbRRbRRbRRbRRbRRbRR bR!R"b/ R#R$bR%R&bR'R(bR)R*bR+R,bR-R.bR/R0bR1R2bR3R4bR5R6bR7R8bR9R:bR;R<bR=R>bR?R@bRARBbRCRDbCRERE/CpVP                  W 4      p RFV9   d&   V \        P                  9   d   V P                  4       p RGV  2# )Hz3Translate from keycap symbol to the Tkinter keysym.Spacespace~
asciitilde!exclam@at#
numbersign%percent^asciicircum&	ampersand*asterisk(	parenleft)
parenright_
underscore-minus+plus=equal{	braceleft}
braceright[bracketleft]bracketright|bar;	semicolon:colon,comma.period<less>greater/slash?questionPage UpPrior	Page DownNext
Left ArrowLeftRight ArrowRightUp ArrowUp
Down ArrowDownTabShiftzKey-)getstringascii_lowercaseupper)key	modifiersmappings   && )/usr/lib/python3.14/idlelib/config_key.pytranslate_keyr]      s   @ww @@!(@,/@69,@	@}@.1+@ 
@  @ .1@ 	@ "'	@ ,/v	@ 8;7	@
 @
 !@ @  #>@ 47u@ @ !@ +.g@ 8;8@ @ I@ (+7@ 58
@ g@  +6@ @ "/w@ t@ *6@ 49@G ++c
C)v'='= =iik#<    c                   |   a a ] tR t^,t oRtV 3R ltR tR tR tR t	RR lt
R tR	 tR
 tR tR tR tRtVtV ;t# )GetKeysFramezKey Sequence Errorc                  < \         SV `  V4       ^V R&   RV R&   Wn        W n        W0n        RV n        \        V 4      V n        V P                  P                  R4       V P                  4        . V n
        V P                   F:  p\        V 4      pVP                  R4       V P                  P                  V4       K<  	  RV n        V P                  4        R# )z
parent - parent of this dialog
action - the name of the virtual event these keys will be
         mapped to
current_key_sequences - a list of all key sequence lists
         currently mapped to virtual events, for overlap checking
borderwidthsunkenrelief FN)super__init__parentactioncurrent_key_sequencesresultr   
key_stringsetset_modifiers_for_platformmodifier_varsrZ   appendadvancedcreate_widgets)selfrh   ri   rj   modifiervariable	__class__s   &&&&  r\   rg   GetKeysFrame.__init__1   s     	 ]!X%:"#D/B'')H HLL%%h/ ' r^   c                2    \         P                  ! V/ VB  R # N)r   	showerror)rs   argskwargss   &*,r\   rz   GetKeysFrame.showerrorL   s    d-f-r^   c           
     R   \        V R R7      V n        V P                  P                  ^ ^ R^^R7       \        V P                  RV P                   R2R7      pVP                  RR7       \        V P                  R	V P                  R
^R7      pVP                  ^^RR7       \        V 4      V n        V P                  P                  ^^ R^R7       / V n        ^ p\        V P                  V P                  4       Fp  w  rEV P                  P                  WD4      p\        V P                  V P                  VWTRR7      pVP                  ^ V^RR7       WpP                  V&   V^,          pKr  	  \        V P                  R	R,R7      pVP                  ^^ ^^RR7       \!        V P                  ^^
RR7      V n        V P"                  P$                  ! R.\&        O5!   V P"                  P)                  RV P*                  4       V P"                  P                  ^ ^^RR7       \-        V P                  RV P"                  P.                  R7      p	V P"                  P1                  V	P2                  R7       V	P                  ^ ^^RR7       \5        V P                  RV P6                  R7      V n        V P8                  P                  ^^ ^R7       \        V R R7      V n        V P:                  P                  ^ ^ R^^R7       \        V P:                  R	R!V P                   R"2R#,           R7      p
V
P                  RR7       \=        V P:                  V P                  R$7      V n        V P>                  P                  RR%7       \        V 4      V n         V P@                  P                  ^^ R^R7       \        V P@                  R	R-R7      pVP                  ^ ^ RR&7       \5        W PB                  R'R(7      V n"        V PD                  P                  ^^ R)^^R*7       V PC                  4        R+# ).keyseq_basic)namensew)rowcolumnstickypadxpadyzNew keys for 'z' :textw)anchorleftgroove)justifytextvariablerd   rb   x)ipadxipadyfill)r   r   r   r   re   )commandr   ru   onvalueoffvalue)r   r   r   r   )r   r   )r   r   
columnspanr   r   single)widthheight
selectmodeendz<ButtonRelease-1>ns)r   r   rowspanr   vertical)orientr   )yscrollcommandz
Clear Keys)r   r   )r   r   r   keyseq_advancedzEnter new binding(s) for 'z' :
z2(These bindings will not be checked for validity!))r   )r   )r   r   r   << Basic Key Binding Entry)r   r   ew)r   r   stickr   r   NzSelect the desired modifier keys
above, and the final key from the
list on the right.

Use upper case Symbols when using
the Shift modifier.  (Letters will be
converted automatically.)a  Key bindings are specified using Tkinter keysyms as
in these samples: <Control-f>, <Shift-F2>, <F12>,
<Control-space>, <Meta-less>, <Control-Alt-Shift-X>.
Upper case is used when the Shift modifier is present!

'Emacs style' multi-keystroke bindings are specified as
follows: <Control-x><Control-y>, where the first key
is the 'do-nothing' keybinding.

Multiple separate bindings for one action should be
separated by a space, eg., <Alt-v> <Meta-v>.)#r   frame_keyseq_basicgridr
   ri   packrl   frame_controls_basicmodifier_checkbuttonsziprZ   ro   modifier_labelrU   r   build_key_stringr   list_keys_finalinsertAVAILABLE_KEYSbindfinal_key_selectedr   yviewconfigrm   r   clear_key_seqbutton_clearframe_keyseq_advancedr	   advanced_keysframe_help_advancedtoggle_levelbutton_level)rs   basic_title
basic_keysr   rt   ru   labelcheck
help_basicscroll_keys_finaladvanced_titlehelp_advanceds   &           r\   rr   GetKeysFrame.create_widgetsP   s   "'>"B$$1V+,1 	% 	6D33#1$++c!BD$422F(,'(*
 	aqs3 %*$K!!!&&1QvA&N &(""%dnnd6H6H"IH''++H?E 9 9(,(=(=E)1bRE JJ1V!CJ@38&&x0aKF #J 444f!<=
 	AaAAcJ  't'@'@.0X G##E;N;!!"5t7N7NO!!a1T!J%d&?&?-7.2.B.B.H.HJ 	##3D3H3H#I1Q$G"4#<#<(4+/+=+=? 	1Q1= &+46G%H"""''Aa./a 	( 	9t996&@U$S%Y%Z[ 	3'"4#=#=04AS) $);   %%!Af1%Md66@	B 	q6: #41B1B'CE1QdKr^   c                h    \         P                  R8X  d   . ROV n        M	. ROV n        RR/V n        R# )a.  Determine list of names of key modifiers for this platform.

The names are used to build Tk bindings -- it doesn't matter if the
keyboard has these keys; it matters if Tk understands them.  The
order is also important: key binding equality depends on it, so
config-keys.def must use the same ordering.
darwinControlCtrlN)rT   r   OptionCommand)r   AltrT   )sysplatformrZ   r   rs   s   &r\   rn   'GetKeysFrame.set_modifiers_for_platform   s+     <<8#FDN8DN(&1r^   c                :   V P                   P                  R4      P                  R4      '       d   V P                  4        V P                   P	                  RR7       V P
                  P                  4        V P                  P                  4        V P                  P                  4        RV n
        R# V P                  4        V P                   P	                  RR7       V P                  P                  4        V P                  P                  4        RV n
        R# )	z'Toggle between basic and advanced keys.r   Advancedr   r   TzAdvanced Key Binding Entry >>FN)r   cget
startswithr   r   r   liftr   r   	focus_setrq   r   r   r   s   &r\   r   GetKeysFrame.toggle_level   s    ""6*55jAA $$*F$G&&++-$$))+((* DM $$*I$J##((*%%**,!DMr^   c                &    V P                  4        R# )z3Handler for clicking on key in basic settings list.N)r   rs   events   &&r\   r   GetKeysFrame.final_key_selected   s    r^   c                   V P                  4       ;rV P                  P                  R4      pV'       d   \        W24      pVP	                  V4       V P
                  P                  RRP                  V4       R24       R# )z2Create formatted string of modifiers plus the key.r   r?   r'   rA   N)get_modifiersr   rU   r]   rp   rl   rm   join)rs   keylistrZ   	final_keys   &   r\   r   GetKeysFrame.build_key_string   sg    "0022((,,X6	%i;INN9%a 12!45r^   c                    V P                    Uu. uF  qP                  4       NK  	  ppV Uu. uF  q3'       g   K  VNK  	  up# u upi u upi )z9Return ordered list of modifiers that have been selected.)ro   rU   )rs   ru   mod_listmods   &   r\   r   GetKeysFrame.get_modifiers   sD    373E3EF3ExLLN3EF'/x3x// G/s   A	A	A	c                    V P                   P                  ^ R4       V P                   P                  RR4       V P                   F  pVP	                  R4       K  	  V P
                  P	                  R4       R# )z#Clear modifiers and keys selection.r   movetoz0.0re   N)r   select_clearr   ro   rm   rl   )rs   ru   s   & r\   r   GetKeysFrame.clear_key_seq   s\    ))!U3""8U3**HLL +Br^   c                @   R V n         V P                  P                  4       P                  4       pV'       g!   V P	                  V P
                  V RR7       R# V P                  '       g   V P                  V4      '       d   V P                  V4      '       d   Wn         R# )re   zNo key specified.titlerh   messageN)	rk   rl   rU   striprz   keyerror_titlerq   keys_okbind_ok)rs   keyss   & r\   okGetKeysFrame.ok   su    ""$**,NN!4!4T#6  8MMMT\\$//T\\$5G5GKr^   c                <   V P                   P                  R4      pV P                  4       pV P                  pV P                   UUu. uF  pV F  pVNK  	  K  	  pppVP                  R4      '       g   V P                  W@RR7       R# V'       g,   V\        \        ,           9  d   V P                  W@RR7       R# VR.8X  d5   V\        \        ,           R,           9  d   RpV P                  W@VR7       R# W9   d   R	pV P                  W@VR7       R# R
# u uppi )zValidity check on user's 'basic' keybinding selection.

Doesn't check the string produced by the advanced dialog because
'modifiers' isn't set.
r   rA   zMissing the final Key)rh   r   zNo modifier key(s) specified.r   rT   zBThe shift modifier by itself may not be used with this key symbol.z'This key combination is already in use.TF)rS   r   )	r   rU   r   r   rj   endswithrz   FUNCTION_KEYS	MOVE_KEYS)	rs   r   r   rZ   r   r   rY   key_sequencesmsgs	   &&       r\   r   GetKeysFrame.keys_ok   s&    ((,,X6	&&(	##,0,F,F 1,F(/ (/ ,F 1}}S!!NN5#:  <"  =9#<<NN#B  D  G9$#i/2BBC&CNNSNA  ";CNNSNA  '1s   Dc                     V P                  VR 4      pV P                  W4       R#   \         d-   pT P                  T P                  T RT 2R7        Rp?R# Rp?ii ; i)z:Return True if Tcl accepts the new keys else show message.c                      R # ry    r   r^   r\   <lambda>&GetKeysFrame.bind_ok.<locals>.<lambda>  s    dr^   Tz2The entered key sequence is not accepted.

Error: r   NF)r   unbindr   rz   r   )rs   r   bindingerrs   &&  r\   r   GetKeysFrame.bind_ok  sj    
	iil3G KK&  	NN--d ''*e-  / 	s   ( A!AA)ri   rq   r   r   r   rj   r   r   r   r   rl   r   r   r   ro   rZ   rh   rk   ry   )__name__
__module____qualname____firstlineno__r   rg   rz   rr   rn   r   r   r   r   r   r   r   r   __static_attributes____classdictcell____classcell__rv   __classdict__s   @@r\   r`   r`   ,   sO      *N6.Wr2"  60
 	> r^   r`   c                      a a ] tR tRt oRRRR/V 3R llt]R 4       t]P                  R 4       tRR ltRR	 lt	R
t
VtV ;t# )GetKeysWindowi  _htestF_utestc               |  < \         SV `  V4       V P                  4        ^V R&   V P                  RRR7       V P	                  4        VP                  4       VP                  4       ^,          V P                  4       ^,          ,
          ,           pVP                  4       V'       g4   VP                  4       ^,          V P                  4       ^,          ,
          M^,           pV P                  RV RV 24       V P                  V4       \        WV4      ;V n        p	V P                  RV P                   4       \#        V 4      p
\%        V
R^V P&                  R7      V n        \%        V
R^V P                   R7      V n        V P(                  P-                  ^ ^ ^^R	7       V P*                  P-                  ^ ^^^R	7       V	P/                  R
RRR7       V
P/                  RRR7       V P1                  V4       \3        V 4       V P5                  4        V'       g#   V P7                  4        V P9                  4        R# R# )a  
parent - parent of this dialog
title - string which is the title of the popup dialog
action - string, the name of the virtual event these keys will be
         mapped to
current_key_sequences - list, a list of all key sequence lists
         currently mapped to virtual events, for overlap checking
_htest - bool, change box location when running htest
_utest - bool, do not wait when running unittest
rb   F)r   r   r)   WM_DELETE_WINDOWOK)r   r   r   Cancel)r   r   r   r   topTboth)sideexpandr   bottomr   )r  r   N)rf   rg   withdraw	resizableupdate_idletaskswinfo_rootxwinfo_widthwinfo_reqwidthwinfo_rootywinfo_heightwinfo_reqheightgeometryr   r`   frameprotocolcancelr   r   r   	button_okbutton_cancelr   r   	transientr   grab_set	deiconifywait_window)rs   rh   r   ri   rj   r  r  r   yr#  frame_buttonsrv   s   &&&&&$$    r\   rg   GetKeysWindow.__init__  s    	 ]e51!  "A%(;(;(=q(@@B! ""$a'$*>*>*@!*CC!$& 	!AaSk"

5)$8MNN
U($++6dD&':#M)*DKKA!!!<Aaaa@

d
8s3vdNN r^   c                .    V P                   P                  # ry   r#  rk   r   s   &r\   rk   GetKeysWindow.resultJ  s    zz   r^   c                &    WP                   n        R # ry   r0  )rs   values   &&r\   rk   r1  N  s    !

r^   c                z    V P                   P                  4        V P                  4        V P                  4        R # ry   )r#  r   grab_releasedestroyr   s   &&r\   r   GetKeysWindow.okR  s$    

r^   c                T    R V n         V P                  4        V P                  4        R# )re   N)rk   r5  r6  r   s   &&r\   r%  GetKeysWindow.cancelW  s    r^   )r'  r&  r#  rk   ry   )r  r  r  r  rg   propertyrk   setterr   r%  r  r  r	  r
  s   @@r\   r  r    sV     , ,).,\ ! ! ]]" "
 r^   r  __main__)mainz!idlelib.idle_test.test_config_keyF)	verbosityexit)run)F1F2F3F4F5F6F7F8F9F10F11F12)rS   r   Return)	BackSpaceDeleteInsert)HomeEndrG   rI   rK   rM   rO   rQ   )$__doc__tkinterr   r   r   r   tkinter.ttkr   r   r   r	   r
   r   r   tkinter.simpledialogr   rV   r   r   tuplerW   digitsALPHANUM_KEYSPUNCTUATION_KEYSWHITESPACE_KEYS	EDIT_KEYSr   r   r]   r`   r  r  unittestr=  idlelib.idle_test.htestr@  r   r^   r\   <module>r_     s    ; : K K  .  
8f,,v}}<=67 ,-	6	"22]B!"$-.09:(k5 k\@H @F z	,F+ r^   