From a19ae3d78466588caa9caf7c38d1617932255733 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Wed, 1 Nov 2023 00:55:48 +0000 Subject: Add dd mapping for hardware based split handedness (#22369) --- lib/python/qmk/cli/generate/keyboard_c.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'lib/python/qmk/cli/generate/keyboard_c.py') diff --git a/lib/python/qmk/cli/generate/keyboard_c.py b/lib/python/qmk/cli/generate/keyboard_c.py index 325624c9cc..f8a2372cf3 100755 --- a/lib/python/qmk/cli/generate/keyboard_c.py +++ b/lib/python/qmk/cli/generate/keyboard_c.py @@ -63,13 +63,14 @@ def _gen_matrix_mask(info_data): cols = info_data['matrix_size']['cols'] rows = info_data['matrix_size']['rows'] - # Default mask to everything enabled - mask = [['1'] * cols for i in range(rows)] - - # Automatically mask out dip_switch.matrix_grid locations - matrix_grid = info_data.get('dip_switch', {}).get('matrix_grid', []) - for row, col in matrix_grid: - mask[row][col] = '0' + # Default mask to everything disabled + mask = [['0'] * cols for i in range(rows)] + + # Mirror layout macros squashed on top of each other + for layout_data in info_data['layouts'].values(): + for key_data in layout_data['layout']: + row, col = key_data['matrix'] + mask[row][col] = '1' lines = [] lines.append('#ifdef MATRIX_MASKED') -- cgit v1.2.3