def METHOD_NAME(kbf_data):
    layout = []
    for key in kbf_data['keyboard.keys']:
        item = {
            'matrix': [key['row'], key['col']],
            'x': key['state']['x'],
            'y': key['state']['y'],
        }
        if key['state']['w'] != 1:
            item['w'] = key['state']['w']
        if key['state']['h'] != 1:
            item['h'] = key['state']['h']
        layout.append(item)
    return layout