Resolves #121: Use flattened keymaps, which can visually represent the logical layout, rather than the physical wiring

This commit is contained in:
Josh Klar
2019-05-12 17:04:23 -07:00
parent d70c2ccc17
commit 0b364cf7f1
10 changed files with 156 additions and 94 deletions

View File

@@ -47,10 +47,26 @@ class InternalState:
return ret
def _find_key_in_map(self, row, col):
ic = intify_coordinate(row, col)
try:
idx = self.config.coord_mapping.index(ic)
except ValueError:
if self.config.debug_enabled:
print(
'No coord_mapping index for value {}, row={} col={}'.format(
ic,
row,
col,
),
)
return None
# Later-added layers have priority. Sift through the layers
# in reverse order until we find a valid keycode object
for layer in self.reversed_active_layers:
layer_key = self.config.keymap[layer][row][col]
layer_key = self.config.keymap[layer][idx]
if not layer_key or layer_key == KC.TRNS:
continue