]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - quantum/quantum.c
adds planck light keyboard
[qmk_firmware.git] / quantum / quantum.c
index a1a1a9d1cb0b6cf610119d8a49d657be673ebd55..09920159660febc52bc758350699941cdc32ad5a 100644 (file)
@@ -290,6 +290,18 @@ bool process_record_quantum(keyrecord_t *record) {
       rgblight_step();
     }
     return false;
+  case RGB_SMOD:
+    // same as RBG_MOD, but if shift is pressed, it will use the reverese direction instead.
+    if (record->event.pressed) {
+      uint8_t shifted = get_mods() & (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT));
+      if(shifted) {
+        rgblight_step_reverse();
+      }
+      else {
+        rgblight_step();
+      }
+    }
+    return false;
   case RGB_HUI:
     if (record->event.pressed) {
       rgblight_increase_hue();
@@ -1093,8 +1105,6 @@ ISR(TIMER1_COMPA_vect)
 
 }
 
-
-
 #endif // breathing
 
 #else // backlight
@@ -1156,6 +1166,7 @@ void send_nibble(uint8_t number) {
 __attribute__((weak))
 uint16_t hex_to_keycode(uint8_t hex)
 {
+  hex = hex & 0xF;
   if (hex == 0x0) {
     return KC_0;
   } else if (hex < 0xA) {