qmk_firmware

QMK firmware for my keyboards (Corne, Sweep Ferris) and trackball (Ploopy Adept)
Log | Files | Refs | Submodules | LICENSE

rev4.c (571B)


      1 // Copyright 2025 Danny Nguyen (danny@keeb.io)
      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(KC_VOLU);
     12         } else {
     13             tap_code(KC_VOLD);
     14         }
     15     } else if (index == 1) {
     16         if (clockwise) {
     17             tap_code(KC_PGDN);
     18         } else {
     19             tap_code(KC_PGUP);
     20         }
     21     }
     22     return false;
     23 }
     24 #endif