]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - quantum/quantum.c
Velocikey: Match RGB animation speed to typing speed (#3754)
[qmk_firmware.git] / quantum / quantum.c
index cb4d5ee806fca27cb8713673e6df5c798013ec0c..46d404029f8bee2bc91672464da5fe39817ef91b 100644 (file)
@@ -47,6 +47,10 @@ extern backlight_config_t backlight_config;
 #include "process_midi.h"
 #endif
 
+#ifdef VELOCIKEY_ENABLE
+#include "velocikey.h"
+#endif
+
 #ifdef HAPTIC_ENABLE
     #include "haptic.h"
 #endif
@@ -251,6 +255,10 @@ bool process_record_quantum(keyrecord_t *record) {
     //   return false;
     // }
 
+  #ifdef VELOCIKEY_ENABLE
+    if (velocikey_enabled() && record->event.pressed) { velocikey_accelerate(); }
+  #endif
+
   #ifdef TAP_DANCE_ENABLE
     preprocess_tap_dance(keycode, record);
   #endif
@@ -568,7 +576,14 @@ bool process_record_quantum(keyrecord_t *record) {
   #endif
     return false;
   #endif // defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
-    #ifdef PROTOCOL_LUFA
+  #ifdef VELOCIKEY_ENABLE
+    case VLK_TOG:
+      if (record->event.pressed) {
+        velocikey_toggle();
+      }
+      return false;
+  #endif
+  #ifdef PROTOCOL_LUFA
     case OUT_AUTO:
       if (record->event.pressed) {
         set_output(OUTPUT_AUTO);