diff options
author | Drashna Jaelre <drashna@live.com> | 2019-01-18 07:33:43 -0800 |
---|---|---|
committer | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2019-01-18 07:33:43 -0800 |
commit | 52f1206712348a97b8de5700b5fc3eabe424096b (patch) | |
tree | f10e39741e4b81bd6f29ac44018b0674c8043b1f /docs/feature_encoders.md | |
parent | 12406c646f917b7451ec265d767f07a34ecf906a (diff) | |
download | firmware-52f1206712348a97b8de5700b5fc3eabe424096b.tar.gz firmware-52f1206712348a97b8de5700b5fc3eabe424096b.tar.bz2 firmware-52f1206712348a97b8de5700b5fc3eabe424096b.zip |
Fix Encoder documentation (#4861)
Diffstat (limited to 'docs/feature_encoders.md')
-rw-r--r-- | docs/feature_encoders.md | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/docs/feature_encoders.md b/docs/feature_encoders.md index 208d6db13..6eab402ef 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 |