Skip to content

Commit

Permalink
[Layer Map] Include edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
drashna committed May 18, 2024
1 parent fb6709c commit 991a248
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@

#define DEBOUNCE 15

#define LAYER_MAP_REMAPPING
#define LAYER_MAP_COLS 17
#define LAYER_MAP_ROWS 8
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ keypos_t layer_remap[LAYER_MAP_ROWS][LAYER_MAP_COLS] = {
{ { 0, 2 }, { 1, 2 }, { 2, 2 }, { 3, 2 }, { 4, 2 }, { 5, 2 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 0, 8 }, { 1, 8 }, { 2, 8 }, { 3, 8 }, { 4, 8 }, { 5, 8 } },
{ { 0, 3 }, { 1, 3 }, { 2, 3 }, { 3, 3 }, { 4, 3 }, { 5, 3 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 0, 9 }, { 1, 9 }, { 2, 9 }, { 3, 9 }, { 4, 9 }, { 5, 9 } },
{ { 255, 255 }, { 255, 255 }, { 2, 4 }, { 3, 4 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 2, 10 }, { 3, 10 }, { 255, 255 }, { 255, 255 } },
{ { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 4, 4 }, { 5, 4 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 1, 10 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 } },
{ { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 4, 5 }, { 5, 5 }, { 255, 255 }, { 255, 255 }, { 1, 11 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 } },
{ { 255, 255 }, { 255, 255 }, { 0, 252 }, { 255, 255 }, { 4, 4 }, { 5, 4 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 1, 10 }, { 255, 255 }, { 1, 252 }, { 255, 255 }, { 255, 255 } },
{ { 255, 255 }, { 255, 255 }, { 0, 253 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 4, 5 }, { 5, 5 }, { 255, 255 }, { 255, 255 }, { 1, 11 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 1, 253 }, { 255, 255 }, { 255, 255 } },
{ { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 2, 5 }, { 3, 5 }, { 255, 255 }, { 2, 11 }, { 3, 11 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 }, { 255, 255 } },

};
6 changes: 6 additions & 0 deletions users/drashna/features/layer_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,21 @@ void populate_layer_map(void) {
}

bool peek_matrix_layer_map(uint8_t row, uint8_t col) {
#ifdef LAYER_MAP_REMAPPING
return peek_matrix(layer_remap[row][col].row, layer_remap[row][col].col, false);
#else
return peek_matrix(row, col, false);
#endif
}

void housekeeping_task_layer_map(void) {
#ifdef SWAP_HANDS_ENABLE
static bool swap_hands = false;
if (is_swap_hands_on() != swap_hands) {
swap_hands = is_swap_hands_on();
layer_map_set = true;
}
#endif
if (layer_map_set) {
populate_layer_map();
layer_map_set = false;
Expand Down

0 comments on commit 991a248

Please sign in to comment.