(ecode_dict, ecode_list, unknown='?')
return res
Resolve event codes and types to their verbose names.

    Example
    -------
    >>> resolve_ecodes(ecodes.BTN, [272, 273, 274])
    [(['BTN_LEFT', 'BTN_MOUSE'], 272), ('BTN_RIGHT', 273), ('BTN_MIDDLE', 274)]
Resolve event codes and types to their verbose names.
Resolve event codes and types to their verbose names .
def resolve_ecodes(ecode_dict, ecode_list, unknown='?'):
    '''
    Resolve event codes and types to their verbose names.

    Example
    -------
    >>> resolve_ecodes(ecodes.BTN, [272, 273, 274])
    [(['BTN_LEFT', 'BTN_MOUSE'], 272), ('BTN_RIGHT', 273), ('BTN_MIDDLE', 274)]
    '''
    res = []
    for ecode in ecode_list:
        # elements with AbsInfo(), eg { 3 : [(0, AbsInfo(...)), (1, AbsInfo(...))] }
        if isinstance(ecode, tuple):
            if ecode[0] in ecode_dict:
                l = ((ecode_dict[ecode[0]], ecode[0]), ecode[1])
            else:
                l = ((unknown, ecode[0]), ecode[1])

        # just ecodes, e.g: { 0 : [0, 1, 3], 1 : [30, 48] }
        else:
            if ecode in ecode_dict:
                l = (ecode_dict[ecode], ecode)
            else:
                l = (unknown, ecode)
        res.append(l)

    return res
def resolve_ecodes ( ecode_dict , ecode_list , unknown = '?' ) : res = [ ] for ecode in ecode_list : # elements with AbsInfo(), eg { 3 : [(0, AbsInfo(...)), (1, AbsInfo(...))] } if isinstance ( ecode , tuple ) : if ecode [ 0 ] in ecode_dict : l = ( ( ecode_dict [ ecode [ 0 ] ] , ecode [ 0 ] ) , ecode [ 1 ] ) else : l = ( ( unknown , ecode [ 0 ] ) , ecode [ 1 ] ) # just ecodes, e.g: { 0 : [0, 1, 3], 1 : [30, 48] } else : if ecode in ecode_dict : l = ( ecode_dict [ ecode ] , ecode ) else : l = ( unknown , ecode ) res . append ( l ) return res