aboutsummaryrefslogtreecommitdiff
path: root/keyboards/torn/torn_encoder.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/torn/torn_encoder.c')
-rw-r--r--keyboards/torn/torn_encoder.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/keyboards/torn/torn_encoder.c b/keyboards/torn/torn_encoder.c
index 9178388d0..64804ac3a 100644
--- a/keyboards/torn/torn_encoder.c
+++ b/keyboards/torn/torn_encoder.c
@@ -38,11 +38,13 @@ const uint16_t encoder_default[2][2] = { { KC_PGDN, KC_PGUP }, { KC__VOLDOWN, K
38/** 38/**
39 * Tap on encoder updates using the encoder keymap 39 * Tap on encoder updates using the encoder keymap
40 */ 40 */
41void encoder_update_kb(uint8_t index, bool clockwise) { 41bool encoder_update_kb(uint8_t index, bool clockwise) {
42 // if (!encoder_update_user(index, clockwise)) return false;
43
42 uint16_t code; 44 uint16_t code;
43 45
44 if (encoder_keymaps) { 46 if (encoder_keymaps) {
45 int layer = get_highest_layer(layer_state); 47 uint8_t layer = get_highest_layer(layer_state);
46 do { 48 do {
47 code = pgm_read_word(&encoder_keymaps[layer--][index][clockwise]); 49 code = pgm_read_word(&encoder_keymaps[layer--][index][clockwise]);
48 } while (code == KC_TRNS); 50 } while (code == KC_TRNS);
@@ -51,6 +53,7 @@ void encoder_update_kb(uint8_t index, bool clockwise) {
51 } 53 }
52 54
53 tap_code16(code); 55 tap_code16(code);
56 return true;
54} 57}
55 58
56static bool encoder_read_state(uint8_t *state) { 59static bool encoder_read_state(uint8_t *state) {