Browse Source

Fix SWAP_HANDS for multimatrix

pull/3264/head
Fred Sundvik 5 years ago
parent
commit
32028cfc43
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      tmk_core/common/action.c

+ 3
- 2
tmk_core/common/action.c View File

@ -106,13 +106,14 @@ bool swap_held = false;
void process_hand_swap(keyevent_t *event) {
static swap_state_row_t swap_state[MATRIX_ROWS];
keypos_t pos = event->key;
// TODO: Properly support multimatrices, currenty this only works for single-matrix keyboards
keypos_t pos = event->key.pos;
swap_state_row_t col_bit = (swap_state_row_t)1<<pos.col;
bool do_swap = event->pressed ? swap_hands :
swap_state[pos.row] & (col_bit);
if (do_swap) {
event->key = hand_swap_config[pos.row][pos.col];
event->key.pos = hand_swap_config[pos.row][pos.col];
swap_state[pos.row] |= col_bit;
} else {
swap_state[pos.row] &= ~(col_bit);


Loading…
Cancel
Save