diff options
author | William Chang <william@factual.com> | 2019-05-09 21:16:06 -0700 |
---|---|---|
committer | William Chang <william@factual.com> | 2019-05-09 21:16:06 -0700 |
commit | 4b2d3288d013b1a71ea25402224c4a8225a099e9 (patch) | |
tree | b7f5dded777a950e63c4dd967260744336bfaa6b /keyboards/massdrop/ctrl | |
parent | 57a6ea11df685d84a1ea07953e88f224ce2b24f7 (diff) | |
parent | bce391a663d2848bff8ffffca0e4bad771bd3890 (diff) |
resolved conflicts
Diffstat (limited to 'keyboards/massdrop/ctrl')
-rw-r--r-- | keyboards/massdrop/ctrl/config.h | 1 | ||||
-rw-r--r-- | keyboards/massdrop/ctrl/config_led.c | 180 | ||||
-rw-r--r-- | keyboards/massdrop/ctrl/keymaps/default/keymap.c | 26 | ||||
-rw-r--r-- | keyboards/massdrop/ctrl/keymaps/mac/keymap.c | 26 | ||||
-rw-r--r-- | keyboards/massdrop/ctrl/keymaps/matthewrobo/config.h | 52 | ||||
-rw-r--r-- | keyboards/massdrop/ctrl/keymaps/matthewrobo/keymap.c | 405 | ||||
-rw-r--r-- | keyboards/massdrop/ctrl/keymaps/matthewrobo/rules.mk | 2 |
7 files changed, 570 insertions, 122 deletions
diff --git a/keyboards/massdrop/ctrl/config.h b/keyboards/massdrop/ctrl/config.h index df2e509216..9b9f98f5fe 100644 --- a/keyboards/massdrop/ctrl/config.h +++ b/keyboards/massdrop/ctrl/config.h @@ -123,6 +123,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define RGB_MATRIX_KEYPRESSES #define RGB_MATRIX_LED_PROCESS_LIMIT 15 #define RGB_MATRIX_LED_FLUSH_LIMIT 10 -#define RGB_MATRIX_EXTRA_TOG #include "config_led.h" diff --git a/keyboards/massdrop/ctrl/config_led.c b/keyboards/massdrop/ctrl/config_led.c index afdbf3a222..5f1c452071 100644 --- a/keyboards/massdrop/ctrl/config_led.c +++ b/keyboards/massdrop/ctrl/config_led.c @@ -5,134 +5,72 @@ #include "rgb_matrix.h" #include "config_led.h" -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +led_config_t g_led_config = { { + { 0, 1, 2, 3, 4, 5, 6, 7 }, + { 16, 17, 18, 19, 20, 21, 22, 23 }, + { 33, 34, 35, 36, 37, 38, 39, 40 }, + { 50, 51, 52, 53, 54, 55, 56, 57 }, + { 63, 64, 65, 66, 67, 68, 69, 70 }, + { 76, 77, 78, 79, 80, 81, 82, 83 }, + { 8, 9, 10, 11, 12, 13, 14, 15 }, + { 24, 25, 26, 27, 28, 29, 30, 31 }, + { 41, 42, 43, 44, 45, 46, 47, 48 }, + { 58, 59, 60, 61, 62, 75, 49, 32 }, + { 71, 72, 73, 74, 84, 85, 86, NO_LED } +}, { // KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS - { { 0|(0<<4) }, { 7, 5 }, 0 }, - { { 0|(1<<4) }, { 31, 5 }, 0 }, - { { 0|(2<<4) }, { 43, 5 }, 0 }, - { { 0|(3<<4) }, { 55, 5 }, 0 }, - { { 0|(4<<4) }, { 67, 5 }, 0 }, - { { 0|(5<<4) }, { 85, 5 }, 0 }, - { { 0|(6<<4) }, { 97, 5 }, 0 }, - { { 0|(7<<4) }, { 109, 5 }, 0 }, - { { 6|(0<<4) }, { 121, 5 }, 0 }, - { { 6|(1<<4) }, { 139, 5 }, 0 }, - { { 6|(2<<4) }, { 151, 5 }, 0 }, - { { 6|(3<<4) }, { 163, 5 }, 0 }, - { { 6|(4<<4) }, { 175, 5 }, 0 }, - { { 6|(5<<4) }, { 193, 5 }, 0 }, - { { 6|(6<<4) }, { 205, 5 }, 1 }, - { { 6|(7<<4) }, { 217, 5 }, 0 }, + { 7, 5 }, { 31, 5 }, { 43, 5 }, { 55, 5 }, { 67, 5 }, { 85, 5 }, { 97, 5 }, { 109, 5 }, + { 121, 5 }, { 139, 5 }, { 151, 5 }, { 163, 5 }, { 175, 5 }, { 193, 5 }, { 205, 5 }, { 217, 5 }, // KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP - { { 1|(0<<4) }, { 7, 20 }, 0 }, - { { 1|(1<<4) }, { 19, 20 }, 0 }, - { { 1|(2<<4) }, { 31, 20 }, 0 }, - { { 1|(3<<4) }, { 43, 20 }, 0 }, - { { 1|(4<<4) }, { 55, 20 }, 0 }, - { { 1|(5<<4) }, { 67, 20 }, 0 }, - { { 1|(6<<4) }, { 79, 20 }, 0 }, - { { 1|(7<<4) }, { 91, 20 }, 0 }, - { { 7|(0<<4) }, { 103, 20 }, 0 }, - { { 7|(1<<4) }, { 115, 20 }, 0 }, - { { 7|(2<<4) }, { 127, 20 }, 0 }, - { { 7|(3<<4) }, { 139, 20 }, 0 }, - { { 7|(4<<4) }, { 151, 20 }, 0 }, - { { 7|(5<<4) }, { 169, 20 }, 0 }, - { { 7|(6<<4) }, { 193, 20 }, 0 }, - { { 7|(7<<4) }, { 205, 20 }, 0 }, - { { 9|(7<<4) }, { 217, 20 }, 0 }, + { 7, 20 }, { 19, 20 }, { 31, 20 }, { 43, 20 }, { 55, 20 }, { 67, 20 }, { 79, 20 }, { 91, 20 }, + { 103, 20 }, { 115, 20 }, { 127, 20 }, { 139, 20 }, { 151, 20 }, { 169, 20 }, { 193, 20 }, { 205, 20 }, + { 217, 20 }, // KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN - { { 2|(0<<4) }, { 10, 30 }, 0 }, - { { 2|(1<<4) }, { 25, 30 }, 0 }, - { { 2|(2<<4) }, { 37, 30 }, 0 }, - { { 2|(3<<4) }, { 49, 30 }, 0 }, - { { 2|(4<<4) }, { 61, 30 }, 0 }, - { { 2|(5<<4) }, { 73, 30 }, 0 }, - { { 2|(6<<4) }, { 85, 30 }, 0 }, - { { 2|(7<<4) }, { 97, 30 }, 0 }, - { { 8|(0<<4) }, { 109, 30 }, 0 }, - { { 8|(1<<4) }, { 121, 30 }, 0 }, - { { 8|(2<<4) }, { 133, 30 }, 0 }, - { { 8|(3<<4) }, { 145, 30 }, 0 }, - { { 8|(4<<4) }, { 157, 30 }, 0 }, - { { 8|(5<<4) }, { 172, 30 }, 0 }, - { { 8|(6<<4) }, { 193, 30 }, 0 }, - { { 8|(7<<4) }, { 205, 30 }, 0 }, - { { 9|(6<<4) }, { 217, 30 }, 0 }, + { 10, 30 }, { 25, 30 }, { 37, 30 }, { 49, 30 }, { 61, 30 }, { 73, 30 }, { 85, 30 }, { 97, 30 }, + { 109, 30 }, { 121, 30 }, { 133, 30 }, { 145, 30 }, { 157, 30 }, { 172, 30 }, { 193, 30 }, { 205, 30 }, + { 217, 30 }, // KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT - { { 3|(0<<4) }, { 11, 39 }, 1 }, - { { 3|(1<<4) }, { 28, 39 }, 0 }, - { { 3|(2<<4) }, { 40, 39 }, 0 }, - { { 3|(3<<4) }, { 52, 39 }, 0 }, - { { 3|(4<<4) }, { 64, 39 }, 0 }, - { { 3|(5<<4) }, { 76, 39 }, 0 }, - { { 3|(6<<4) }, { 88, 39 }, 0 }, - { { 3|(7<<4) }, { 100, 39 }, 0 }, - { { 9|(0<<4) }, { 112, 39 }, 0 }, - { { 9|(1<<4) }, { 124, 39 }, 0 }, - { { 9|(2<<4) }, { 136, 39 }, 0 }, - { { 9|(3<<4) }, { 148, 39 }, 0 }, - { { 9|(4<<4) }, { 168, 39 }, 0 }, + { 11, 39 }, { 28, 39 }, { 40, 39 }, { 52, 39 }, { 64, 39 }, { 76, 39 }, { 88, 39 }, { 100, 39 }, + { 112, 39 }, { 124, 39 }, { 136, 39 }, { 148, 39 }, { 168, 39 }, // KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP - { { 4|(0<<4) }, { 14, 49 }, 0 }, - { { 4|(1<<4) }, { 34, 49 }, 0 }, - { { 4|(2<<4) }, { 46, 49 }, 0 }, - { { 4|(3<<4) }, { 58, 49 }, 0 }, - { { 4|(4<<4) }, { 70, 49 }, 0 }, - { { 4|(5<<4) }, { 82, 49 }, 0 }, - { { 4|(6<<4) }, { 94, 49 }, 0 }, - { { 4|(7<<4) }, { 106, 49 }, 0 }, - { { 10|(0<<4) }, { 118, 49 }, 0 }, - { { 10|(1<<4) }, { 130, 49 }, 0 }, - { { 10|(2<<4) }, { 142, 49 }, 0 }, - { { 10|(3<<4) }, { 165, 49 }, 0 }, - { { 9|(5<<4) }, { 205, 49 }, 0 }, + { 14, 49 }, { 34, 49 }, { 46, 49 }, { 58, 49 }, { 70, 49 }, { 82, 49 }, { 94, 49 }, { 106, 49 }, + { 118, 49 }, { 130, 49 }, { 142, 49 }, { 165, 49 }, { 205, 49 }, // KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT - { { 5|(0<<4) }, { 8, 59 }, 0 }, - { { 5|(1<<4) }, { 23, 59 }, 0 }, - { { 5|(2<<4) }, { 38, 59 }, 0 }, - { { 5|(3<<4) }, { 83, 59 }, 0 }, - { { 5|(4<<4) }, { 129, 59 }, 0 }, - { { 5|(5<<4) }, { 144, 59 }, 0 }, - { { 5|(6<<4) }, { 159, 59 }, 0 }, - { { 5|(7<<4) }, { 174, 59 }, 0 }, - { { 10|(4<<4) }, { 193, 59 }, 0 }, - { { 10|(5<<4) }, { 205, 59 }, 0 }, - { { 10|(6<<4) }, { 217, 59 }, 0 }, + { 8, 59 }, { 23, 59 }, { 38, 59 }, { 83, 59 }, { 129, 59 }, { 144, 59 }, { 159, 59 }, { 174, 59 }, + { 193, 59 }, { 205, 59 }, { 217, 59 }, // Underglow / Border - { { 0xFF }, { 222, 64 }, 0 }, - { { 0xFF }, { 204, 64 }, 0 }, - { { 0xFF }, { 186, 64 }, 0 }, - { { 0xFF }, { 167, 64 }, 0 }, - { { 0xFF }, { 149, 64 }, 0 }, - { { 0xFF }, { 130, 64 }, 0 }, - { { 0xFF }, { 112, 64 }, 0 }, - { { 0xFF }, { 94, 64 }, 0 }, - { { 0xFF }, { 75, 64 }, 0 }, - { { 0xFF }, { 57, 64 }, 0 }, - { { 0xFF }, { 38, 64 }, 0 }, - { { 0xFF }, { 20, 64 }, 0 }, - { { 0xFF }, { 0, 64 }, 0 }, - { { 0xFF }, { 0, 47 }, 0 }, - { { 0xFF }, { 0, 32 }, 0 }, - { { 0xFF }, { 0, 17 }, 0 }, - { { 0xFF }, { 0, 0 }, 0 }, - { { 0xFF }, { 20, 0 }, 0 }, - { { 0xFF }, { 38, 0 }, 0 }, - { { 0xFF }, { 57, 0 }, 0 }, - { { 0xFF }, { 75, 0 }, 0 }, - { { 0xFF }, { 94, 0 }, 0 }, - { { 0xFF }, { 112, 0 }, 0 }, - { { 0xFF }, { 130, 0 }, 0 }, - { { 0xFF }, { 149, 0 }, 0 }, - { { 0xFF }, { 167, 0 }, 0 }, - { { 0xFF }, { 186, 0 }, 0 }, - { { 0xFF }, { 204, 0 }, 0 }, - { { 0xFF }, { 222, 1 }, 0 }, - { { 0xFF }, { 224, 17 }, 0 }, - { { 0xFF }, { 224, 32 }, 0 }, - { { 0xFF }, { 224, 47 }, 0 }, -}; + { 222, 64 }, { 204, 64 }, { 186, 64 }, { 167, 64 }, { 149, 64 }, { 130, 64 }, { 112, 64 }, { 94, 64 }, + { 75, 64 }, { 57, 64 }, { 38, 64 }, { 20, 64 }, { 0, 64 }, { 0, 47 }, { 0, 32 }, { 0, 17 }, + { 0, 0 }, { 20, 0 }, { 38, 0 }, { 57, 0 }, { 75, 0 }, { 94, 0 }, { 112, 0 }, { 130, 0 }, + { 149, 0 }, { 167, 0 }, { 186, 0 }, { 204, 0 }, { 222, 1 }, { 224, 17 }, { 224, 32 }, { 224, 47 } +}, { + // KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 1, 4, + // KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, + // KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, + // KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT + 1, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, + // KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, + // KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, + // Underglow / Border + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2 +} }; + #ifdef USB_LED_INDICATOR_ENABLE void rgb_matrix_indicators_kb(void) diff --git a/keyboards/massdrop/ctrl/keymaps/default/keymap.c b/keyboards/massdrop/ctrl/keymaps/default/keymap.c index 182abbbad4..53c96d95d0 100644 --- a/keyboards/massdrop/ctrl/keymaps/default/keymap.c +++ b/keyboards/massdrop/ctrl/keymaps/default/keymap.c @@ -98,6 +98,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } return false; + case RGB_TOG: + if (record->event.pressed) { + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: { + rgb_matrix_set_flags(LED_FLAG_KEYLIGHT); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_KEYLIGHT: { + rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_UNDERGLOW: { + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_disable_noeeprom(); + } + break; + default: { + rgb_matrix_set_flags(LED_FLAG_ALL); + rgb_matrix_enable_noeeprom(); + } + break; + } + } + return false; default: return true; //Process all other keycodes normally } diff --git a/keyboards/massdrop/ctrl/keymaps/mac/keymap.c b/keyboards/massdrop/ctrl/keymaps/mac/keymap.c index 41cf827572..79fe7388af 100644 --- a/keyboards/massdrop/ctrl/keymaps/mac/keymap.c +++ b/keyboards/massdrop/ctrl/keymaps/mac/keymap.c @@ -98,6 +98,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } return false; + case RGB_TOG: + if (record->event.pressed) { + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: { + rgb_matrix_set_flags(LED_FLAG_KEYLIGHT); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_KEYLIGHT: { + rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + case LED_FLAG_UNDERGLOW: { + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_disable_noeeprom(); + } + break; + default: { + rgb_matrix_set_flags(LED_FLAG_ALL); + rgb_matrix_enable_noeeprom(); + } + break; + } + } + return false; default: return true; //Process all other keycodes normally } diff --git a/keyboards/massdrop/ctrl/keymaps/matthewrobo/config.h b/keyboards/massdrop/ctrl/keymaps/matthewrobo/config.h new file mode 100644 index 0000000000..35fd446194 --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/matthewrobo/config.h @@ -0,0 +1,52 @@ +#pragma once + +#define FORCE_NKRO + +#define PERMISSIVE_HOLD +#define TAPPING_TERM 150 + +// #define DISABLE_RGB_MATRIX_ALPHAS_MODS +#define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN +#define DISABLE_RGB_MATRIX_BREATHING +#define DISABLE_RGB_MATRIX_CYCLE_ALL +#define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +#define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN +// #define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +#define DISABLE_RGB_MATRIX_DUAL_BEACON +#define DISABLE_RGB_MATRIX_RAINBOW_BEACON +#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS +#define DISABLE_RGB_MATRIX_RAINDROPS +#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +#define DISABLE_RGB_MATRIX_DIGITAL_RAIN +#define DISABLE_RGB_MATRIX_SOLID_REACTIVE +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +// #define DISABLE_RGB_MATRIX_SPLASH +// #define DISABLE_RGB_MATRIX_MULTISPLASH +// #define DISABLE_RGB_MATRIX_SOLID_SPLASH +// #define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH + +#define QMK_KEYS_PER_SCAN 4 + +// #define RGB_MATRIX_KEYRELEASES + + +// some speed shit +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION + +#ifndef NO_DEBUG +#define NO_DEBUG +#endif // !NO_DEBUG +#if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE) +#define NO_PRINT +#endif // !NO_PRINT + +#define NO_ACTION_ONESHOT +#define TAPPING_FORCE_HOLD +#define IGNORE_MOD_TAP_INTERRUPT diff --git a/keyboards/massdrop/ctrl/keymaps/matthewrobo/keymap.c b/keyboards/massdrop/ctrl/keymaps/matthewrobo/keymap.c new file mode 100644 index 0000000000..b4339a4d48 --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/matthewrobo/keymap.c @@ -0,0 +1,405 @@ +#include QMK_KEYBOARD_H +extern bool g_suspend_state; + +enum ctrl_layers { + _QWERTY, + _NAV, + _FNC +}; + +enum ctrl_keycodes { + U_T_AUTO = SAFE_RANGE, //USB Extra Port Toggle Auto Detect / Always Active + U_T_AGCR, //USB Toggle Automatic GCR control + DBG_TOG, //DEBUG Toggle On / Off + DBG_MTRX, //DEBUG Toggle Matrix Prints + DBG_KBD, //DEBUG Toggle Keyboard Prints + DBG_MOU, //DEBUG Toggle Mouse Prints + MD_BOOT, //Restart into bootloader after hold timeout + MAS_TOG, + MAS_CRM, + MAS_PRP, + MAS_RED, + MAS_GRN, + MAS_BLU, + MAS_CYN, + MAS_MGT, + MAS_YEL, + MAS_KEY, + MAS_WHT, +}; + +#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode +#define LT_CAPS LT(_NAV, KC_CAPS) +#define _V_V_V_ KC_TRNS +extern rgb_config_t rgb_matrix_config; +extern bool autoshift_enabled; + + +keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ + LT_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FNC), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [_NAV] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PAST, KC_PMNS, KC_PPLS, _______, _______, _______, _______, \ + _______, KC_PGUP, KC_HOME, KC_UP, KC_END, _______, _______, KC_P4, KC_P5, KC_P6, KC_PSLS, _______, _______, KC_EQL, _______, _______, _______, \ + _V_V_V_, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_P1, KC_P2, KC_P3, KC_PMNS, KC_PPLS, _______, \ + _______, _______, _______, _______, _______, _______, KC_P0, KC_P0, KC_P0, KC_PDOT, KC_PSLS, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + [_FNC] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_MSEL, KC_ASTG, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MSTP, KC_MPLY, KC_VOLU, \ + _______, RGB_MOD, RGB_SPI, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, MAS_MGT, MAS_BLU, MAS_WHT, RGB_RMOD, RGB_MOD, _______, KC_MPRV, KC_MNXT, KC_VOLD, \ + _______, RGB_RMOD, RGB_SPD, RGB_HUD, RGB_SAD, RGB_VAD, _______, MAS_RED, MAS_KEY, MAS_CYN, MAS_PRP, _______, _______, \ + MAS_TOG, RGB_TOG, _______, _______, _______, MD_BOOT, TG_NKRO, MAS_YEL, MAS_GRN, MAS_CRM, _______, _______, RGB_VAI, \ + _______, _______, _______, _______, _______, _V_V_V_, _______, _______, RGB_SPD, RGB_VAD, RGB_SPI \ + ), + /* + [X] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + [X] = LAYOUT( + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, \ + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, \ + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, \ + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, \ + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, \ + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86 \ + ), + */ +}; + +extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; +void set_color_helper(int index, uint8_t red, uint8_t green, uint8_t blue) +{ + if (!HAS_ANY_FLAGS(g_rgb_leds[index].flags, rgb_matrix_get_flags())) + { return; } + + rgb_matrix_set_color(index, red, green, blue); +} + +void rgb_matrix_indicators_user(void) +{ + uint8_t this_led = host_keyboard_leds(); + + if (!g_suspend_state && rgb_matrix_config.enable) { + switch (biton32(layer_state)) { + case _NAV: + if (this_led & (1 << USB_LED_NUM_LOCK)) { + rgb_matrix_set_color(41, 0xFF, 0x00, 0x00); + } else { + rgb_matrix_set_color(41, 0x00, 0x00, 0x00); + } + + // layer indicator + rgb_matrix_set_color(50, 0xFF, 0xFF, 0xFF); + rgb_matrix_set_color(101, 0xFF, 0xFF, 0xFF); + // ESDF + rgb_matrix_set_color(36, 0xFF, 0x00, 0x00); + rgb_matrix_set_color(52, 0xFF, 0x00, 0x00); + rgb_matrix_set_color(53, 0xFF, 0x00, 0x00); + rgb_matrix_set_color(54, 0xFF, 0x00, 0x00); + // home/end + rgb_matrix_set_color(35, 0x00, 0xFF, 0x00); + rgb_matrix_set_color(37, 0x00, 0xFF, 0x00); + // pgup/dn + rgb_matrix_set_color(34, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(51, 0x00, 0x00, 0xFF); + // numpad + rgb_matrix_set_color(23, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(24, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(25, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(40, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(42, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(57, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(58, 0xFF, 0xFF, 0x00); + rgb_matrix_set_color(59, 0xFF, 0xFF, 0x00); + // zero + rgb_matrix_set_color(69, 0xFF, 0x00, 0x00); + rgb_matrix_set_color(70, 0xFF, 0x00, 0x00); + rgb_matrix_set_color(71, 0xFF, 0x00, 0x00); + // dot + rgb_matrix_set_color(72, 0x00, 0x00, 0xFF); + // math shit + rgb_matrix_set_color(26, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(27, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(28, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(43, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(46, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(60, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(61, 0x00, 0x00, 0xFF); + rgb_matrix_set_color(73, 0x00, 0x00, 0xFF); + break; + + case _FNC: { + HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, rgb_matrix_config.val }; + HSV hui = hsv; + HSV hud = hsv; + HSV sai = hsv; + HSV sad = hsv; + HSV vai = hsv; + HSV vad = hsv; + hui.h = hsv.h + 8; + hud.h = hsv.h - 8; + sai.s = hsv.s + 16 > 255 ? 255u : hsv.s + 16; + sad.s = hsv.s - 16 < 0 ? 0 : hsv.s - 16; + vai.v = hsv.v + 16 > 255 ? 255 : hsv.v + 16; + vad.v = hsv.v - 16 < 0 ? 0 : hsv.v - 16; + RGB rgb = hsv_to_rgb(hsv); + RGB rgbHUI = hsv_to_rgb(hui); + RGB rgbHUD = hsv_to_rgb(hud); + RGB rgbSAI = hsv_to_rgb(sai); + RGB rgbSAD = hsv_to_rgb(sad); + RGB rgbVAI = hsv_to_rgb(vai); + RGB rgbVAD = hsv_to_rgb(vad); + rgb_matrix_set_color(81, 0xFF, 0xFF, 0xFF); // layer indicator + rgb_matrix_set_color(91, 0xFF, 0xFF, 0xFF); + rgb_matrix_set_color(93, 0x00, 0x00, 0x00); + rgb_matrix_set_color(94, rgb.r, rgb.g, rgb.b); + rgb_matrix_set_color(95, rgb.r, rgb.g, rgb.b); + rgb_matrix_set_color(96, 0x00, 0x00, 0x00); + rgb_matrix_set_color(68, 0xFF, 0x00, 0x00); // MD_BOOT + rgb_matrix_set_color(69, 0xFF, 0x00, 0x40); // TG_NKRO + rgb_matrix_set_color(32, 0x00, 0x80, 0xFF); // KC_VOLU + rgb_matrix_set_color(49, 0x00, 0x80, 0xFF); + rgb_matrix_set_color(13, 0xFF, 0x00, 0x00); // KC_MUTE + rgb_matrix_set_color(30, 0xFF, 0x00, 0x00); // KC_MSTP + rgb_matrix_set_color(47, 0xFF, 0x40, 0x00); // KC_MPRV + rgb_matrix_set_color(48, 0xFF, 0x40, 0x00); + rgb_matrix_set_color(14, 0x00, 0xFF, 0x00); // KC_MSEL + rgb_matrix_set_color(31, 0x00, 0xFF, 0x00); // KC_MPLY + + if (this_led & (1 << !autoshift_enabled)) { + rgb_matrix_set_color(15, 0xFF, 0x00, 0x00); // KC_ASTG + } else { + rgb_matrix_set_color(15, 0xFF, 0xFF, 0x00); + } + + rgb_matrix_set_color(44, 0xFF, 0x80, 0x00); //RGB_MOD + rgb_matrix_set_color(45, 0xFF, 0x80, 0x00); + rgb_matrix_set_color(34, 0xFF, 0x80, 0x00); //RGB_MOD + rgb_matrix_set_color(51, 0xFF, 0x80, 0x00); + rgb_matrix_set_color(63, 0xFF, 0x40, 0x00); //RGB_TOG + rgb_matrix_set_color(64, rgb.r, rgb.g, rgb.b); //MAS_TOG + rgb_matrix_set_color(36, rgbHUI.r, rgbHUI.g, rgbHUI.b); //RGB_HUI + rgb_matrix_set_color(53, rgbHUD.r, rgbHUD.g, rgbHUD.b); + rgb_matrix_set_color(37, rgbSAI.r, rgbSAI.g, rgbSAI.b); //RGB_SAI + rgb_matrix_set_color(54, rgbSAD.r, rgbSAD.g, rgbSAD.b); + rgb_matrix_set_color(38, rgbVAI.r, rgbVAI.g, rgbVAI.b); //RGB_VAI + rgb_matrix_set_color(55, rgbVAD.r, rgbVAD.g, rgbVAD.b); + rgb_matrix_set_color(79, rgb.r, rgb.g, rgb.b); // config display + rgb_matrix_set_color(75, rgbVAI.r, rgbVAI.g, rgbVAI.b); //RGB_VAI + rgb_matrix_set_color(85, rgbVAD.r, rgbVAD.g, rgbVAD.b); + rgb_matrix_set_color(35, 0x80, 0x80, 0x80); //RGB_SPI + rgb_matrix_set_color(52, 0x80, 0x80, 0x80); + rgb_matrix_set_color(84, 0x80, 0x80, 0x80); //RGB_SPI + rgb_matrix_set_color(86, 0x80, 0x80, 0x80); + rgb_matrix_set_color(41, 0xF0, 0x00, 0xFF); //MAS_MGT + rgb_matrix_set_color(42, 0x00, 0x02, 0xFF); //MAS_BLU + rgb_matrix_set_color(57, 0xFF, 0x00, 0x00); //MAS_RED + rgb_matrix_set_color(58, 0x00, 0x00, 0x00); //MAS_KEY + rgb_matrix_set_color(59, 0x00, 0xFF, 0xF7); //MAS_CYN + rgb_matrix_set_color(70, 0xFF, 0xDA, 0x00); //MAS_YEL + rgb_matrix_set_color(71, 0x00, 0xFF, 0x01); //MAS_GRN + rgb_matrix_set_color(72, 0xFF, 0xA5, 0x18); //MAS_CRM + rgb_matrix_set_color(60, 0x81, 0x3C, 0xFF); //MAS_PRP + rgb_matrix_set_color(26, 0xFF, 0xFF, 0xFF); //MAS_WHT + } + break; + } + } +} + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) +{ + autoshift_disable(); + rgb_matrix_sethsv(192, 112, 255); + rgb_matrix_mode(4); +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) +{ +}; + +#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT)) + +bool process_record_user(uint16_t keycode, keyrecord_t* record) +{ + static uint32_t key_timer; + + switch (keycode) { + case U_T_AUTO: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode"); + } + + return false; + + case U_T_AGCR: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode"); + } + + return false; + + case DBG_TOG: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode"); + } + + return false; + + case DBG_MTRX: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix"); + } + + return false; + + case DBG_KBD: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard"); + } + + return false; + + case DBG_MOU: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse"); + } + + return false; + + case MD_BOOT: + if (record->event.pressed) { + key_timer = timer_read32(); + } else { + if (timer_elapsed32(key_timer) >= 500) { + reset_keyboard(); + } + } + + return false; + + case MAS_TOG: + if (record->event.pressed) { + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: { + rgb_matrix_set_flags(LED_FLAG_KEYLIGHT); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + + case LED_FLAG_KEYLIGHT: { + rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); + rgb_matrix_set_color_all(0, 0, 0); + } + break; + + case LED_FLAG_UNDERGLOW: { + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_disable_noeeprom(); + } + break; + + default: { + rgb_matrix_set_flags(LED_FLAG_ALL); + } + break; + } + } + + return false; + + case MAS_CRM: + if (record->event.pressed) { + rgb_matrix_sethsv(32, 160, 255); + } + + return false; + + case MAS_PRP: + if (record->event.pressed) { + rgb_matrix_sethsv(192, 112, 255); + } + + return false; + + case MAS_RED: + if (record->event.pressed) { + rgb_matrix_sethsv(0, 255, 255); + } + + return false; + + case MAS_GRN: + if (record->event.pressed) { + rgb_matrix_sethsv(88, 255, 255); + } + + return false; + + case MAS_BLU: + if (record->event.pressed) { + rgb_matrix_sethsv(168, 255, 255); + } + + return false; + + case MAS_CYN: + if (record->event.pressed) { + rgb_matrix_sethsv(128, 255, 255); + } + + return false; + + case MAS_MGT: + if (record->event.pressed) { + rgb_matrix_sethsv(216, 255, 255); + } + + return false; + + case MAS_YEL: + if (record->event.pressed) { + rgb_matrix_sethsv(40, 255, 255); + } + + return false; + + case MAS_KEY: + if (record->event.pressed) { + rgb_matrix_sethsv(0, 0, 0); + } + + return false; + + case MAS_WHT: + if (record->event.pressed) { + rgb_matrix_sethsv(128, 0, 255); + } + + return false; + + default: + return true; //Process all other keycodes normally + } +} + diff --git a/keyboards/massdrop/ctrl/keymaps/matthewrobo/rules.mk b/keyboards/massdrop/ctrl/keymaps/matthewrobo/rules.mk new file mode 100644 index 0000000000..4fb7826ce6 --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/matthewrobo/rules.mk @@ -0,0 +1,2 @@ +NKRO_ENABLE = yes # USB Nkey Rollover +AUTO_SHIFT_ENABLE = yes # Auto Shift |