parameters: (key, modifiers)
return_statement: return f'Key-{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 translate_key(key, modifiers):
      "Translate from keycap symbol to the Tkinter keysym."
      mapping = {'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'}
      key = mapping.get(key, key)
      if 'Shift' in modifiers and key in string.ascii_lowercase:
          key = key.upper()
      return f'Key-{key}'
function_tokens: def translate_key ( key , modifiers ) : mapping = { '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' } key = mapping . get ( key , key ) if 'Shift' in modifiers and key in string . ascii_lowercase : key = key . upper ( ) return f'Key-{key}'