]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - keyboards/planck/keymaps/jetpacktuxedo/keymap.c
Keymap: Clicky frequency modulation (#4012)
[qmk_firmware.git] / keyboards / planck / keymaps / jetpacktuxedo / keymap.c
index 2994c0c077498e7686785ff7eddeb391a193ea6c..b344bd0767af7f0055981aed78d583f1e412e806 100644 (file)
@@ -188,8 +188,24 @@ uint16_t muse_counter = 0;
 uint8_t muse_offset = 70;
 uint16_t muse_tempo = 20;
 
+extern float clicky_rand;
+
 void encoder_update(bool clockwise) {
-  if (muse_mode) {
+  if (is_clicky_on()) {
+    if (IS_LAYER_ON(_RAISE)) {
+      if (clockwise) {
+        clicky_rand += 0.5f;
+      } else {
+        clicky_rand -= 0.5f;
+      }
+    } else {
+      if (clockwise) {
+        clicky_freq_up();
+      } else {
+        clicky_freq_down();
+      }
+    }
+  } else if (muse_mode) {
     if (IS_LAYER_ON(_RAISE)) {
       if (clockwise) {
         muse_offset++;
@@ -248,6 +264,13 @@ void dip_update(uint8_t index, bool active) {
           stop_all_notes();
         #endif
       }
+      break;
+    case 3:
+      if (active) {
+        clicky_on();
+      } else {
+        clicky_off();
+      }
    }
 }