HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/Python311/Lib/idlelib/__pycache__/config_key.cpython-311.pyc
�

��Vc:��^�dZddlmZmZmZmZddlmZmZm	Z	m
Z
mZmZddlm
Z
ddlmZddlZddlZdZeejejz��Zed��Zd	Zd
ZdZeezezezezezZd�ZGd
�de��Zedkr'ddlm Z e ddd���ddl!m"Z"e"e��dSdS)z6
Dialog for building Tkinter accelerator key bindings
�)�Toplevel�Listbox�	StringVar�TclError)�Frame�Button�Checkbutton�Entry�Label�	Scrollbar)�
messagebox)�
_setup_dialogN)�F1�F2�F3�F4�F5�F6�F7�F8�F9�F10�F11�F12z~!@#%^&*()_-+={}[]|;:,.<>/?)�Tab�Space�Return)�	BackSpace�Delete�Insert)�Home�End�Page Up�	Page Down�
Left Arrow�Right Arrow�Up Arrow�
Down Arrowc�`�idd�dd�dd�dd�d	d
�dd�d
d�dd�dd�dd�dd�dd�dd�dd�dd�dd �d!d"�id#d$�d%d&�d'd(�d)d*�d+d,�d-d.�d/d0�d1d2�d3d4�d5d6�d7d8�d9d:�d;d<�d=d>�d?d@�dAdB�dCdD��dEdEi�}|�||��}dF|vr"|tjvr|���}dG|��S)Hz3Translate from keycap symbol to the Tkinter keysym.r�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�?�questionr#�Priorr$�Nextr%�Leftr&�Rightr'�Upr(�Downr�ShiftzKey-)�get�string�ascii_lowercase�upper)�key�	modifiers�mappings   �&D:\Python311\Lib\idlelib\config_key.py�
translate_keyrps��@�w�w�@���@�!�(�@�,/��@�69�,�@��	�@��}�@�.1�+�@�
�
�@� ��@�.1��@�
��	@�"�'�	@�,/�v�	@�8;�7�	@�

��@�
!��@�@�
�
�
@� #�>�
@�47�u�
@�
��@�!��@�+.�g�@�8;�8�@�
��@��I�@�(+�7�@�58�
�@�
�g�@� +�6�@�
��@�"/�w�@�
�t�@�*�6�@�@�49��@�@�G��+�+�c�3�
�
�C��)����v�'=� =���i�i�k�k���#�<�<��c�n�eZdZdZddd�d�Zd�Zd�Zd�Zd�Zdd
�Z	d�Z
d�Zd
�Zdd�Z
dd�Zd�Zd�Zd	S)�
GetKeysDialogzKey Sequence ErrorF)�_htest�_utestc���tj||��|���|�d���|�dd���|�|��|�|��t|��|���|�	d|j
��||_||_||_
d|_t|��|_|j�d��|���g|_|jD]@}t|��}|�d��|j�|���Ad|_|���|���|�d|���|���dz|���dzz
z|���|s/|���dz|���dzz
nd	zfz��|s*|� ��|�!��d
Sd
S)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
        �)�borderwidthF)�height�width�WM_DELETE_WINDOW�z+%d+%d��N)"r�__init__�withdraw�	configure�	resizable�title�	transientr�grab_set�protocol�cancel�parent�action�current_key_sequences�resultr�
key_string�set�set_modifiers_for_platform�
modifier_varsrm�append�advanced�create_widgets�update_idletasks�geometry�winfo_rootx�winfo_width�winfo_reqwidth�winfo_rooty�winfo_height�winfo_reqheight�	deiconify�wait_window)	�selfr�r�r�r�rtru�modifier�variables	         rorzGetKeysDialog.__init__1sZ��	��$��'�'�'��
�
�������1��%�%�%����e�5��1�1�1��
�
�5�������v�����d�����
�
�����
�
�(�$�+�6�6�6�������%:��"����#�D�/�/�������B�����'�'�)�)�)������	0�	0�H� ����H��L�L�������%�%�h�/�/�/�/���
��������������
�
���&�&�(�(��'�'�)�)�!�+�d�.A�.A�.C�.C�A�.E�E�G��&�&�(�(�!�+�f�)�)�+�+�A�-��0D�0D�0F�0F�q�0H�H�H�'*�,���	�	�	��	��N�N������������	�	rqc�(�tj|i|��dS�N)r
�	showerror)r��args�kwargss   ror�zGetKeysDialog.showerrorbs����d�-�f�-�-�-�-�-rqc	�	�t|dd���x|_}|�ddd���t|��}|�dd	�
��t|dd|j�
��|_|j�dddd���t|dd|j�
��|_|j�dddd���t|d���|_	|j	�ddddd���t|j	d|j�d����}|�d���t|j	d|jdd���}|�ddd	���t|��|_
|j
�dddd� ��i|_d}t|j|j��D]g\}}|j�||��}t)|j
|j|||d!�"��}	|	�d|dd�#��|	|j|<|dz
}�ht|j
dd$�%��}
|
�ddd&dd�'��t-|j
d(d)d*�+��|_|jjd,gt2�R�|j�d-|j��|j�dd&d&d.�/��t9|j
d0|jj�1��}|j�|j�2��|�ddd&d.�/��t|j
d3|j �4��|_!|j!�ddd&�5��t|d6���|_"|j"�ddddd���t|j"dd7|j�d8�d9z�%��}|�d���tG|j"|j�:��|_$|j$�d	�;��t|��|_%|j%�dddd� ��t|j%dd<�%��}
|
�ddd�=��t||j&d>�?��|_'|j'�ddd@dd�A��|�&��dS)BNr}�sunken)rx�relief�topT�both)�side�expand�fill�bottom�x)r�r��OK�)�textrz�commandrrw)�row�column�padx�pady�Cancel��keyseq_basic)�name�nsew)r�r��stickyr�r�zNew keys for 'z' :�r��w)�anchor�left�groove)�justify�textvariabler�rx)�ipadx�ipadyr�)r�r�r�r�r|)r�r�r��onvalue�offvalue)r�r�r�r�z�Select 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.))r�r��)r�r��
columnspanr�r���
�single)rzry�
selectmode�endz<ButtonRelease-1>�ns)r�r��rowspanr��vertical)�orientr�)�yscrollcommandz
Clear Keys)r�r�)r�r�r��keyseq_advancedzEnter new binding(s) for 'z' :
z2(These bindings will not be checked for validity!))r�)r�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�r�r��<< Basic Key Binding Entry)r�r��ew)r�r��stickr�r�)(r�frame�packr�ok�	button_ok�gridr��
button_cancel�frame_keyseq_basicrr�r��frame_controls_basic�modifier_checkbuttons�ziprmr��modifier_labelrhr	�build_key_stringr�list_keys_final�insert�AVAILABLE_KEYS�bind�final_key_selectedr�yview�configr��
clear_key_seq�button_clear�frame_keyseq_advancedr
�
advanced_keys�frame_help_advanced�toggle_level�button_level)r�r��
frame_buttons�basic_title�
basic_keysr�r�r��label�check�
help_basic�scroll_keys_final�advanced_title�
help_advanceds              ror�zGetKeysDialog.create_widgetsfs���"�4�Q�x�H�H�H�H��
�U�
�
�
��d��
�8�8�8��d���
�����s��3�3�3��
�D�&'���:�:�:��������!�!�!��<�<�<�#�M��)*�D�K�A�A�A�������A�a�a�a��@�@�@�#(��N�"C�"C�"C�����$�$��1�V�+,�1�	%�	6�	6�	6��D�3�!B�$�+�!B�!B�!B�D�D�D�������$�$�$��4�2�F�(,���'(�*�*�*�
�	���a�q�s��3�3�3�%*�%�L�L��!��!�&�&�1�Q�v�A�&�N�N�N�&(��"���"%�d�n�d�6H�"I�"I�	�	��H�h��'�+�+�H�h�?�?�E��� 9�(,�(=�E�)1�8�b�R�R�R�E�
�J�J�1�V�!�C�J�@�@�@�38�D�&�x�0��a�K�F�F��4�4�f�!<�=�=�=�
�	���A�a�A�A�c��J�J�J� '�t�'@��.0�X� G� G� G���#���#�E�;�N�;�;�;�;���!�!�"5�t�7N�O�O�O���!�!�a��1�T�!�J�J�J�%�d�&?�-7�.2�.B�.H�J�J�J��	
��#�#�3D�3H�#�I�I�I����1�Q��$��G�G�G�"�4�#<�(4�+/�+=�?�?�?���	
����1�Q�1��=�=�=�&+�5�7H�%I�%I�%I��"��"�'�'�A�a��./�a�	(�	9�	9�	9��t�9�6�$S���$S�$S�$S�%Y�%Z�[�[�[��	���3��'�'�'�"�4�#=�04��A�A�A�������S��)�)�)�$)��<�<�� �� �%�%�!�A�f�1�%�M�M�M��d�6��@�	B�	B�	B�
�	���q��6��:�:�:�#�5�$�2C�'C�E�E�E�������1�Q�d����K�K�K��������rqc�^�tjdkr
gd�|_n	gd�|_ddi|_dS)aVDetermine 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)rg�Control�Option�Command)r��Altrgr��CtrlN)�sys�platformrmr��r�s ror�z(GetKeysDialog.set_modifiers_for_platform�sB���<�8�#�	9�F�F�F�D�N�N�8�8�8�D�N�(�&�1����rqc�6�|j�d���d��r�|���|j�d���|j���|j���|j�	��d|_
dS|���|j�d���|j���|j���d|_
dS)	z'Toggle between basic and advanced keys.r��Advancedr�r�TzAdvanced Key Binding Entry >>FN)
r��cget�
startswithr�r�r��liftr�r��	focus_setr�r�r�rs ror�zGetKeysDialog.toggle_level�s����"�"�6�*�*�5�5�j�A�A�	"���� � � ���$�$�*F�$�G�G�G��&�+�+�-�-�-��$�)�)�+�+�+���(�(�*�*�*� �D�M�M�M���� � � ���$�$�*I�$�J�J�J��#�(�(�*�*�*��%�*�*�,�,�,�!�D�M�M�MrqNc�.�|���dS)z3Handler for clicking on key in basic settings list.N)r��r��events  ror�z GetKeysDialog.final_key_selected�s���������rqc��|���x}}|j�d��}|r%t||��}|�|��|j�dd�|���d���dS)z2Create formatted string of modifiers plus the key.r�rYrAr[N)�
get_modifiersr�rhrpr�r�r��join)r��keylistrm�	final_keys    ror�zGetKeysDialog.build_key_string�s���"�0�0�2�2�2��)��(�,�,�X�6�6�	��	&�%�i��;�;�I��N�N�9�%�%�%�����4����� 1� 1�4�4�4�5�5�5�5�5rqc�<�d�|jD��}d�|D��S)z9Return ordered list of modifiers that have been selected.c�6�g|]}|�����S�)rh)�.0r�s  ro�
<listcomp>z/GetKeysDialog.get_modifiers.<locals>.<listcomp>�s ��F�F�F�x�H�L�L�N�N�F�F�Frqc��g|]}|�|��Srr)r�mods  rorz/GetKeysDialog.get_modifiers.<locals>.<listcomp>�s��/�/�/��3�/��/�/�/rq)r�)r��mod_lists  rorzGetKeysDialog.get_modifiers�s,��F�F�4�3E�F�F�F��/�/�x�/�/�/�/rqc���|j�dd��|j�dd��|jD]}|�d���|j�d��dS)z#Clear modifiers and keys selection.rr��movetoz0.0r|N)r��select_clearr�r�r�r�)r�r�s  ror�zGetKeysDialog.clear_key_seq�sw����)�)�!�U�3�3�3���"�"�8�U�3�3�3��*�	�	�H��L�L����������B�����rqc�^�|j������}|s|�|j|d���dS|js|�|��r|�|��r||_|�	��|�
��dS)NzNo key specified.�r�r��message)r�rh�stripr��keyerror_titler��keys_ok�bind_okr��grab_release�destroy)r�r
�keyss   ror�zGetKeysDialog.oks�����"�"�$�$�*�*�,�,���	��N�N��!4�T�#6�
�
8�
8�
8��F��M�	�T�\�\�$�/�/�	�T�\�\�$�5G�5G�	��D�K��������������rqc�d�d|_|���|���dS)Nr|)r�r%r&rs  ror�zGetKeysDialog.cancels,������������������rqc���|j�d��}|���}|j}d�|jD��}|�d��s|�||d���n�|s*|ttzvr|�||d���nW|dgkr/|ttzd	zvrd
}|�|||���n!||vrd}|�|||���ndSd
S)z�Validity check on user's 'basic' keybinding selection.

        Doesn't check the string produced by the advanced dialog because
        'modifiers' isn't set.
        r�c��g|]	}|D]}|���
Srr)rrrls   rorz)GetKeysDialog.keys_ok.<locals>.<listcomp>s<��1�1�1��(/�1�1�!$��1�1�1�1rqr[zMissing the final Key)r�r zNo modifier key(s) specified.rrg)rrzBThe shift modifier by itself may not be used with this key symbol.z'This key combination is already in use.TF)	r�rhrr"r��endswithr��
FUNCTION_KEYS�	MOVE_KEYS)r�r'rrmr��
key_sequences�msgs       ror#zGetKeysDialog.keys_oksW���(�,�,�X�6�6�	��&�&�(�(�	��#��1�1�D�,F�1�1�1�
��}�}�S�!�!�	��N�N�5��#:�
�
<�
<�
<�
<��	��=�9�#<�<�	��N�N��t�#B�
�
D�
D�
D�
D��G�9�$�
	��#�i�/�2B�B�C�
	�&�C��N�N��t�S�N�A�A�A�A�
�]�
"�	�;�C��N�N��t�S�N�A�A�A�A��4��urqc���	|�|d���}|�||��dS#t$r+}|�|j|d|�����Yd}~dSd}~wwxYw)z:Return True if Tcl accepts the new keys else show message.c��dSr�rrrqro�<lambda>z'GetKeysDialog.bind_ok.<locals>.<lambda>6s��d�rqTz2The entered key sequence is not accepted.

Error: rNF)r��unbindrr�r")r�r'�binding�errs    ror$zGetKeysDialog.bind_ok3s���
	��i�i��l�l�3�3�G�
�K�K��g�&�&�&��4���	�	�	��N�N��-�d�-�'*�-�-�
�
/�
/�
/��5�5�5�5�5�����	���s�1�
A&� A!�!A&r�)�__name__�
__module__�__qualname__r"rr�r�r�r�r�r�rr�r�r�r#r$rrqrorsrs,s������*�N�!��/�/�/�/�/�b.�.�.�d�d�d�L2�2�2�"�"�"�  � � � �6�6�6�0�0�0�
 � � �	�	�	�	�����
���>����rqrs�__main__)�mainz!idlelib.idle_test.test_config_keyr}F)�	verbosity�exit)�run)#�__doc__�tkinterrrrr�tkinter.ttkrrr	r
rrr
�tkinter.simpledialogrrirr,�tuplerj�digits�
ALPHANUM_KEYS�PUNCTUATION_KEYS�WHITESPACE_KEYS�	EDIT_KEYSr-r�rprsr6�unittestr:�idlelib.idle_test.htestr=rrqro�<module>rJs�����;�:�:�:�:�:�:�:�:�:�:�:�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�������.�.�.�.�.�.�
�
�
�
�
�
�
�
�8�
���f�,�v�}�<�=�=�
��5�6�7�7��,��-�	�
6�	��"2�2�]�B�!�"�$-�.�09�:�����(S�S�S�S�S�H�S�S�S�l�z����������D�	,���F�F�F�F�+�+�+�+�+�+��C�
�������rq