diff options
Diffstat (limited to 'keyboards/rubi/rubi.c')
-rw-r--r-- | keyboards/rubi/rubi.c | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/keyboards/rubi/rubi.c b/keyboards/rubi/rubi.c index 6cdf8302c..50e5fcf78 100644 --- a/keyboards/rubi/rubi.c +++ b/keyboards/rubi/rubi.c | |||
@@ -73,36 +73,7 @@ bool led_update_kb(led_t led_state) { | |||
73 | return true; | 73 | return true; |
74 | } | 74 | } |
75 | 75 | ||
76 | __attribute__ ((weak)) void encoder_update_user(uint8_t index, bool clockwise) { | 76 | bool encoder_update_kb(uint8_t index, bool clockwise) { |
77 | if (index == 0) { | 77 | if (!encoder_update_user(index, clockwise)) { return false; } |
78 | if (get_highest_layer(layer_state) == 0) { | 78 | return true; |
79 | uint16_t mapped_code = 0; | ||
80 | if (clockwise) { | ||
81 | mapped_code = handle_encoder_cw(); | ||
82 | } else { | ||
83 | mapped_code = handle_encoder_ccw(); | ||
84 | } | ||
85 | if (mapped_code != 0) { | ||
86 | tap_code16(mapped_code); | ||
87 | } | ||
88 | } else { | ||
89 | if (clockwise) { | ||
90 | if (oled_mode == OLED_MODE_CALC) { | ||
91 | handle_encoder_cw(); | ||
92 | } else if (oled_mode == OLED_MODE_DEFAULT) { | ||
93 | change_encoder_mode(false); | ||
94 | } | ||
95 | } else { | ||
96 | if (oled_mode == OLED_MODE_CALC) { | ||
97 | handle_encoder_ccw(); | ||
98 | } else if (oled_mode == OLED_MODE_DEFAULT) { | ||
99 | change_encoder_mode(true); | ||
100 | } | ||
101 | } | ||
102 | } | ||
103 | } | ||
104 | } | ||
105 | |||
106 | void encoder_update_kb(uint8_t index, bool clockwise) { | ||
107 | encoder_update_user(index, clockwise); | ||
108 | } | 79 | } |