cxt_studio.c (989B)
1 // Copyright 2023 Colin Kinloch (@ColinKinloch) 2 // SPDX-License-Identifier: GPL-2.0-or-later 3 4 #include "quantum.h" 5 6 #ifdef ENCODER_ENABLE 7 bool encoder_update_kb(uint8_t index, bool clockwise) { 8 if (!encoder_update_user(index, clockwise)) { 9 return false; 10 } 11 switch (index) { 12 case 0: { 13 if (clockwise) { 14 tap_code_delay(KC_VOLU, 10); 15 } else { 16 tap_code_delay(KC_VOLD, 10); 17 } 18 } 19 break; 20 case 1: { 21 if (clockwise) { 22 rgb_matrix_increase_hue(); 23 } else { 24 rgb_matrix_decrease_hue(); 25 } 26 } 27 break; 28 case 2: { 29 if (clockwise) { 30 rgb_matrix_increase_val(); 31 } else { 32 rgb_matrix_decrease_val(); 33 } 34 } 35 break; 36 case 3: { 37 if (clockwise) { 38 rgb_matrix_step(); 39 } else { 40 rgb_matrix_step_reverse(); 41 } 42 } 43 break; 44 } 45 return true; 46 } 47 #endif