X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=docs%2Ffeature_encoders.md;h=036c6a1d8961485d59de2917b9a224e1a6b10672;hb=f2fda1bd56c97019777fb2a028d088ae37693b0f;hp=f482eefec8385a149e925140cbcf436bb8177f4d;hpb=85688e5b52112c86895171d3dc8b26610480e932;p=qmk_firmware.git diff --git a/docs/feature_encoders.md b/docs/feature_encoders.md index f482eefec..036c6a1d8 100644 --- a/docs/feature_encoders.md +++ b/docs/feature_encoders.md @@ -32,10 +32,17 @@ The callback functions can be inserted into your `.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); + } + } } - ## 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.