avalanche.c (605B)
1 // Copyright 2022 Vitaly Volkov (@vlkv) 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)) { return false; } 9 if (index == 0) { 10 if (clockwise) { 11 tap_code_delay(KC_VOLU, 10); 12 } else { 13 tap_code_delay(KC_VOLD, 10); 14 } 15 } else if (index == 1) { /* Second encoder */ 16 if (clockwise) { 17 tap_code(KC_PGUP); 18 } else { 19 tap_code(KC_PGDN); 20 } 21 } 22 return true; 23 } 24 #endif 25