Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Volume as default encoder documentation example #15678

Merged
merged 2 commits into from
Jan 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions docs/feature_encoders.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ or `keymap.c`:
bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) { /* First encoder */
if (clockwise) {
tap_code(KC_PGDN);
tap_code_delay(KC_VOLU, 10);
} else {
tap_code(KC_PGUP);
tap_code_delay(KC_VOLD, 10);
}
} else if (index == 1) { /* Second encoder */
if (clockwise) {
tap_code(KC_DOWN);
rgb_matrix_increase_hue();
} else {
tap_code(KC_UP);
rgb_matrix_decrease_hue();
}
}
return false;
Expand All @@ -100,9 +100,9 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
}
} else if (index == 1) {
if (clockwise) {
tap_code(KC_VOLU);
tap_code_delay(KC_VOLU, 10);
} else {
tap_code(KC_VOLD);
tap_code_delay(KC_VOLD, 10);
}
}
} else { /* Layer 0 */
Expand All @@ -114,16 +114,18 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
}
} else if (index == 1) {
if (clockwise) {
tap_code(KC_DOWN);
rgb_matrix_increase_speed();
} else {
tap_code(KC_UP);
rgb_matrix_decrease_speed();
}
}
}
return false;
}
```

?> Media and mouse countrol keycodes such as `KC_VOLU` and `KC_WH_D` requires `EXTRAKEY_ENABLE = yes` and `MOUSEKEY_ENABLE = yes` respectively in user's `rules.mk` if they are not enabled as default on keyboard level configuration.

## Hardware

The A an B lines of the encoders should be wired directly to the MCU, and the C/common lines should be wired to ground.
Expand Down