diff options
author | QMK Bot <hello@qmk.fm> | 2022-08-13 00:27:58 +0000 |
---|---|---|
committer | QMK Bot <hello@qmk.fm> | 2022-08-13 00:27:58 +0000 |
commit | 06391314cd6ed1cc8e3d8391bc06787d61ed7fbd (patch) | |
tree | 06cba60770d731358be85a67e004a4e98516772b /docs | |
parent | ccdba43e59fc42c9a91373c65eaa4a026539dc80 (diff) | |
parent | a1fe9fe3b32c5559b467cfb2466740285a877eff (diff) |
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'docs')
-rw-r--r-- | docs/feature_encoders.md | 55 | ||||
-rw-r--r-- | docs/feature_rgb_matrix.md | 8 | ||||
-rw-r--r-- | docs/newbs_learn_more_resources.md | 1 |
3 files changed, 33 insertions, 31 deletions
diff --git a/docs/feature_encoders.md b/docs/feature_encoders.md index ad6ed2bece..fdde03ac23 100644 --- a/docs/feature_encoders.md +++ b/docs/feature_encoders.md @@ -125,34 +125,37 @@ Layer conditions can also be used with the callback function like the following: ```c bool encoder_update_user(uint8_t index, bool clockwise) { - if (get_highest_layer(layer_state|default_layer_state) > 0) { - if (index == 0) { - if (clockwise) { - tap_code(KC_WH_D); - } else { - tap_code(KC_WH_U); + switch(get_highest_layer(layer_state|default_layer_state)) { + case 0: + if (index == 0) { + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } else if (index == 1) { + if (clockwise) { + rgb_matrix_increase_speed(); + } else { + rgb_matrix_decrease_speed(); + } } - } else if (index == 1) { - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); + 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); + } } - } - } else { /* Layer 0 */ - if (index == 0) { - if (clockwise) { - tap_code(KC_PGDN); - } else { - tap_code(KC_PGUP); - } - } else if (index == 1) { - if (clockwise) { - rgb_matrix_increase_speed(); - } else { - rgb_matrix_decrease_speed(); - } - } + break; } return false; } diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index f9ab395488..13c63ac94c 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md @@ -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 void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { for (uint8_t i = led_min; i <= led_max; i++) { switch(get_highest_layer(layer_state|default_layer_state)) { - case RAISE: + case 2: rgb_matrix_set_color(i, RGB_BLUE); break; - case LOWER: + case 1: rgb_matrix_set_color(i, RGB_YELLOW); break; 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 void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { if (get_highest_layer(layer_state) > 0) { diff --git a/docs/newbs_learn_more_resources.md b/docs/newbs_learn_more_resources.md index a66ee4ab26..1afdc206bd 100644 --- a/docs/newbs_learn_more_resources.md +++ b/docs/newbs_learn_more_resources.md @@ -20,7 +20,6 @@ Not sure which text editor to use? Editors specifically made for code: * [Sublime Text](https://www.sublimetext.com/) * [VS Code](https://code.visualstudio.com/) -* [Atom](https://atom.io/) ### Git resources |