mirror of
https://github.com/qmk/qmk_firmware.git
synced 2024-12-11 12:20:55 +00:00
Merge remote-tracking branch 'origin/develop' into xap
This commit is contained in:
commit
5f4db83899
@ -125,21 +125,8 @@ Layer conditions can also be used with the callback function like the following:
|
|||||||
|
|
||||||
```c
|
```c
|
||||||
bool encoder_update_user(uint8_t index, bool clockwise) {
|
bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||||
if (get_highest_layer(layer_state|default_layer_state) > 0) {
|
switch(get_highest_layer(layer_state|default_layer_state)) {
|
||||||
if (index == 0) {
|
case 0:
|
||||||
if (clockwise) {
|
|
||||||
tap_code(KC_WH_D);
|
|
||||||
} else {
|
|
||||||
tap_code(KC_WH_U);
|
|
||||||
}
|
|
||||||
} else if (index == 1) {
|
|
||||||
if (clockwise) {
|
|
||||||
tap_code_delay(KC_VOLU, 10);
|
|
||||||
} else {
|
|
||||||
tap_code_delay(KC_VOLD, 10);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else { /* Layer 0 */
|
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
if (clockwise) {
|
if (clockwise) {
|
||||||
tap_code(KC_PGDN);
|
tap_code(KC_PGDN);
|
||||||
@ -153,6 +140,22 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
|
|||||||
rgb_matrix_decrease_speed();
|
rgb_matrix_decrease_speed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
if (index == 0) {
|
||||||
|
if (clockwise) {
|
||||||
|
tap_code(KC_WH_D);
|
||||||
|
} else {
|
||||||
|
tap_code(KC_WH_U);
|
||||||
|
}
|
||||||
|
} else if (index == 1) {
|
||||||
|
if (clockwise) {
|
||||||
|
tap_code_delay(KC_VOLU, 10);
|
||||||
|
} else {
|
||||||
|
tap_code_delay(KC_VOLD, 10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -917,15 +917,15 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Layer indicator on all flagged keys:
|
Layer indicator on all keys:
|
||||||
```c
|
```c
|
||||||
void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
|
void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
|
||||||
for (uint8_t i = led_min; i <= led_max; i++) {
|
for (uint8_t i = led_min; i <= led_max; i++) {
|
||||||
switch(get_highest_layer(layer_state|default_layer_state)) {
|
switch(get_highest_layer(layer_state|default_layer_state)) {
|
||||||
case RAISE:
|
case 2:
|
||||||
rgb_matrix_set_color(i, RGB_BLUE);
|
rgb_matrix_set_color(i, RGB_BLUE);
|
||||||
break;
|
break;
|
||||||
case LOWER:
|
case 1:
|
||||||
rgb_matrix_set_color(i, RGB_YELLOW);
|
rgb_matrix_set_color(i, RGB_YELLOW);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -935,7 +935,7 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Layer indicator with only configured keys:
|
Layer indicator only on keys with configured keycodes:
|
||||||
```c
|
```c
|
||||||
void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
|
void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
|
||||||
if (get_highest_layer(layer_state) > 0) {
|
if (get_highest_layer(layer_state) > 0) {
|
||||||
|
@ -20,7 +20,6 @@ Not sure which text editor to use?
|
|||||||
Editors specifically made for code:
|
Editors specifically made for code:
|
||||||
* [Sublime Text](https://www.sublimetext.com/)
|
* [Sublime Text](https://www.sublimetext.com/)
|
||||||
* [VS Code](https://code.visualstudio.com/)
|
* [VS Code](https://code.visualstudio.com/)
|
||||||
* [Atom](https://atom.io/)
|
|
||||||
|
|
||||||
### Git resources
|
### Git resources
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
[0] = LAYOUT_all(
|
[0] = LAYOUT_all(
|
||||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NUM_LOCK, KC_PSLS, KC_PAST, KC_PMNS,
|
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS,
|
||||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_TRNS,
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_TRNS,
|
||||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS,
|
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS,
|
||||||
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_DEL, KC_UP, KC_P1, KC_P2, KC_P3, KC_TRNS,
|
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_DEL, KC_UP, KC_P1, KC_P2, KC_P3, KC_TRNS,
|
||||||
|
@ -19,7 +19,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
|
|
||||||
[0] = LAYOUT_all(
|
[0] = LAYOUT_all(
|
||||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NUM_LOCK, KC_PSLS, KC_PAST, KC_PMNS,
|
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS,
|
||||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_TRNS,
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_TRNS,
|
||||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS,
|
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS,
|
||||||
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_DEL, KC_UP, KC_P1, KC_P2, KC_P3, KC_TRNS,
|
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_DEL, KC_UP, KC_P1, KC_P2, KC_P3, KC_TRNS,
|
||||||
|
Loading…
Reference in New Issue
Block a user