Fix Encoder documentation (#4861)
This commit is contained in:
parent
12406c646f
commit
52f1206712
@ -32,15 +32,19 @@ The callback functions can be inserted into your `<keyboard>.c`:
|
|||||||
or `keymap.c`:
|
or `keymap.c`:
|
||||||
|
|
||||||
void encoder_update_user(uint8_t index, bool clockwise) {
|
void encoder_update_user(uint8_t index, bool clockwise) {
|
||||||
if (index == 0) {
|
if (index == 0) { /* First encoder */
|
||||||
if (clockwise) {
|
if (clockwise) {
|
||||||
register_code(KC_PGDN);
|
tap_code(KC_PGDN);
|
||||||
unregister_code(KC_PGDN);
|
} else {
|
||||||
} else {
|
tap_code(KC_PGUP);
|
||||||
register_code(KC_PGUP);
|
|
||||||
unregister_code(KC_PGUP);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
} else if (index == 2) {
|
||||||
|
if (clockwise) {
|
||||||
|
tap_code(KC_UP);
|
||||||
|
} else {
|
||||||
|
tap_code(KC_DOWN);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
## Hardware
|
## Hardware
|
||||||
|
@ -11,6 +11,7 @@ QMK has a staggering number of features for building your keyboard. It can take
|
|||||||
* [Combos](feature_combo.md) - Custom actions for multiple key holds.
|
* [Combos](feature_combo.md) - Custom actions for multiple key holds.
|
||||||
* [Command](feature_command.md) - Runtime version of bootmagic (Formerly known as "Magic").
|
* [Command](feature_command.md) - Runtime version of bootmagic (Formerly known as "Magic").
|
||||||
* [Dynamic Macros](feature_dynamic_macros.md) - Record and playback macros from the keyboard itself.
|
* [Dynamic Macros](feature_dynamic_macros.md) - Record and playback macros from the keyboard itself.
|
||||||
|
* [Encoders](feature_encoders.md) - Rotary encoders!
|
||||||
* [Grave Escape](feature_grave_esc.md) - Lets you use a single key for Esc and Grave.
|
* [Grave Escape](feature_grave_esc.md) - Lets you use a single key for Esc and Grave.
|
||||||
* [HD44780 LCD Display](feature_hd44780.md) - Support for LCD character displays using the HD44780 standard.
|
* [HD44780 LCD Display](feature_hd44780.md) - Support for LCD character displays using the HD44780 standard.
|
||||||
* [Key Lock](feature_key_lock.md) - Lock a key in the "down" state.
|
* [Key Lock](feature_key_lock.md) - Lock a key in the "down" state.
|
||||||
|
Loading…
Reference in New Issue
Block a user