def get_trans_func():
    """
    Returns the next status (modifier) based on the current status, 
    the event on the new modifier (pressed or released) and the new modifier typed.
         next_status = f(event, modifier, curr_status)
    event can be {'press', release}; modifier is one of the possible modifier in mod_keys 
    list and curr_status is the current modifier.
    """
    trans = {'press':{}, 'release':{}}
    for mk in mod_keys+ext_mod_keys:
        trans['press'][mk] = {}
        trans['release'][mk] = {}
        
    for mk1 in mod_keys+ext_mod_keys:
        for mk2 in mod_keys+ext_mod_keys:
            trans['press'][mk1][mk2] = 'NORMAL'
            trans['release'][mk1][mk2] = 'NORMAL'
    
    trans['press']['SHIFT_L']['NORMAL'] = 'SHIFT_L'
    trans['press']['SHIFT_R']['NORMAL'] = 'SHIFT_R'
    trans['press']['ISO_LEVEL3_SHIFT']['NORMAL'] = 'ISO_LEVEL3_SHIFT'
    trans['press']['SHIFT_R_ALT_R']['NORMAL'] = 'SHIFT_R_ALT_R'
    trans['press']['SHIFT_L_ALT_R']['NORMAL'] = 'SHIFT_L_ALT_R'
    trans['press']['CONTROL_L']['NORMAL'] = 'CONTROL_L'
    trans['press']['CONTROL_R']['NORMAL'] = 'CONTROL_R'
    trans['press']['ISO_LEVEL3_SHIFT']['NORMAL'] = 'ISO_LEVEL3_SHIFT'
    trans['press']['ALT_L']['NORMAL'] = 'ALT_L'
    trans['press']['SUPER_L']['NORMAL'] = 'SUPER_L'
    
    trans['release']['SHIFT_L']['SHIFT_L'] = 'NORMAL'
    trans['release']['SHIFT_R']['SHIFT_R'] = 'NORMAL'
    trans['release']['ISO_LEVEL3_SHIFT']['ISO_LEVEL3_SHIFT'] = 'NORMAL'
    trans['release']['SHIFT_R_ALT_R']['SHIFT_R_ALT_R'] = 'NORMAL'
    trans['release']['SHIFT_L_ALT_R']['SHIFT_L_ALT_R'] = 'NORMAL'
    trans['release']['CONTROL_L']['CONTROL_L'] = 'NORMAL'
    trans['release']['CONTROL_R']['CONTROL_R'] = 'NORMAL'
    trans['release']['ISO_LEVEL3_SHIFT']['ISO_LEVEL3_SHIFT'] = 'NORMAL'
    trans['release']['ALT_L']['ALT_L'] = 'NORMAL'
    trans['release']['SUPER_L']['SUPER_L'] = 'NORMAL'    
    

    trans['press']['SHIFT_L']['ISO_LEVEL3_SHIFT'] = 'SHIFT_L_ALT_R'
    trans['press']['ISO_LEVEL3_SHIFT']['SHIFT_L'] = 'SHIFT_L_ALT_R'
    trans['press']['SHIFT_R']['ISO_LEVEL3_SHIFT'] = 'SHIFT_R_ALT_R'
    trans['press']['ISO_LEVEL3_SHIFT']['SHIFT_R'] = 'SHIFT_R_ALT_R'
    
    trans['release']['ISO_LEVEL3_SHIFT']['SHIFT_L_ALT_R'] = 'SHIFT_L'
    trans['release']['SHIFT_L']['SHIFT_L_ALT_R'] = 'ISO_LEVEL3_SHIFT'
    trans['release']['ISO_LEVEL3_SHIFT']['SHIFT_R_ALT_R'] = 'SHIFT_R'
    trans['release']['SHIFT_R']['SHIFT_R_ALT_R'] = 'ISO_LEVEL3_SHIFT'

    return trans

    Returns the next status (modifier) based on the current status, 
    the event on the new modifier (pressed or released) and the new modifier typed.
         next_status = f(event, modifier, curr_status)
    event can be {'press', release}; modifier is one of the possible modifier in mod_keys 
    list and curr_status is the current modifier.
    
recipes/Python/577952_Parser_Keylogger_based_Finite_State/recipe-577952.py