qmk_firmware

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

rev2.c (691B)


      1 // Copyright 2025 Danny Nguyen (danny@keeb.io)
      2 // SPDX-License-Identifier: GPL-2.0-or-later
      3 
      4 #include "quantum.h"
      5 
      6 bool encoder_update_kb(uint8_t index, bool clockwise) {
      7     if (!encoder_update_user(index, clockwise)) { return false; }
      8     if (index == 0) {
      9         if (clockwise) {
     10             tap_code(KC_VOLU);
     11         } else {
     12             tap_code(KC_VOLD);
     13         }
     14     }
     15     else if (index == 1) {
     16         if (clockwise) {
     17             tap_code(KC_DOWN);
     18         } else {
     19             tap_code(KC_UP);
     20         }
     21     }
     22     else if (index == 2) {
     23         if (clockwise) {
     24             tap_code(KC_PGDN);
     25         } else {
     26             tap_code(KC_PGUP);
     27         }
     28     }
     29     return false;
     30 }