keymap.c (816B)
1 #include QMK_KEYBOARD_H 2 3 enum encoder_names { 4 _LEFT, 5 _RIGHT, 6 _MIDDLE, 7 }; 8 9 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 10 [0] = LAYOUT( 11 KC_A, KC_B, KC_C, 12 KC_D, KC_E, KC_F, 13 KC_G, KC_H, RM_NEXT 14 ), 15 }; 16 17 bool encoder_update_user(uint8_t index, bool clockwise) { 18 if (index == _LEFT) { 19 if (clockwise) { 20 rgblight_increase_hue(); 21 } else { 22 rgblight_decrease_hue(); 23 } 24 } 25 else if (index == _MIDDLE) { 26 if (clockwise) { 27 rgblight_increase_sat(); 28 } else { 29 rgblight_decrease_sat(); 30 } 31 } 32 else if (index == _RIGHT) { 33 if (clockwise) { 34 rgblight_increase_val(); 35 } else { 36 rgblight_decrease_val(); 37 } 38 } 39 return true; 40 }