aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEthan Madden <crazeh.monkeh@gmail.com>2018-09-28 12:44:15 -0700
committerDrashna Jaelre <drashna@live.com>2018-09-28 12:44:15 -0700
commitcb468e030712731cffb288cb6d8433cf3b953491 (patch)
treed3b1964fa598128da6af8ae0f25f077caea98a17
parentf1b2d46eafbec2b834dc4bcb5ba2dac9f913eed8 (diff)
downloadqmk_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.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/keyboards/planck/keymaps/jetpacktuxedo/keymap.c b/keyboards/planck/keymaps/jetpacktuxedo/keymap.c
index 132405686..b344bd076 100644
--- a/keyboards/planck/keymaps/jetpacktuxedo/keymap.c
+++ b/keyboards/planck/keymaps/jetpacktuxedo/keymap.c
@@ -188,15 +188,24 @@ uint16_t muse_counter = 0;
188uint8_t muse_offset = 70; 188uint8_t muse_offset = 70;
189uint16_t muse_tempo = 20; 189uint16_t muse_tempo = 20;
190 190
191extern float clicky_rand;
192
191void encoder_update(bool clockwise) { 193void encoder_update(bool clockwise) {
192 if (is_clicky_on()) { 194 if (is_clicky_on()) {
193 if (clockwise) { 195 if (IS_LAYER_ON(_RAISE)) {
194 clicky_freq_up(); 196 if (clockwise) {
197 clicky_rand += 0.5f;
198 } else {
199 clicky_rand -= 0.5f;
200 }
195 } else { 201 } else {
196 clicky_freq_down(); 202 if (clockwise) {
203 clicky_freq_up();
204 } else {
205 clicky_freq_down();
206 }
197 } 207 }
198 } else 208 } else if (muse_mode) {
199 if (muse_mode) {
200 if (IS_LAYER_ON(_RAISE)) { 209 if (IS_LAYER_ON(_RAISE)) {
201 if (clockwise) { 210 if (clockwise) {
202 muse_offset++; 211 muse_offset++;
@@ -255,7 +264,8 @@ void dip_update(uint8_t index, bool active) {
255 stop_all_notes(); 264 stop_all_notes();
256 #endif 265 #endif
257 } 266 }
258 case 2: 267 break;
268 case 3:
259 if (active) { 269 if (active) {
260 clicky_on(); 270 clicky_on();
261 } else { 271 } else {