diff options
author | Alex Ong <the.onga@gmail.com> | 2019-01-26 12:13:19 +1100 |
---|---|---|
committer | Alex Ong <the.onga@gmail.com> | 2019-01-26 12:13:19 +1100 |
commit | c9ba618654417ec115809a031d315f8327c79ad4 (patch) | |
tree | cd5b907af5bebde7062897ff847e473232ed1214 /docs/feature_encoders.md | |
parent | 2bb2977c133646c4e056960e72029270d77cc1eb (diff) | |
parent | d977daa8dc9136746425f9e1414e1f93cb161877 (diff) |
DO NOT USE Merge branch 'master' into debounce_refactor
Merged, however now there are two debounce.h and debounce.c to mess around with and coalesce.
# Conflicts:
# quantum/matrix.c
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 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 |