File: //proc/self/root/opt/python38/lib/python3.8/idlelib/__pycache__/config_key.cpython-38.opt-1.pyc
U
�i�_�8 � @ s� d Z ddlmZmZmZmZ ddlmZmZm Z m
Z
mZmZ ddlm
Z
ddlZddlZdZeejej �Zed�ZdZd Zd
Zee e e e e Zdd� ZG d
d� de�Zedkr�ddlmZ edddd� ddlm Z e e� dS )z6
Dialog for building Tkinter accelerator key bindings
� )�Toplevel�Listbox� StringVar�TclError)�Frame�Button�Checkbutton�Entry�Label� Scrollbar)�
messageboxN)ZF1ZF2ZF3ZF4ZF5ZF6ZF7ZF8ZF9ZF10ZF11ZF12z~!@#%^&*()_-+={}[]|;:,.<>/?)�Tab�SpaceZReturn)Z BackSpaceZDeleteZInsert)ZHomeZEnd�Page Up� Page Down�
Left Arrow�Right Arrow�Up Arrow�
Down Arrowc $ C s| ddddddddd d
ddd
ddddddddddddddddddd d!d"d#d$�#}|� | | �} d%|krr| tjkrr| �� } d&| � �S )'z3Translate from keycap symbol to the Tkinter keysym.ZspaceZ
asciitildeZexclamZatZ
numbersign�percentZasciicircumZ ampersandZasteriskZ parenleftZ
parenrightZ
underscoreZminusZplusZequalZ braceleftZ
bracerightZbracketleftZbracketrightZbarZ semicolonZcolonZcommaZperiodZlessZgreaterZslashZquestionZPriorZNextZLeftZRightZUpZDownr
)#r �~�!�@�#�%�^�&�*�(�)�_�-�+�=�{�}�[�]�|�;�:�,�.�<�>�/�?r r r r r r r
�ShiftzKey-)�get�string�ascii_lowercase�upper)�key� modifiers�mapping� r9 �1/opt/python38/lib/python3.8/idlelib/config_key.py�
translate_key sP �r; c @ s� e Zd ZdZddd�dd�Zdd� Zdd � Zd
d� Zdd
� Zddd�Z dd� Z
dd� Zdd� Zd dd�Z
d!dd�Zdd� Zdd� ZdS )"�
GetKeysDialogzKey Sequence ErrorF)�_htest�_utestc C sB t �| |� | �� | jdd� | jddd� | �|� | �|� | �� | �d| j � || _
|| _|| _d| _
t| �| _| j�d� | �� g | _| jD ]"}t| �}|�d� | j�|� q�d| _| �� | �� | �d|�� |�� d | �� d |�� |�s|�� d | �� d nd f � |�s>| �� | � � d
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�widthZWM_DELETE_WINDOW� z+%d+%d� � N)!r �__init__ZwithdrawZ configureZ resizable�titleZ transientZgrab_set�protocol�cancel�parent�action�current_key_sequences�resultr �
key_string�set�set_modifiers_for_platform�
modifier_varsr7 �append�advanced�create_widgetsZupdate_idletasksZgeometryZwinfo_rootxZwinfo_widthZwinfo_reqwidthZwinfo_rootyZwinfo_heightZwinfo_reqheightZ deiconifyZwait_window) �selfrJ rG rK rL r= r>