qmk_firmware

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

rgb.c (1323B)


      1 /* Copyright 2021 datafx
      2  *
      3  * This program is free software: you can redistribute it and/or modify
      4  * it under the terms of the GNU General Public License as published by
      5  * the Free Software Foundation, either version 2 of the License, or
      6  * (at your option) any later version.
      7  *
      8  * This program is distributed in the hope that it will be useful,
      9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     11  * GNU General Public License for more details.
     12  *
     13  * You should have received a copy of the GNU General Public License
     14  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
     15  */
     16 #include "quantum.h"
     17 
     18 bool rgb_matrix_indicators_kb(void) {
     19     if (!rgb_matrix_indicators_user()) {
     20         return false;
     21     }
     22     led_t host_leds = host_keyboard_led_state();
     23     if (host_leds.scroll_lock) {
     24         rgb_matrix_set_color(92, 0xFF, 0x0, 0x0);
     25     } else {
     26         rgb_matrix_set_color(92, 0x0, 0x0, 0x0);
     27     }
     28     if (host_leds.num_lock) {
     29         rgb_matrix_set_color(93, 0xFF, 0x0, 0x0);
     30     } else {
     31         rgb_matrix_set_color(93, 0x0, 0x0, 0x0);
     32     }
     33     if (host_leds.caps_lock) {
     34         rgb_matrix_set_color(94, 0xFF, 0x0, 0x0);
     35     } else {
     36         rgb_matrix_set_color(94, 0x0, 0x0, 0x0);
     37     }
     38     return true;
     39 }