def translate_key_to_config(p_key):
    """
    Translates urwid key event to form understandable by topydo config parser.
    """
    if len(p_key) > 1:
        key = p_key.capitalize()
        if key.startswith('Ctrl') or key.startswith('Meta'):
            key = key[0] + '-' + key[5:]
        key = '<' + key + '>'
    else:
        key = p_key

    return key
Translates urwid key event to form understandable by topydo config parser.