summaryrefslogtreecommitdiff
path: root/docs/feature_encoders.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/feature_encoders.md')
-rw-r--r--docs/feature_encoders.md20
1 files changed, 12 insertions, 8 deletions
diff --git a/docs/feature_encoders.md b/docs/feature_encoders.md
index 208d6db13c..6eab402ef9 100644
--- a/docs/feature_encoders.md
+++ b/docs/feature_encoders.md
@@ -32,15 +32,19 @@ The callback functions can be inserted into your `<keyboard>.c`:
or `keymap.c`:
void encoder_update_user(uint8_t index, bool clockwise) {
- if (index == 0) {
- if (clockwise) {
- register_code(KC_PGDN);
- unregister_code(KC_PGDN);
- } else {
- register_code(KC_PGUP);
- unregister_code(KC_PGUP);
- }
+ if (index == 0) { /* First encoder */
+ if (clockwise) {
+ tap_code(KC_PGDN);
+ } else {
+ tap_code(KC_PGUP);
}
+ } else if (index == 2) {
+ if (clockwise) {
+ tap_code(KC_UP);
+ } else {
+ tap_code(KC_DOWN);
+ }
+ }
}
## Hardware