diff options
| author | Zach DeCook <zachdecook@librem.one> | 2024-05-25 16:06:34 -0400 |
|---|---|---|
| committer | Zach DeCook <zachdecook@librem.one> | 2024-05-25 16:17:34 -0400 |
| commit | c7821c7cb9026a96367e5301e5b848b29f73eb44 (patch) | |
| tree | e8ce5491a6982462c9de181cc4a620a699af1e82 /makeLayout.py | |
| parent | 31237cac0f7867571658cfc5e2a4aedd5927a025 (diff) | |
| download | HexBoard-c7821c7cb9026a96367e5301e5b848b29f73eb44.tar.gz | |
Build: cleanup
Diffstat (limited to 'makeLayout.py')
| -rwxr-xr-x | makeLayout.py | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/makeLayout.py b/makeLayout.py deleted file mode 100755 index 0138817..0000000 --- a/makeLayout.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python3 -import sys - -evenCols=9 -oddCols=10 -rows=14 - -def makeLayout(starting, across, downleft): - a = [] - for row in range(0, rows): - a.append([]) - for col in range(0, oddCols if row%2 else evenCols): - if row == 0 and col == 0: - a[row].append(starting) - elif col > 0: - a[row].append(a[row][col-1] + across) - else: # col == 0 - if row%2: - ref = a[row-1][0] - else: - ref = a[row-1][1] - a[row].append(ref+downleft) - return a - -def print_qmk(layout): - # Mapping to QMK constants - start = ["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"] - start = ["MI_"+x for x in start] - arr = start.copy() - for n in range(1,6): - arr += [x+str(n) for x in start] - row = 0 - print("LAYOUT_inorder(") - for Row in layout: - if row%2 == 0: - n = int(row/2)+1 - print(f"_______, ", end='') - else: - print(" ", end='') - for entry in Row: - print(arr[entry] if entry < len(arr) else 'KC_NO', end=', ') - print() - row = row + 1 - print(" ),") - -if __name__ == '__main__': - layout = makeLayout(int(sys.argv[1]), int(sys.argv[2]), int(sys.argv[3])) - if len(sys.argv)==5: - print_qmk(layout) - exit() - #print(layout) - row = 0 - for Row in layout: - if row%2 == 0: - n = int(row/2)+1 - print(f" ROW_FLIP(CMDB_{n}, ", end='') - else: - print(" ROW_FLIP(", end='') - col = 1 - for entry in Row: - end = ', ' if col < (oddCols if row%2 else evenCols) else '' - print(entry, end=end) - col = col + 1 - print(')' if row +1 == rows else '),') - row = row + 1 |
