From ccaacde4d663f50b04fcd67d1477db7e0bd46091 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 17 Jan 2018 11:28:23 -0800 Subject: Update to drashna keymaps (#2281) * Move faux clicky into userspace * Get Audio and RGB enabled on Orthodox-rev1 * Add faux click to userspace * Add Orthodox Rev3 check to macros * Hack Orthodox Name for drashna keymap * No more One Shots * Ergodox product name hack * Enable Audio on Orthodox by default --- users/drashna/drashna.c | 35 ++++++++++++++++++++++++++++------- users/drashna/drashna.h | 9 +++++++++ 2 files changed, 37 insertions(+), 7 deletions(-) (limited to 'users/drashna') diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 2ac0257b5..a07d74407 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -30,6 +30,15 @@ PROGMEM const char secret[][64] = { }; #endif +#ifdef FAUXCLICKY_ENABLE +float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_A6, 2); // (_D4, 0.25); +float fauxclicky_released_note[2] = MUSICAL_NOTE(_A6, 2); // (_C4, 0.125); +#else +float fauxclicky_pressed[][2] = SONG(E__NOTE(_A6)); // change to your tastes +float fauxclicky_released[][2] = SONG(E__NOTE(_A6)); // change to your tastes +#endif +bool faux_click_enabled = true; + #ifdef TAP_DANCE_ENABLE //define diablo macro timer variables static uint16_t diablo_timer[4]; @@ -222,11 +231,22 @@ void persistent_default_layer_set(uint16_t default_layer) { // Defines actions tor my global custom keycodes. Defined in drashna.h file // Then runs the _keymap's recod handier if not processed here bool process_record_user(uint16_t keycode, keyrecord_t *record) { - + #ifdef CONSOLE_ENABLE xprintf("KL: row: %u, column: %u, pressed: %u\n", record->event.key.col, record->event.key.row, record->event.pressed); #endif +#ifdef AUDIO_ENABLE + if (faux_click_enabled) { + if (record->event.pressed) { + PLAY_SONG(fauxclicky_pressed); + } else { + stop_note(NOTE_A6); + PLAY_SONG(fauxclicky_released); + } + } +#endif + switch (keycode) { case KC_QWERTY: if (record->event.pressed) { @@ -295,7 +315,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; -#if !(defined(KEYBOARD_orthodox_rev1) || defined(KEYBOARD_ergodox_ez)) +#if !(defined(KEYBOARD_orthodox_rev1) || defined(KEYBOARD_orthodox_rev3) || defined(KEYBOARD_ergodox_ez)) case KC_OVERWATCH: if (record->event.pressed) { is_overwatch = !is_overwatch; @@ -460,11 +480,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { " AUDIO_ENABLE=yes" #else " AUDIO_ENABLE=no" -#endif -#ifdef FAUXCLICKY_ENABLE - " FAUXCLICKY_ENABLE=yes" -#else - " FAUXCLICKY_ENABLE=no" #endif SS_TAP(X_ENTER)); } @@ -499,6 +514,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; + case KC_FXCL: + if (!record->event.pressed) { + faux_click_enabled = !faux_click_enabled; + } + return false; + break; case KC_RGB_T: // Because I want the option to go back to normal RGB mode rather than always layer indication #ifdef RGBLIGHT_ENABLE if (record->event.pressed) { diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index 2475c99d4..aa9c83086 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -101,6 +101,7 @@ enum userspace_custom_keycodes { KC_SECRET_3, KC_SECRET_4, KC_SECRET_5, + KC_FXCL, NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes }; @@ -133,4 +134,12 @@ enum { #define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) +#ifdef FAUXCLICKY_ENABLE +#define AUD_ON FC_ON +#define AUD_OFF FC_OFF +#else +#define AUD_ON AU_ON +#define AUD_OFF AU_OFF +#endif + #endif -- cgit v1.2.3-24-g4f1b