summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2018-10-26 22:47:00 +0200
committerDrashna Jaelre <drashna@live.com>2018-10-26 23:24:13 +0200
commit24b3556e844ec76813a42ce4c5b7a77a6f874d5a (patch)
treea070897eaa08da40957fa08818843ac687b6ad32 /docs
parent85688e5b52112c86895171d3dc8b26610480e932 (diff)
downloadqmk_firmware-24b3556e844ec76813a42ce4c5b7a77a6f874d5a.tar.gz
qmk_firmware-24b3556e844ec76813a42ce4c5b7a77a6f874d5a.tar.xz
add better example
Diffstat (limited to 'docs')
-rw-r--r--docs/feature_encoders.md11
1 files changed, 9 insertions, 2 deletions
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 `<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);
+ }
+ }
}
-
## 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.