parameters: (self, key, modifiers)
return_statement: return key
docstring: Translate from keycap symbol to the Tkinter keysym
docstring_summary: Translate from keycap symbol to the Tkinter keysym
docstring_tokens: Translate from keycap symbol to the Tkinter keysym
function: def TranslateKey(self, key, modifiers):
          "Translate from keycap symbol to the Tkinter keysym"
          translateDict = {'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':'Tab'}
          if key in translateDict.keys():
              key = translateDict[key]
          if 'Shift' in modifiers and key in string.ascii_lowercase:
              key = key.upper()
          key = 'Key-' + key
          return key
function_tokens: def TranslateKey ( self , key , modifiers ) : translateDict = { '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' : 'Tab' } if key in translateDict . keys ( ) : key = translateDict [ key ] if 'Shift' in modifiers and key in string . ascii_lowercase : key = key . upper ( ) key = 'Key-' + key return key