]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - quantum/quantum.c
adds planck light keyboard
[qmk_firmware.git] / quantum / quantum.c
index 1fccaa7d5a027a125c654399f8dd90720799aeef..09920159660febc52bc758350699941cdc32ad5a 100644 (file)
@@ -235,6 +235,9 @@ bool process_record_quantum(keyrecord_t *record) {
   #ifdef PRINTING_ENABLE
     process_printer(keycode, record) &&
   #endif
+  #ifdef AUTO_SHIFT_ENABLE
+    process_auto_shift(keycode, record) &&
+  #endif
   #ifdef UNICODEMAP_ENABLE
     process_unicode_map(keycode, record) &&
   #endif
@@ -287,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();
@@ -1090,8 +1105,6 @@ ISR(TIMER1_COMPA_vect)
 
 }
 
-
-
 #endif // breathing
 
 #else // backlight
@@ -1153,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) {