From e88f80a891138d40acddcdd2b3dface8b2a57404 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 7 Sep 2019 08:57:30 -0700 Subject: [Keymap] Big Drashna code update (#6639) * Add a quefrency keymap * New Alt-ernate layouts * Enable Per Key Tapping Term to preserve sanity * Use underglow and mod lights for status on Corne * Update the drashna_ms keymap for quefrency * Disable Audio since there isn't enough space * Update KC_MAKE to ues :flash target * Cleanup ergodox layout * Enable i2c support for Iris * Add keymap support for CG_SWAP * Enable RGB Matrix Shutdown mode * enable heatmap * Update gitlab CI to install python3 * Remove game macros These are no longer needed, and haven't been used in ages * Cleanup planck layout * Add RGB Matrix fun and RGB cleanup * Add keycode and config for RGB Matrix idle animations * Clean up rgb idle animation code * Add rgb idle keycode to keymaps * Fix issues with rgb matrix idle animation * Fix some handling for idle animation * Reduce idle animation timeout to 15s to be more reasonable * fix up rgb stuff * Fix isses with rgb functions not being called for matrix * Use custom EEPROM Magic Number so testing is easier * Extend Default Layer macro to support a lot more layers * Fix bjohnson macropad * Adjust KC_MAKE to process mods for more consistent behavior * Fix up rgb stuff on corne * Corne OLED Overhaul * Fixes a number of issues with weirdness. * Fixes issues with keylogger (should be more reliable now) * Modulaize the OLED render sections * Rewrite layer display code * Update URL for Font Editor Due to odd issues, I ended up rewriting from scratch. And using PROGMEM versions, since I think I was getting memory overflows. * Update polling rate on all keebs * Fix planck ez layout config * Remove macros from Viterbi --- layouts/community/ergodox/drashna/config.h | 2 ++ layouts/community/ergodox/drashna/keymap.c | 21 ++++++++++--- layouts/community/ergodox/drashna/rules.mk | 1 - layouts/community/numpad_5x6/bjohnson/config.h | 2 +- layouts/community/numpad_5x6/bjohnson/keymap.c | 7 +++-- layouts/community/numpad_5x6/drashna/rules.mk | 1 - layouts/community/ortho_4x12/drashna/config.h | 1 + layouts/community/ortho_4x12/drashna/keymap.c | 42 ++++++++++++++++++-------- layouts/community/ortho_4x12/drashna/rules.mk | 3 -- layouts/community/ortho_5x12/drashna/keymap.c | 7 +++-- layouts/community/ortho_5x12/drashna/rules.mk | 3 -- 11 files changed, 57 insertions(+), 33 deletions(-) (limited to 'layouts') diff --git a/layouts/community/ergodox/drashna/config.h b/layouts/community/ergodox/drashna/config.h index 821710ed8e..0ccf10c31c 100644 --- a/layouts/community/ergodox/drashna/config.h +++ b/layouts/community/ergodox/drashna/config.h @@ -14,3 +14,5 @@ #undef DEBOUNCE #define DEBOUNCE 15 + +#define TAPPING_TERM_PER_KEY diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index 763b218f74..6ed4558e27 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c @@ -23,8 +23,9 @@ along with this program. If not, see . #ifndef UNICODE_ENABLE # define UC(x) KC_NO #endif - -extern userspace_config_t userspace_config; +#ifdef RGBLIGHT_ENABLE +extern rgblight_config_t rgblight_config; +#endif enum more_custom_keycodes { KC_SWAP_NUM = NEW_SAFE_RANGE }; @@ -40,7 +41,7 @@ bool skip_leds = false; LAYOUT_ergodox_pretty_wrapper( \ KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, \ KC_TAB, K01, K02, K03, K04, K05, TG(_DIABLO), TG(_DIABLO), K06, K07, K08, K09, K0A, KC_BSLS, \ - KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ + KC_C1R3, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, RCTL_T(K2A), KC_MRSF, \ KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC(0x2E2E), \ OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \ @@ -291,8 +292,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJUST] = LAYOUT_ergodox_pretty_wrapper( KC_MAKE, _______, _______, _______, _______, _______, _______, KC_NUKE, _________________ADJUST_R1_________________, KC_RST, VRSN, _________________ADJUST_L1_________________, _______, _______, _______, _______, _______, _______, _______, EEP_RST, - _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, TG(_MODS), - _______, _________________ADJUST_L3_________________, _______, _______, _________________ADJUST_R3_________________, KC_MPLY, + _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, RGB_IDL, + _______, _________________ADJUST_L3_________________, _______, _______, _________________ADJUST_R3_________________, TG(_MODS), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -464,3 +465,13 @@ void rgb_matrix_indicators_user(void) { } #endif // RGB_MATRIX_INIT + + +uint16_t get_tapping_term(uint16_t keycode) { + if (keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) { + if (mod_config(keycode & 0xf) & MOD_MASK_ALT) { + return (2 * TAPPING_TERM); + } + } + return TAPPING_TERM; +} diff --git a/layouts/community/ergodox/drashna/rules.mk b/layouts/community/ergodox/drashna/rules.mk index f3cd55ea8f..f14353f4c6 100644 --- a/layouts/community/ergodox/drashna/rules.mk +++ b/layouts/community/ergodox/drashna/rules.mk @@ -12,7 +12,6 @@ BOOTMAGIC_ENABLE = yes UNICODE_ENABLE = yes UNICDOEMAP_ENABLE = no -MACROS_ENABLED = no RGBLIGHT_TWINKLE = no INDICATOR_LIGHTS = no RGBLIGHT_STARTUP_ANIMATION = yes diff --git a/layouts/community/numpad_5x6/bjohnson/config.h b/layouts/community/numpad_5x6/bjohnson/config.h index fe2cffec78..668450d88d 100644 --- a/layouts/community/numpad_5x6/bjohnson/config.h +++ b/layouts/community/numpad_5x6/bjohnson/config.h @@ -4,7 +4,7 @@ #if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) #define RGB_DI_PIN B7 -#define RGBLED_NUM 16 // Number of LEDs +#define RGBLED_NUM 13 // Number of LEDs #define RGBLIGHT_ANIMATIONS #define RGBLIGHT_HUE_STEP 12 diff --git a/layouts/community/numpad_5x6/bjohnson/keymap.c b/layouts/community/numpad_5x6/bjohnson/keymap.c index 79e87e69f4..4b15ccdfb9 100644 --- a/layouts/community/numpad_5x6/bjohnson/keymap.c +++ b/layouts/community/numpad_5x6/bjohnson/keymap.c @@ -25,9 +25,10 @@ void keyboard_post_init_user(void) { uint8_t temp_mode = rgblight_config.mode; rgblight_enable_noeeprom(); rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); - for (uint16_t i = 360; i > 0; i--) { - rgblight_sethsv_noeeprom( ( i + 180) % 360, 255, 255); - wait_ms(8); + for (uint16_t i = 255; i > 0; i--) { + rgblight_sethsv_noeeprom( ( i + 128) % 255, 255, 255); + matrix_scan(); + wait_ms(10); } led_set_user(host_keyboard_leds()); rgblight_mode_noeeprom(temp_mode); diff --git a/layouts/community/numpad_5x6/drashna/rules.mk b/layouts/community/numpad_5x6/drashna/rules.mk index 62bbc365d1..0bdf97bae5 100644 --- a/layouts/community/numpad_5x6/drashna/rules.mk +++ b/layouts/community/numpad_5x6/drashna/rules.mk @@ -5,6 +5,5 @@ NO_SECRETS = yes BOOTMAGIC_ENABLE = lite INDICATOR_LIGHTS = no RGBLIGHT_TWINKLE = yes -MACROS_ENABLED = no MAKE_BOOTLOADER = yes RGBLIGHT_STARTUP_ANIMATION = yes diff --git a/layouts/community/ortho_4x12/drashna/config.h b/layouts/community/ortho_4x12/drashna/config.h index 30db12965d..9f3d2b82d6 100644 --- a/layouts/community/ortho_4x12/drashna/config.h +++ b/layouts/community/ortho_4x12/drashna/config.h @@ -17,6 +17,7 @@ #ifdef RGB_MATRIX_ENABLE # define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) // #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) +# define RGB_MATRIX_FRAMEBUFFER_EFFECTS // #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects // #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 # define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c index 3e26b93fcd..26f611c088 100644 --- a/layouts/community/ortho_4x12/drashna/keymap.c +++ b/layouts/community/ortho_4x12/drashna/keymap.c @@ -27,6 +27,9 @@ enum planck_keycodes { }; #else # define BACKLIT OSM(MOD_LSFT) +enum planck_keycodes { + TH_LVL = NEW_SAFE_RANGE, +}; #endif #ifdef KEYBOARD_planck_ez @@ -48,8 +51,8 @@ enum planck_keycodes { K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ ) \ LAYOUT_ortho_4x12_wrapper( \ - KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ - KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ + KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_DEL, \ + KC_TAB, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ KC_MLSF, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), KC_ENT, \ BACKLIT, OS_LCTL, OS_LALT, OS_LGUI, PLNK_1, PLNK_2, PLNK_3, PLNK_4, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ) @@ -117,7 +120,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TILD, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_BSPC, KC_DEL, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE, _______, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), [_RAISE] = LAYOUT_ortho_4x12_wrapper( @@ -130,8 +133,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJUST] = LAYOUT_ortho_4x12_wrapper( KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RST, VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST, - _______, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, TG_MODS, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_NUKE + TH_LVL, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, RGB_IDL, + _______, _______, _______, _______, _______, KC_NUKE, _______, _______, _______, _______, _______, TG_MODS ) }; @@ -149,7 +152,20 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { } else { unregister_code(KC_RSFT); } - return false; + break; +#endif +#ifdef KEYBOARD_planck_ez + case TH_LVL: + if (record->event.pressed) { + keyboard_config.led_level++; + if (keyboard_config.led_level > 4) { + keyboard_config.led_level = 0; + } + planck_ez_right_led_level((uint8_t)keyboard_config.led_level * 255 / 4 ); + planck_ez_left_led_level((uint8_t)keyboard_config.led_level * 255 / 4 ); + eeconfig_update_kb(keyboard_config.raw); + layer_state_set_kb(layer_state); + } break; #endif } @@ -265,7 +281,7 @@ void rgb_matrix_indicators_user(void) { break; } if ((this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1 << USB_LED_CAPS_LOCK)) { - rgb_matrix_set_color(24, 0x00, 0xFF, 0x00); + if (!layer_state_cmp(layer_state, _ADJUST)) { rgb_matrix_set_color(24, 0x00, 0xFF, 0x00); } rgb_matrix_set_color(36, 0x00, 0xFF, 0x00); } if ((this_mod | this_osm) & MOD_MASK_CTRL) { @@ -353,18 +369,18 @@ void dip_update(uint8_t index, bool active) { #ifdef KEYBOARD_planck_ez layer_state_t layer_state_set_keymap(layer_state_t state) { - palClearPad(GPIOB, 8); - palClearPad(GPIOB, 9); + planck_ez_left_led_off(); + planck_ez_right_led_off(); switch (biton32(state)) { case _LOWER: - palSetPad(GPIOB, 9); + planck_ez_left_led_on(); break; case _RAISE: - palSetPad(GPIOB, 8); + planck_ez_right_led_on(); break; case _ADJUST: - palSetPad(GPIOB, 9); - palSetPad(GPIOB, 8); + planck_ez_right_led_on(); + planck_ez_left_led_on(); break; default: break; diff --git a/layouts/community/ortho_4x12/drashna/rules.mk b/layouts/community/ortho_4x12/drashna/rules.mk index 21ce7ebb1c..55f3acd70e 100644 --- a/layouts/community/ortho_4x12/drashna/rules.mk +++ b/layouts/community/ortho_4x12/drashna/rules.mk @@ -33,6 +33,3 @@ NKRO_ENABLE = no else NKRO_ENABLE = yes endif - - -MACROS_ENABLED = no diff --git a/layouts/community/ortho_5x12/drashna/keymap.c b/layouts/community/ortho_5x12/drashna/keymap.c index 26be99af5c..86a78336c8 100644 --- a/layouts/community/ortho_5x12/drashna/keymap.c +++ b/layouts/community/ortho_5x12/drashna/keymap.c @@ -29,10 +29,11 @@ LAYOUT_ortho_5x12_wrapper( \ KC_GRV, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_BSPC, \ - KC_ESC, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, KC_QUOT, \ - KC_MLSF, CTL_T(K31), K32, K33, K34, K35, K36, K37, K38, K39, CTL_T(K3A), KC_ENT, \ + KC_ESC, ALT_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, K2A, RALT_T(KC_QUOT), \ + KC_MLSF, CTL_T(K31), K32, K33, K34, K35, K36, K37, K38, K39, RCTL_T(K3A), KC_ENT, \ KC_NO, OS_LCTL, OS_LALT, OS_LGUI, SP_LWER, BK_LWER, DL_RAIS, ET_RAIS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ) + #define LAYOUT_ortho_5x12_base_wrapper(...) LAYOUT_ortho_5x12_base(__VA_ARGS__) @@ -132,7 +133,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJUST] = LAYOUT_ortho_5x12_wrapper( \ KC_MAKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RST, VRSN, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, EEP_RST, - _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, _______, + _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, RGB_IDL, _______, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, TG_MODS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) diff --git a/layouts/community/ortho_5x12/drashna/rules.mk b/layouts/community/ortho_5x12/drashna/rules.mk index ee7c2ad63c..0606f3e522 100644 --- a/layouts/community/ortho_5x12/drashna/rules.mk +++ b/layouts/community/ortho_5x12/drashna/rules.mk @@ -18,6 +18,3 @@ NKRO_ENABLE = no else NKRO_ENABLE = yes endif - - -MACROS_ENABLED = no -- cgit v1.2.3