From 357a888d805c21c9cb4917f55d558195e8b85db5 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 15 Jun 2020 03:41:28 -0700 Subject: [Keymap] Drashna's Keymap Update - Display Edition (#9282) OLED Display fixes Add support for RGBLIGHT Layers Add gaming layer to corn and kyria RGBLight Startup Animation fixes and improvements (uses matrix_scan now!) Pimoroni Trackball support added (IT'S RGB!!!) Fix issues due to code changes --- keyboards/crkbd/keymaps/drashna/keymap.c | 12 +++++++- keyboards/kyria/keymaps/drashna/config.h | 1 + keyboards/kyria/keymaps/drashna/keymap.c | 48 +++++++++++++++++++++++++++++++- keyboards/kyria/keymaps/drashna/rules.mk | 6 ++-- 4 files changed, 62 insertions(+), 5 deletions(-) (limited to 'keyboards') diff --git a/keyboards/crkbd/keymaps/drashna/keymap.c b/keyboards/crkbd/keymaps/drashna/keymap.c index 0769edf3b9..d9c1605ce9 100644 --- a/keyboards/crkbd/keymaps/drashna/keymap.c +++ b/keyboards/crkbd/keymaps/drashna/keymap.c @@ -121,7 +121,17 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { } #ifdef OLED_DRIVER_ENABLE -oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_270; } +oled_rotation_t oled_init_user(oled_rotation_t rotation) { +# ifndef SPLIT_KEYBOARD + if (is_master) { +# endif + return OLED_ROTATION_270; +# ifndef SPLIT_KEYBOARD + } else { + return rotation; + } +# endif +} #endif uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { diff --git a/keyboards/kyria/keymaps/drashna/config.h b/keyboards/kyria/keymaps/drashna/config.h index f93069ac00..5e9d8b010e 100644 --- a/keyboards/kyria/keymaps/drashna/config.h +++ b/keyboards/kyria/keymaps/drashna/config.h @@ -32,6 +32,7 @@ # define RGBLIGHT_SAT_STEP 8 # define RGBLIGHT_VAL_STEP 8 # define RGBLIGHT_SPLIT +# define RGBLIGHT_LAYERS #endif // If you are using an Elite C rev3 on the slave side, uncomment the lines below: diff --git a/keyboards/kyria/keymaps/drashna/keymap.c b/keyboards/kyria/keymaps/drashna/keymap.c index 5e97ca55ad..98afff19f9 100644 --- a/keyboards/kyria/keymaps/drashna/keymap.c +++ b/keyboards/kyria/keymaps/drashna/keymap.c @@ -23,7 +23,7 @@ uint8_t is_master; LAYOUT_wrapper( \ KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \ LALT_T(KC_TAB), K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(KC_QUOT), \ - OS_LSFT, CTL_T(K21), K22, K23, K24, K25, KC_NO, MEH(KC_MINS), TG(_DIABLO), KC_NO, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ + OS_LSFT, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), MEH(KC_MINS), TG(_DIABLO), KC_CAPS, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \ KC_MUTE, OS_LALT, KC_GRV, KC_SPC, BK_LWER, DL_RAIS, KC_ENT, OS_RGUI, UC(0x03A8), UC(0x2E2E) \ ) /* Re-pass though to allow templates to be used */ @@ -85,6 +85,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, ___________________BLANK___________________, _______, _______, _______, _______, ___________________BLANK___________________, KC_RSFT, _______, _______, KC_LALT, _______, _______, _______, _______, KC_RGUI, _______, _______ ), + + [_GAMEPAD] = LAYOUT_wrapper( + KC_ESC, KC_K, KC_Q, KC_W, KC_E, KC_R, _______, _______, _______, _______, _______, _______, + KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, _______, _______, _______, _______, _______, _______, + KC_LCTL, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, _______, _______, _______, LALT(KC_PSCR), _______, _______, _______, _______, _______, _______, + _______, MAGIC_TOGGLE_NKRO, KC_V, KC_SPC, KC_H, _______, _______, _______, _______, _______ + ), + [_DIABLO] = LAYOUT_wrapper( KC_ESC, KC_S, KC_I, KC_F, KC_M, KC_T, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_G, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, @@ -172,3 +180,41 @@ void encoder_update_user(uint8_t index, bool clockwise) { } } #endif + +#ifdef RGBLIGHT_LAYERS +const rgblight_segment_t PROGMEM shift_layers[] = RGBLIGHT_LAYER_SEGMENTS( + { 8, 1, 120, 255, 255}, + { 18, 1, 120, 255, 255} +); +const rgblight_segment_t PROGMEM control_layers[] = RGBLIGHT_LAYER_SEGMENTS( + { 6, 1, 0, 255, 255}, + { 16, 1, 0, 255, 255} +); +const rgblight_segment_t PROGMEM alt_layers[] = RGBLIGHT_LAYER_SEGMENTS( + { 2, 1, 240, 255, 255}, + { 17, 1, 250, 255, 255} +); +const rgblight_segment_t PROGMEM gui_layers[] = RGBLIGHT_LAYER_SEGMENTS( + { 7, 1, 51, 255, 255}, + { 12, 1, 51, 255, 255} +); + +const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST( + shift_layers, + control_layers, + alt_layers, + gui_layers +); + +void keyboard_post_init_keymap(void) { + rgblight_layers = my_rgb_layers; +} + +void matrix_scan_keymap(void) { + uint8_t mods = mod_config(get_mods()|get_oneshot_mods()); + rgblight_set_layer_state(0, mods & MOD_MASK_SHIFT); + rgblight_set_layer_state(1, mods & MOD_MASK_CTRL); + rgblight_set_layer_state(2, mods & MOD_MASK_ALT); + rgblight_set_layer_state(3, mods & MOD_MASK_GUI); +} +#endif diff --git a/keyboards/kyria/keymaps/drashna/rules.mk b/keyboards/kyria/keymaps/drashna/rules.mk index 2486ecd5d5..0604c84bdd 100644 --- a/keyboards/kyria/keymaps/drashna/rules.mk +++ b/keyboards/kyria/keymaps/drashna/rules.mk @@ -1,17 +1,17 @@ OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays ENCODER_ENABLE = yes # ENables the use of one or more encoders RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow -RGBLIGHT_STARTUP_ANIMATION = no +RGBLIGHT_STARTUP_ANIMATION = yes BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration -MOUSEKEY_ENABLE = no # Mouse keys +MOUSEKEY_ENABLE = no # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = no # USB Nkey Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default MIDI_ENABLE = no # MIDI support -UNICODE_ENABLE = yes # Unicode +UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID AUDIO_ENABLE = no # Audio output on port C6 FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches -- cgit v1.2.3