1
0
Fork 0

Fix Encoder documentation (#4861)

This commit is contained in:
Drashna Jael're 2019-01-18 07:33:43 -08:00 committed by MechMerlin
parent 12406c646f
commit 52f1206712
2 changed files with 13 additions and 8 deletions

View file

@ -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