def key_text_to_keyinfo(keytext):
 if keytext.startswith('"'):
  return keyseq_to_keyinfo(keytext[1:(-1)])
 else:
  return keyname_to_keyinfo(keytext)

def key_text_to_keyinfo ( keytext ) : if keytext . startswith ( '"' ) : return keyseq_to_keyinfo ( keytext [ 1 : ( - 1 ) ] ) else : return keyname_to_keyinfo ( keytext )
convert a gnu readline style textual description of a key to keycode with modifiers .