diff options
author | Ethan Madden <crazeh.monkeh@gmail.com> | 2018-09-28 12:44:15 -0700 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2018-09-28 12:44:15 -0700 |
commit | cb468e030712731cffb288cb6d8433cf3b953491 (patch) | |
tree | d3b1964fa598128da6af8ae0f25f077caea98a17 | |
parent | f1b2d46eafbec2b834dc4bcb5ba2dac9f913eed8 (diff) | |
download | qmk_firmware-cb468e030712731cffb288cb6d8433cf3b953491.tar.gz qmk_firmware-cb468e030712731cffb288cb6d8433cf3b953491.zip |
Keymap: Clicky frequency modulation (#4012)
Also worked around my busted dipswitch 2...
-rw-r--r-- | keyboards/planck/keymaps/jetpacktuxedo/keymap.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/keyboards/planck/keymaps/jetpacktuxedo/keymap.c b/keyboards/planck/keymaps/jetpacktuxedo/keymap.c index 1324056862..b344bd0767 100644 --- a/keyboards/planck/keymaps/jetpacktuxedo/keymap.c +++ b/keyboards/planck/keymaps/jetpacktuxedo/keymap.c @@ -188,15 +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 (is_clicky_on()) { - if (clockwise) { - clicky_freq_up(); + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + clicky_rand += 0.5f; + } else { + clicky_rand -= 0.5f; + } } else { - clicky_freq_down(); + if (clockwise) { + clicky_freq_up(); + } else { + clicky_freq_down(); + } } - } else - if (muse_mode) { + } else if (muse_mode) { if (IS_LAYER_ON(_RAISE)) { if (clockwise) { muse_offset++; @@ -255,7 +264,8 @@ void dip_update(uint8_t index, bool active) { stop_all_notes(); #endif } - case 2: + break; + case 3: if (active) { clicky_on(); } else { |