FIX: clear keyboard_keys.
NOT change layer when one more Fn keys pressed/other than Fn key pressedmaster
parent
54b5bafaac
commit
9d7979931e
|
@ -152,12 +152,17 @@ int get_layer(void) {
|
||||||
for (int col = 0; col < MATRIX_ROWS; col++) {
|
for (int col = 0; col < MATRIX_ROWS; col++) {
|
||||||
if (matrix[row] & 1<<col) continue; // NOT pressed
|
if (matrix[row] & 1<<col) continue; // NOT pressed
|
||||||
uint8_t code = get_keycode(0, row, col);
|
uint8_t code = get_keycode(0, row, col);
|
||||||
if (code == FN_1) layer = 1;
|
|
||||||
else if (code == FN_2) layer = 2;
|
// NOT change current_layer when one more Fn keys pressed
|
||||||
else if (code == FN_3) layer = 3;
|
// when other than Fn key pressed
|
||||||
else if (code == FN_4) layer = 4;
|
if (code == FN_1) layer = layer ? current_layer : 1;
|
||||||
|
else if (code == FN_2) layer = layer ? current_layer : 2;
|
||||||
|
else if (code == FN_3) layer = layer ? current_layer : 3;
|
||||||
|
else if (code == FN_4) layer = layer ? current_layer : 4;
|
||||||
else if (KB_LCTRL <= code && code <= KB_RGUI)
|
else if (KB_LCTRL <= code && code <= KB_RGUI)
|
||||||
modifiers |= 1<<(code & 0x07);
|
modifiers |= 1<<(code & 0x07);
|
||||||
|
else // other_key_pressed
|
||||||
|
layer = current_layer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ void proc_matrix(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
keyboard_modifier_keys = 0;
|
keyboard_modifier_keys = 0;
|
||||||
for (int i = 0; i < 3; i++) keyboard_keys[i] = KB_NO;
|
for (int i = 0; i < 6; i++) keyboard_keys[i] = KB_NO;
|
||||||
key_index = 0;
|
key_index = 0;
|
||||||
mouse_btn = 0;
|
mouse_btn = 0;
|
||||||
mouse_x = 0;
|
mouse_x = 0;
|
||||||
|
|
Loading…
Reference in New Issue