parameters: (self, keys)
docstring: Update the controls that show the key binding of the current
          menu item.
          @param keys: tuple of keys
docstring_summary: Update the controls that show the key binding of the current
          menu item.
          @param keys: tuple of keys
docstring_tokens: Update the controls that show the key binding of the current menu item . @param keys : tuple of keys
function: def _UpdateKeyDisplay(self, keys):
          """Update the controls that show the key binding of the current
          menu item.
          @param keys: tuple of keys
  
          """
          mod1 = self.FindWindowById(ID_MOD1) # Choice
          mod1.SetItems(MODIFIERS)
          mod2 = self.FindWindowById(ID_MOD2) # Choice
          mod2.Enable()
          key = self.FindWindowById(ID_KEYS) # Choice
  
          if keys is None:
              keys = ('')
  
          # Change the main meta key for display reasons to keep it from
          # being confused with the actual ctrl key since wx translates ctrl
          # to apple key (cmd) automatically.
          if wx.Platform == '__WXMAC__' and len(keys) and 'Ctrl' in keys:
              nkeys = list()
              for keystr in keys:
                  if keystr == 'Ctrl':
                      nkeys.append('Cmd')
                  else:
                      nkeys.append(keystr)
              keys = nkeys
  
          if len(keys) >= 3:
              mod1.SetStringSelection(keys[0])
              tmods = list(MODIFIERS)
              tmods.remove(keys[0])
              mod2.SetItems(tmods)
              mod2.SetStringSelection(keys[1])
              key.SetStringSelection(keys[2])
          elif len(keys) == 2:
              mod1.SetStringSelection(keys[0])
              tmods = list(MODIFIERS)
              tmods.remove(keys[0])
              mod2.SetItems(tmods)
              mod2.SetStringSelection('')
              key.SetStringSelection(keys[1])
          elif len(keys) == 1 and keys[0] in KEYS:
              self.ClearKeyView()
              key.SetStringSelection(keys[0])
          else:
              self.ClearKeyView()
  
          self._UpdateBinding()
function_tokens: def _UpdateKeyDisplay ( self , keys ) : mod1 = self . FindWindowById ( ID_MOD1 ) # Choice mod1 . SetItems ( MODIFIERS ) mod2 = self . FindWindowById ( ID_MOD2 ) # Choice mod2 . Enable ( ) key = self . FindWindowById ( ID_KEYS ) # Choice if keys is None : keys = ( '' ) # Change the main meta key for display reasons to keep it from # being confused with the actual ctrl key since wx translates ctrl # to apple key (cmd) automatically. if wx . Platform == '__WXMAC__' and len ( keys ) and 'Ctrl' in keys : nkeys = list ( ) for keystr in keys : if keystr == 'Ctrl' : nkeys . append ( 'Cmd' ) else : nkeys . append ( keystr ) keys = nkeys if len ( keys ) >= 3 : mod1 . SetStringSelection ( keys [ 0 ] ) tmods = list ( MODIFIERS ) tmods . remove ( keys [ 0 ] ) mod2 . SetItems ( tmods ) mod2 . SetStringSelection ( keys [ 1 ] ) key . SetStringSelection ( keys [ 2 ] ) elif len ( keys ) == 2 : mod1 . SetStringSelection ( keys [ 0 ] ) tmods = list ( MODIFIERS ) tmods . remove ( keys [ 0 ] ) mod2 . SetItems ( tmods ) mod2 . SetStringSelection ( '' ) key . SetStringSelection ( keys [ 1 ] ) elif len ( keys ) == 1 and keys [ 0 ] in KEYS : self . ClearKeyView ( ) key . SetStringSelection ( keys [ 0 ] ) else : self . ClearKeyView ( ) self . _UpdateBinding ( )