From e0e80c0dc1be961999617a9eb0e1ae0f7988fae9 Mon Sep 17 00:00:00 2001 From: drashna Date: Tue, 10 Oct 2017 10:11:05 -0700 Subject: Cleanup of my keymaps (#1802) * Add woodpad * Cleanup * Remove misc layouts for woodpad * Move woodpad to handwired * Updated RGB Underglow info * Cleanup macros * Fix odd merge issue * Tweaked RGB lighting stuff * Start to merge orthodox/ergodox keymaps (persistant layers) * Add forced NKRO * Added Colemak and Dvorak layers to default orthodox keymap * Added default layer (qwerty/colemak/dvorak) detection to RGB Underglow --- keyboards/orthodox/keymaps/default/keymap.c | 12 +++++ keyboards/orthodox/keymaps/drashna/config.h | 20 ++++++++ keyboards/orthodox/keymaps/drashna/keymap.c | 78 +++++++++++++++++++++++++++++ 3 files changed, 110 insertions(+) (limited to 'keyboards/orthodox/keymaps') diff --git a/keyboards/orthodox/keymaps/default/keymap.c b/keyboards/orthodox/keymaps/default/keymap.c index b061cd7be9..047249c6ba 100644 --- a/keyboards/orthodox/keymaps/default/keymap.c +++ b/keyboards/orthodox/keymaps/default/keymap.c @@ -59,6 +59,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, LOWER, KC_BSPC, KC_ENT, KC_RALT, LS__SPC, RAISE, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LGUI \ ), +[_COLEMAK] = KEYMAP(\ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_UP, XXXXXXX, KC_DOWN, KC_LEFT, XXXXXXX, KC_RIGHT, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLASH, KC_LGUI \ +), + +[_DVORAK] = KEYMAP(\ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_UP, XXXXXXX, KC_DOWN, KC_LEFT, XXXXXXX, KC_RIGHT, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \ + KC_LCTL, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_LGUI \ +), + [_LOWER] = KEYMAP( \ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LCTL, XXXXXXX, _______, _______, XXXXXXX, KC_RCTL, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ diff --git a/keyboards/orthodox/keymaps/drashna/config.h b/keyboards/orthodox/keymaps/drashna/config.h index 9e91753bd5..7cbbf1025a 100644 --- a/keyboards/orthodox/keymaps/drashna/config.h +++ b/keyboards/orthodox/keymaps/drashna/config.h @@ -39,4 +39,24 @@ along with this program. If not, see . #define TAPPING_TERM 200 #endif + +#ifdef RGBLIGHT_ENABLE +#define RGB_DI_PIN D3 +#define RGBLED_NUM 12 // Number of LEDs +#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_HUE_STEP 12 +#define RGBLIGHT_SAT_STEP 12 +#define RGBLIGHT_VAL_STEP 12 +#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 +#define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 +#define RGBLIGHT_EFFECT_BREATHE_CENTER 1 +#endif // RGBLIGHT_ENABLE + +#define FORCE_NKRO +#ifdef FORCE_NKRO +#define NKRO_EPSIZE 32 +#endif + +#define PERMISSIVE_HOLD + #endif \ No newline at end of file diff --git a/keyboards/orthodox/keymaps/drashna/keymap.c b/keyboards/orthodox/keymaps/drashna/keymap.c index 196794076c..f761265279 100644 --- a/keyboards/orthodox/keymaps/drashna/keymap.c +++ b/keyboards/orthodox/keymaps/drashna/keymap.c @@ -49,6 +49,20 @@ enum custom_keycodes { #define _______ KC_TRNS #define XXXXXXX KC_NO +#ifdef RGBLIGHT_ENABLE +//define layer change stuff for underglow indicator +#define rgblight_set_blue rgblight_sethsv (0xFF, 0xFF, 0xFF); +#define rgblight_set_red rgblight_sethsv(0x00, 0xFF, 0xFF); +#define rgblight_set_green rgblight_sethsv (0x78, 0xFF, 0xFF); +#define rgblight_set_orange rgblight_sethsv (0x1E, 0xFF, 0xFF); +#define rgblight_set_teal rgblight_sethsv (0xC3, 0xFF, 0xFF); +#define rgblight_set_magenta rgblight_sethsv (0x12C, 0xFF, 0xFF); +#define rgblight_set_urine rgblight_sethsv (0x3C, 0xFF, 0xFF); + +//This is both for underglow, and Diablo 3 macros +bool has_layer_changed = true; +static uint8_t current_layer = 10; +#endif #ifdef TAP_DANCE_ENABLE enum { @@ -194,4 +208,68 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return true; } +#ifdef RGBLIGHT_ENABLE + + + + +void matrix_scan_user(void) { // runs frequently to update info + uint8_t layer = biton32(layer_state); + + if (layer != current_layer) { + has_layer_changed = true; + current_layer = layer; + } + // Check layer, and apply color if its changed since last check + if (has_layer_changed) { + uint8_t default_layer = 0; + default_layer = eeconfig_read_default_layer(); + + if (default_layer & (1UL << _DVORAK)) { + l_dvorak = true; + } + else if (default_layer & (1UL << _COLEMAK)) { + l_colemak = true; + } + switch (layer) { + case _QWERTY: + if (l_colemak) { + rgblight_set_magenta; + } + else if (l_dvorak) { + rgblight_set_green; + } + else { + rgblight_set_teal; + } + rgblight_mode(1); + break; + case _COLEMAK: + rgblight_set_magenta; + rgblight_mode(1); + break; + case _DVORAK: + rgblight_set_green; + rgblight_mode(1); + break; + case _RAISE: + rgblight_set_blue; + rgblight_mode(2); + break; + case _LOWER: + rgblight_set_orange; + rgblight_mode(3); + break; + case _ADJUST: + rgblight_set_red; + rgblight_mode(17); + break; + case 6: + rgblight_set_urine; + break; + } + has_layer_changed = false; + } + }; +#endif \ No newline at end of file -- cgit v1.2.3