summaryrefslogtreecommitdiff
path: root/keyboards/terrazzo/readme.md
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2021-05-21 23:17:32 -0700
committerGitHub <noreply@github.com>2021-05-21 23:17:32 -0700
commita0fed0ea176d1c986e40fc4981b900509c90d66e (patch)
treeee12f5943046015ea0dce8e2a30a68bc8eb99dbe /keyboards/terrazzo/readme.md
parent76c23b15abc824f867b48d8d5100dced2417d336 (diff)
downloadqmk_firmware-a0fed0ea176d1c986e40fc4981b900509c90d66e.tar.gz
qmk_firmware-a0fed0ea176d1c986e40fc4981b900509c90d66e.zip
Convert Encoder callbacks to be boolean functions (#12805)
Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
Diffstat (limited to 'keyboards/terrazzo/readme.md')
-rw-r--r--keyboards/terrazzo/readme.md8
1 files changed, 5 insertions, 3 deletions
diff --git a/keyboards/terrazzo/readme.md b/keyboards/terrazzo/readme.md
index 08cecd6a64..e0f4f3457f 100644
--- a/keyboards/terrazzo/readme.md
+++ b/keyboards/terrazzo/readme.md
@@ -93,7 +93,7 @@ Terrazzo has 4 positions for encoders in the left-hand column. Up to 3 may be us
The default keymaps are setup for one encoder. Encoders can change behavior based on the current layer. Here, on the "NAV" layer, the encoder changes volume instead of scrolling.
```c
-void encoder_update_user(uint8_t index, bool clockwise) {
+bool encoder_update_user(uint8_t index, bool clockwise) {
terrazzo_scroll_pixel(clockwise);
switch(get_highest_layer(layer_state)) {
case _NAV:
@@ -105,13 +105,14 @@ void encoder_update_user(uint8_t index, bool clockwise) {
clockwise ? tap_code(KC_PGDN) : tap_code(KC_PGUP);
break;
}
+ return true;
}
```
If using multiple encoders, the `index` param can be used to distingish which is providing input.
```c
-void encoder_update_user(uint8_t index, bool clockwise) {
+bool encoder_update_user(uint8_t index, bool clockwise) {
terrazzo_scroll_pixel(clockwise);
switch(index) {
case 0:
@@ -121,5 +122,6 @@ void encoder_update_user(uint8_t index, bool clockwise) {
clockwise ? tap_code(KC_AUDIO_VOL_UP) : tap_code(KC_AUDIO_VOL_DOWN);
break;
}
+ return true;
}
-``` \ No newline at end of file
+```