aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorM-AS <matthewtransformer@hotmail.com>2020-10-18 19:30:24 -0400
committerGitHub <noreply@github.com>2020-10-18 16:30:24 -0700
commit9f1f43bb8620cc8fe6715019c3dc58cd4f79cf17 (patch)
tree4ebaef1fdea22d64350f70a4647d46331cf45c66
parentc4d87f307385ba61b4a3ac3f5f6e596105b0bf07 (diff)
downloadqmk_firmware-9f1f43bb8620cc8fe6715019c3dc58cd4f79cf17.tar.gz
qmk_firmware-9f1f43bb8620cc8fe6715019c3dc58cd4f79cf17.zip
[Keymap] Updated personal Massdrop CTRL keymap (#10649)
* initial port of keymap to latest qmk version * forgot to add space cadet shift, fixed * corrected colors and added color macros * added custom rgb matrix effects * enabled extrakey * updated readme * Added GPL3 License Headers * Added images to readme * clang-format * Apply suggestions from code review Co-authored-by: Ryan <fauxpark@gmail.com> * renamed README.md to readme.md Co-authored-by: Ryan <fauxpark@gmail.com>
-rw-r--r--keyboards/massdrop/ctrl/keymaps/matthewrobo/config.h181
-rw-r--r--keyboards/massdrop/ctrl/keymaps/matthewrobo/config_led.c39
-rw-r--r--keyboards/massdrop/ctrl/keymaps/matthewrobo/keymap.c660
-rw-r--r--keyboards/massdrop/ctrl/keymaps/matthewrobo/keymap.h86
-rw-r--r--keyboards/massdrop/ctrl/keymaps/matthewrobo/readme.md14
-rw-r--r--keyboards/massdrop/ctrl/keymaps/matthewrobo/rgb_matrix_user.inc51
-rw-r--r--keyboards/massdrop/ctrl/keymaps/matthewrobo/rules.mk20
7 files changed, 594 insertions, 457 deletions
diff --git a/keyboards/massdrop/ctrl/keymaps/matthewrobo/config.h b/keyboards/massdrop/ctrl/keymaps/matthewrobo/config.h
index b7a469208..6e16c3a5f 100644
--- a/keyboards/massdrop/ctrl/keymaps/matthewrobo/config.h
+++ b/keyboards/massdrop/ctrl/keymaps/matthewrobo/config.h
@@ -1,67 +1,134 @@
1#pragma once 1/*
2QMK Firmware Massdrop CTRL M-AS Keymap
3Copyright (C) 2020 matthewrobo
2 4
3#define FORCE_NKRO 5This program is free software: you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 3 of the License, or
8(at your option) any later version.
4 9
5#define PERMISSIVE_HOLD 10This program is distributed in the hope that it will be useful,
6#define TAPPING_TERM 150 11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
7 14
8#define TAP_HOLD_CAPS_DELAY 0 15You should have received a copy of the GNU General Public License
16along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
9 18
10#define RGB_MATRIX_FRAMEBUFFER_EFFECTS 19#pragma once
11 20
12// #define DISABLE_RGB_MATRIX_SOLID_COLOR 21#define MODS_SHIFT (get_mods() & MOD_MASK_SHIFT)
13// #define DISABLE_RGB_MATRIX_ALPHAS_MODS 22#define MODS_CTRL (get_mods() & MOD_MASK_CTRL)
14// #define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN 23#define MODS_ALT (get_mods() & MOD_MASK_ALT)
15// #define DISABLE_RGB_MATRIX_BREATHING
16#define DISABLE_RGB_MATRIX_BAND_SAT
17// #define DISABLE_RGB_MATRIX_BAND_VAL
18#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
19#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL
20#define DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT
21#define DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL
22#define DISABLE_RGB_MATRIX_CYCLE_ALL
23#define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
24#define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN
25#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN
26#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
27#define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
28#define DISABLE_RGB_MATRIX_CYCLE_PINWHEEL
29// #define DISABLE_RGB_MATRIX_CYCLE_SPIRAL
30#define DISABLE_RGB_MATRIX_DUAL_BEACON
31#define DISABLE_RGB_MATRIX_RAINBOW_BEACON
32#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS
33#define DISABLE_RGB_MATRIX_RAINDROPS
34#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
35// #define DISABLE_RGB_MATRIX_TYPING_HEATMAP
36#define DISABLE_RGB_MATRIX_DIGITAL_RAIN
37// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
38#define DISABLE_RGB_MATRIX_SOLID_REACTIVE
39// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
40// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
41// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
42// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
43// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
44// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
45// #define DISABLE_RGB_MATRIX_SPLASH
46// #define DISABLE_RGB_MATRIX_MULTISPLASH
47// #define DISABLE_RGB_MATRIX_SOLID_SPLASH
48// #define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH
49 24
50#define QMK_KEYS_PER_SCAN 4 25// #define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT) // Key combination that allows the use of magic commands (useful for debugging)
51 26
52// #define RGB_MATRIX_KEYRELEASES 27// #define NO_DEBUG // Disable debugging
28// #define NO_PRINT // Disable printing/debugging using hid_listen
29// #define NO_ACTION_LAYER // Disable layers
30// #define NO_ACTION_TAPPING // Disable tap dance and other tapping features
31// #define NO_ACTION_ONESHOT // Disable one-shot modifiers
32// #define NO_ACTION_MACRO // Disable old style macro handling: MACRO() & action_get_macro
33// #define TERMINAL_HELP
34// #define MOUSEKEY_INTERVAL 20
35// #define MOUSEKEY_DELAY 0
36// #define MOUSEKEY_TIME_TO_MAX 60
37// #define MOUSEKEY_MAX_SPEED 10
38// #define MOUSEKEY_WHEEL_DELAY 0
39#define FORCE_NKRO // NKRO by default requires to be turned on, this forces it on during keyboard startup regardless of EEPROM setting. NKRO can still be turned off but will be turned on again if the keyboard reboots.
40// #define QMK_KEYS_PER_SCAN 4 // Allows sending more than one key per scan. By default, only one key event gets sent via process_record() per scan. This has little impact on most typing, but if you're doing a lot of chords, or your scan rate is slow to begin with, you can have some delay in processing key events. Each press and release is a separate event. For a keyboard with 1ms or so scan times, even a very fast typist isn't going to produce the 500 keystrokes a second needed to actually get more than a few ms of delay from this. But if you're doing chording on something with 3-4ms scan times? You probably want this.
41// #define STRICT_LAYER_RELEASE // Force a key release to be evaluated using the current layer stack instead of remembering which layer it came from (used for advanced cases)
42// #define LOCKING_SUPPORT_ENABLE // Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap
43// #define LOCKING_RESYNC_ENABLE // Tries to keep switch state consistent with keyboard LED state
44#define TAPPING_TERM 200 // How long before a tap becomes a hold, if set above 500, a key tapped during the tapping term will turn it into a hold too
45#define PERMISSIVE_HOLD
46// #define TAPPING_TERM_PER_KEY // Enables handling for per key TAPPING_TERM settings
47// #define RETRO_TAPPING // Tap anyway, even after TAPPING_TERM, if there was no other key interruption between press and release
48// #define TAPPING_TOGGLE 2 // How many taps before triggering the toggle
49// #define PERMISSIVE_HOLD // Makes tap and hold keys trigger the hold if another key is pressed before releasing, even if it hasn't hit the TAPPING_TERM. See Permissive Hold for details
50// #define IGNORE_MOD_TAP_INTERRUPT // Makes it possible to do rolling combos (zx) with keys that convert to other keys on hold, by enforcing the TAPPING_TERM for both keys. See Mod tap interrupt for details
51// #define TAPPING_FORCE_HOLD // Makes it possible to use a dual role key as modifier shortly after having been tapped. See Hold after tap. Breaks any Tap Toggle functionality (TT or the One Shot Tap Toggle)
52// #define LEADER_TIMEOUT 300 // How long before the leader key times out. If you're having issues finishing the sequence before it times out, you may need to increase the timeout setting. Or you may want to enable the LEADER_PER_KEY_TIMING option, which resets the timeout after each key is tapped.
53// #define LEADER_PER_KEY_TIMING // Sets the timer for leader key chords to run on each key press rather than overall
54// #define LEADER_KEY_STRICT_KEY_PROCESSING // Disables keycode filtering for Mod-Tap and Layer-Tap keycodes. Eg, if you enable this, you would need to specify MT(MOD_CTL, KC_A) if you want to use KC_A.
55// #define ONESHOT_TIMEOUT 300 // How long before oneshot times out
56// #define ONESHOT_TAP_TOGGLE 2 // How many taps before oneshot toggle is triggered
57// #define COMBO_COUNT 2 // Set this to the number of combos that you're using in the Combo feature.
58// #define COMBO_TERM 200 // How long for the Combo keys to be detected. Defaults to TAPPING_TERM if not defined.
59// #define TAP_CODE_DELAY 100 // Sets the delay between register_code and unregister_code, if you're having issues with it registering properly (common on VUSB boards). The value is in milliseconds.
60// #define TAP_HOLD_CAPS_DELAY 80 // Sets the delay for Tap Hold keys (LT, MT) when using KC_CAPSLOCK keycode, as this has some special handling on MacOS. The value is in milliseconds, and defaults to 80 ms if not defined. For macOS, you may want to set this to 200 or higher.
53 61
54// some speed shit 62#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
55#define NO_ACTION_MACRO 63#define RGB_MATRIX_KEYPRESSES // reacts to keypresses
56#define NO_ACTION_FUNCTION 64// #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
65#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_ALPHAS_MODS // Sets the default mode, if none has been set
66// #define RGBLIGHT_HUE_STEP 12 // Units to step when in/decreasing hue
67// #define RGBLIGHT_SAT_STEP 25 // Units to step when in/decreasing saturation
68// #define RGBLIGHT_VAL_STEP 12 // Units to step when in/decreasing value (brightness)
69// #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
70// #define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended
71// #define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness)
72// #define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
73// #define RGBLIGHT_ANIMATIONS // Run RGB animations
74// #define RGBLIGHT_ANIMATIONS // Enable all additional animation modes.
75// #define RGBLIGHT_EFFECT_ALTERNATING // Enable alternating animation mode.
76// #define RGBLIGHT_EFFECT_BREATHING // Enable breathing animation mode.
77// #define RGBLIGHT_EFFECT_CHRISTMAS // Enable christmas animation mode.
78// #define RGBLIGHT_EFFECT_KNIGHT // Enable knight animation mode.
79// #define RGBLIGHT_EFFECT_RAINBOW_MOOD // Enable rainbow mood animation mode.
80// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL // Enable rainbow swirl animation mode.
81// #define RGBLIGHT_EFFECT_RGB_TEST // Enable RGB test animation mode.
82// #define RGBLIGHT_EFFECT_SNAKE // Enable snake animation mode.
83// #define RGBLIGHT_EFFECT_STATIC_GRADIENT // Enable static gradient mode.
57 84
58#ifndef NO_DEBUG 85// #define RGBLIGHT_EFFECT_BREATHE_CENTER // If defined, used to calculate the curve for the breathing animation. Valid values are 1.0 to 2.7
59#define NO_DEBUG 86// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // The maximum brightness for the breathing mode. Valid values are 1 to 255
60#endif // !NO_DEBUG 87// #define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 1000 // How long to wait between light changes for the "Christmas" animation, in milliseconds
61#if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE) 88// #define RGBLIGHT_EFFECT_CHRISTMAS_STEP 2 // The number of LEDs to group the red/green colors by for the "Christmas" animation
62#define NO_PRINT 89// #define RGBLIGHT_EFFECT_KNIGHT_LED_NUM RGBLED_NUM // The number of LEDs to have the "Knight" animation travel
63#endif // !NO_PRINT 90// #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3 // The number of LEDs to light up for the "Knight" animation
91// #define RGBLIGHT_EFFECT_KNIGHT_OFFSET 0 // The number of LEDs to start the "Knight" animation from the start of the strip by
92// #define RGBLIGHT_RAINBOW_SWIRL_RANGE 255 // Range adjustment for the rainbow swirl effect to get different swirls
93// #define RGBLIGHT_EFFECT_SNAKE_LENGTH 4 // The number of LEDs to light up for the "Snake" animation
64 94
65#define NO_ACTION_ONESHOT 95// This list in in the correct mode order. Next mode is the following line, previous mode is previous line. Loops around.
66#define TAPPING_FORCE_HOLD 96// #define DISABLE_RGB_MATRIX_SOLID_COLOR // Static single hue, no speed support
67#define IGNORE_MOD_TAP_INTERRUPT 97// #define DISABLE_RGB_MATRIX_ALPHAS_MODS // Static dual hue, speed is hue for secondary hue
98// #define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN // Static gradient top to bottom, speed controls how much gradient changes
99#define DISABLE_RGB_MATRIX_BREATHING // Single hue brightness cycling animation
100#define DISABLE_RGB_MATRIX_BAND_SAT // Single hue band fading saturation scrolling left to right
101#define DISABLE_RGB_MATRIX_BAND_VAL // Single hue band fading brightness scrolling left to right
102#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT // Single hue 3 blade spinning pinwheel fades saturation
103#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL // Single hue 3 blade spinning pinwheel fades brightness
104#define DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT // Single hue spinning spiral fades saturation
105#define DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL // Single hue spinning spiral fades brightness
106#define DISABLE_RGB_MATRIX_CYCLE_ALL // Full keyboard solid hue cycling through full gradient
107#define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT // Full gradient scrolling left to right
108#define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN // Full gradient scrolling top to bottom
109#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN // Full gradient scrolling out to in
110#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL // Full dual gradients scrolling out to in
111#define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON // Full gradent Chevron shapped scrolling left to right
112#define DISABLE_RGB_MATRIX_CYCLE_PINWHEEL // Full gradient spinning pinwheel around center of keyboard
113// #define DISABLE_RGB_MATRIX_CYCLE_SPIRAL // Full gradient spinning spiral around center of keyboard
114#define DISABLE_RGB_MATRIX_DUAL_BEACON // Full gradient spinning around center of keyboard
115#define DISABLE_RGB_MATRIX_RAINBOW_BEACON // Full tighter gradient spinning around center of keyboard
116#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS // Full dual gradients spinning two halfs of keyboard
117#define DISABLE_RGB_MATRIX_RAINDROPS // Randomly changes a single key's hue
118#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS // Randomly changes a single key's hue and saturation
119// =================================================== Requires RGB_MATRIX_FRAMEBUFFER_EFFECTS =============================================================
120// #define DISABLE_RGB_MATRIX_TYPING_HEATMAP // How hot is your WPM!
121#define DISABLE_RGB_MATRIX_DIGITAL_RAIN // That famous computer simulation
122// =================================================== RGB_MATRIX_KEYPRESSES OR RGB_MATRIX_KEYRELEASES =====================================================
123#define DISABLE_RGB_MATRIX_SOLID_REACTIVE // Static single hue, pulses keys hit to shifted hue then fades to current hue
124// #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE // Pulses keys hit to hue & value then fades value out
125#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE // Hue & value pulse near a single key hit then fades value out
126#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE // Hue & value pulse near multiple key hits then fades value out
127#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS // Hue & value pulse the same column and row of a single key hit then fades value out
128#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS // Hue & value pulse the same column and row of multiple key hits then fades value out
129#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS // Hue & value pulse away on the same column and row of a single key hit then fades value out
130#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS // Hue & value pulse away on the same column and row of multiple key hits then fades value out
131// #define DISABLE_RGB_MATRIX_SPLASH // Full gradient & value pulse away from a single key hit then fades value out
132// #define DISABLE_RGB_MATRIX_MULTISPLASH // Full gradient & value pulse away from multiple key hits then fades value out
133// #define DISABLE_RGB_MATRIX_SOLID_SPLASH // Hue & value pulse away from a single key hit then fades value out
134// #define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH // Hue & value pulse away from multiple key hits then fades value out
diff --git a/keyboards/massdrop/ctrl/keymaps/matthewrobo/config_led.c b/keyboards/massdrop/ctrl/keymaps/matthewrobo/config_led.c
index 448793cf5..a4ce649d3 100644
--- a/keyboards/massdrop/ctrl/keymaps/matthewrobo/config_led.c
+++ b/keyboards/massdrop/ctrl/keymaps/matthewrobo/config_led.c
@@ -1,10 +1,28 @@
1#ifdef RGB_MATRIX_ENABLE 1/*
2#include "ctrl.h" 2QMK Firmware Massdrop CTRL M-AS Keymap
3Copyright (C) 2020 matthewrobo
4
5This program is free software: you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 3 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
3 14
4#include "led_matrix.h" 15You should have received a copy of the GNU General Public License
5#include "rgb_matrix.h" 16along with this program. If not, see <http://www.gnu.org/licenses/>.
6#include "config_led.h" 17*/
7 18
19#ifdef RGB_MATRIX_ENABLE
20# include "ctrl.h"
21
22# include "led_matrix.h"
23# include "rgb_matrix.h"
24# include "config_led.h"
25// clang-format off
8led_config_t g_led_config = { { 26led_config_t g_led_config = { {
9 { 0, 1, 2, 3, 4, 5, 6, 7 }, 27 { 0, 1, 2, 3, 4, 5, 6, 7 },
10 { 16, 17, 18, 19, 20, 21, 22, 23 }, 28 { 16, 17, 18, 19, 20, 21, 22, 23 },
@@ -70,13 +88,10 @@ led_config_t g_led_config = { {
70 2, 2, 2, 2, 2, 2, 2, 2, 88 2, 2, 2, 2, 2, 2, 2, 2,
71 2, 2, 2, 2, 2, 2, 2, 2 89 2, 2, 2, 2, 2, 2, 2, 2
72} }; 90} };
91// clang-format on
73 92
74 93# ifdef USB_LED_INDICATOR_ENABLE
75#ifdef USB_LED_INDICATOR_ENABLE 94void rgb_matrix_indicators_kb(void) { led_matrix_indicators(); }
76void rgb_matrix_indicators_kb(void) 95# endif // USB_LED_INDICATOR_ENABLE
77{
78 led_matrix_indicators();
79}
80#endif // USB_LED_INDICATOR_ENABLE
81 96
82#endif 97#endif
diff --git a/keyboards/massdrop/ctrl/keymaps/matthewrobo/keymap.c b/keyboards/massdrop/ctrl/keymaps/matthewrobo/keymap.c
index 447b0aca1..c89607b3f 100644
--- a/keyboards/massdrop/ctrl/keymaps/matthewrobo/keymap.c
+++ b/keyboards/massdrop/ctrl/keymaps/matthewrobo/keymap.c
@@ -1,396 +1,286 @@
1#include QMK_KEYBOARD_H 1/*
2 2QMK Firmware Massdrop CTRL M-AS Keymap
3enum ctrl_layers { 3Copyright (C) 2020 matthewrobo
4 _QWERTY, 4
5 _NAV, 5This program is free software: you can redistribute it and/or modify
6 _FNC 6it under the terms of the GNU General Public License as published by
7}; 7the Free Software Foundation, either version 3 of the License, or
8 8(at your option) any later version.
9enum ctrl_keycodes { 9
10 U_T_AUTO = SAFE_RANGE, //USB Extra Port Toggle Auto Detect / Always Active 10This program is distributed in the hope that it will be useful,
11 U_T_AGCR, //USB Toggle Automatic GCR control 11but WITHOUT ANY WARRANTY; without even the implied warranty of
12 DBG_TOG, //DEBUG Toggle On / Off 12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 DBG_MTRX, //DEBUG Toggle Matrix Prints 13GNU General Public License for more details.
14 DBG_KBD, //DEBUG Toggle Keyboard Prints 14
15 DBG_MOU, //DEBUG Toggle Mouse Prints 15You should have received a copy of the GNU General Public License
16 MD_BOOT, //Restart into bootloader after hold timeout 16along with this program. If not, see <http://www.gnu.org/licenses/>.
17 MAS_TOG, 17*/
18 MAS_CRM, 18
19 MAS_PRP, 19#include "keymap.h"
20 MAS_RED, 20// clang-format off
21 MAS_GRN,
22 MAS_BLU,
23 MAS_CYN,
24 MAS_MGT,
25 MAS_YEL,
26 MAS_KEY,
27 MAS_WHT,
28};
29
30#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode
31#define LT_CAPS LT(_NAV, KC_CAPS)
32#define _V_V_V_ KC_TRNS
33extern bool autoshift_enabled;
34
35
36keymap_config_t keymap_config;
37
38const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 21const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
39 [_QWERTY] = LAYOUT( 22 [_KL] = LAYOUT(
40 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, \ 23 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,
41 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, \ 24 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,
42 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, \ 25 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,
43 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, \ 26 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,
44 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, \ 27 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,
45 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FNC), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ 28 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
46 ), 29 ),
47 [_NAV] = LAYOUT( 30 [_NL] = LAYOUT(
48 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ 31 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
49 _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PAST, KC_PMNS, KC_PPLS, _______, _______, _______, _______, \ 32 _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PAST, KC_PMNS, KC_PPLS, _______, _______, _______, _______,
50 _______, KC_PGUP, KC_HOME, KC_UP, KC_END, _______, _______, KC_P4, KC_P5, KC_P6, KC_PSLS, _______, _______, KC_EQL, _______, _______, _______, \ 33 _______, KC_PGUP, KC_HOME, KC_UP, KC_END, _______, _______, KC_P4, KC_P5, KC_P6, KC_PSLS, _______, _______, KC_EQL, _______, _______, _______,
51 _V_V_V_, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_P1, KC_P2, KC_P3, KC_PMNS, KC_PPLS, _______, \ 34 _LAYER_, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_P1, KC_P2, KC_P3, KC_PMNS, KC_PPLS, _______,
52 _______, _______, _______, _______, _______, _______, KC_P0, KC_P0, KC_P0, KC_PDOT, KC_PSLS, _______, _______, \ 35 _______, _______, _______, _______, _______, _______, KC_P0, KC_P0, KC_P0, KC_PDOT, KC_PSLS, _______, _______,
53 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ 36 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
54 ), 37 ),
55 [_FNC] = LAYOUT( 38 [_FL] = LAYOUT(
56 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_MSEL, KC_ASTG, \ 39 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_MSEL, _______,
57 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MSTP, KC_MPLY, KC_VOLU, \ 40 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MSTP, KC_MPLY, KC_VOLU,
58 _______, 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, \ 41 _______, 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,
59 _______, RGB_RMOD, RGB_SPD, RGB_HUD, RGB_SAD, RGB_VAD, _______, MAS_RED, MAS_KEY, MAS_CYN, MAS_PRP, _______, _______, \ 42 _______, RGB_RMOD,RGB_SPD, RGB_HUD, RGB_SAD, RGB_VAD, _______, MAS_RED, MAS_KEY, MAS_CYN, MAS_PRP, _______, _______,
60 MAS_TOG, RGB_TOG, _______, _______, _______, MD_BOOT, TG_NKRO, MAS_YEL, MAS_GRN, MAS_CRM, _______, _______, RGB_VAI, \ 43 _______, RGB_TOG, _______, _______, _______, MD_BOOT, NK_TOGG, MAS_YEL, MAS_GRN, MAS_CRM, _______, _______, RGB_VAI,
61 _______, _______, _______, _______, _______, _V_V_V_, _______, _______, RGB_SPD, RGB_VAD, RGB_SPI \ 44 _______, _______, _______, _______, _______, _LAYER_, _______, _______, RGB_SPD, RGB_VAD, RGB_SPI
62 ), 45 ),
63 /* 46 /*
64 [X] = LAYOUT( 47 [DEFAULT] = LAYOUT(
65 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ 48 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,
66 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ 49 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,
67 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ 50 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,
68 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ 51 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,
69 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ 52 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,
70 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ 53 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
71 ), 54 ),
72 [X] = LAYOUT( 55 [X] = LAYOUT(
73 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, \ 56 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
74 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, \ 57 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
75 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, \ 58 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
76 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, \ 59 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
77 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, \ 60 _______, _______, _______, _______, _______, _______, TG_NKRO, _______, _______, _______, _______, _______, _______,
78 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86 \ 61 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
79 ), 62 ),
80 */ 63 [RGB] = LAYOUT(
64 ESC: 0, F1: 1, F2: 2, F3: 3, F4: 4, F5: 5, F6: 6, F7: 7, F8: 8, F9: 9, F10: 10, F11: 11, F12: 12, PSCR: 13, SLCK: 14, PAUS: 15,
65 GRV: 16, 1: 17, 2: 18, 3: 19, 4: 20, 5: 21, 6: 22, 7: 23, 8: 24, 9: 25, 0: 26, MINS: 27, EQL: 28, BSPC: 29, INS: 30, HOME: 31, PGUP: 32,
66 TAB: 33, Q: 34, W: 35, E: 36, R: 37, T: 38, Y: 39, U: 40, I: 41, O: 42, P: 43, LBRC: 44, RBRC: 45, BSLS: 46, DEL: 47, END: 48, PGDN: 49,
67 CAPS: 50, A: 51, S: 52, D: 53, F: 54, G: 55, H: 56, J: 57, K: 58, L: 59, SCLN: 60, QUOT: 61, ENT: 62,
68 LSFT: 63, Z: 64, X: 65, C: 66, V: 67, B: 68, N: 69, M: 70, COMM: 71, DOT: 72, SLSH: 73, RSFT: 74, UP: 75,
69 LCTL: 76, LGUI: 77, LALT: 78, SPC: 79, RALT: 80, Fn: 81, APP: 82, RCTL: 83, LEFT: 84, DOWN: 85, RGHT: 86
70 ),
71 [MATRIX] = LAYOUT(
72 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
73 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
74 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
75 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
76 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
77 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86
78 ),
79 */
81}; 80};
82 81
83 82#ifdef _______
84void rgb_matrix_indicators_user(void) 83# undef _______
85{ 84# define _______ {0,0,0}
86 uint8_t this_led = host_keyboard_leds(); 85
87 86const uint8_t PROGMEM ledmap[][DRIVER_LED_TOTAL][3] = {
88 if (!g_suspend_state && rgb_matrix_config.enable) { 87 [_NL] = {
89 switch (biton32(layer_state)) { 88 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
90 case _NAV: 89 _______, _______, _______, _______, _______, _______, _______, GOLD, GOLD, GOLD, GREEN, GREEN, GREEN, _______, _______, _______, _______,
91 if (this_led & (1 << USB_LED_NUM_LOCK)) { 90 _______, TEAL, CYAN, AZURE, CYAN, _______, _______, GOLD, RED, GOLD, GREEN, _______, _______, GREEN, _______, _______, _______,
92 rgb_matrix_set_color(41, 0xFF, 0x00, 0x00); 91 WHITE, TEAL, AZURE, AZURE, AZURE, _______, _______, GOLD, GOLD, GOLD, GREEN, GREEN, _______,
93 } else { 92 _______, _______, _______, _______, _______, _______, RED, RED, RED, GREEN, GREEN, _______, _______,
94 rgb_matrix_set_color(41, 0x00, 0x00, 0x00); 93 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
95 } 94 },
96 95 [_FL] = {
97 // layer indicator 96 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RED, GREEN, _______,
98 rgb_matrix_set_color(50, 0xFF, 0xFF, 0xFF); 97 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RED, GREEN, AZURE,
99 rgb_matrix_set_color(101, 0xFF, 0xFF, 0xFF); 98 _______, GOLD, CORAL, _______, _______, _______, _______, _______, MAGENT, BLUE, WHITE, GOLD, GOLD, _______, ORANGE, ORANGE, AZURE,
100 // ESDF 99 _______, GOLD, CORAL, _______, _______, _______, _______, RED, {1,0,0}, CYAN, M9B59B5, _______, _______,
101 rgb_matrix_set_color(36, 0xFF, 0x00, 0x00); 100 _______, RED, _______, _______, _______, RED, PINK, YELLOW, GREEN, CREAM, _______, _______, _______,
102 rgb_matrix_set_color(52, 0xFF, 0x00, 0x00); 101 _______, _______, _______, _______, _______, WHITE, _______, _______, CORAL, _______, CORAL
103 rgb_matrix_set_color(53, 0xFF, 0x00, 0x00); 102 },
104 rgb_matrix_set_color(54, 0xFF, 0x00, 0x00);
105 // home/end
106 rgb_matrix_set_color(35, 0x00, 0xFF, 0x00);
107 rgb_matrix_set_color(37, 0x00, 0xFF, 0x00);
108 // pgup/dn
109 rgb_matrix_set_color(34, 0x00, 0x00, 0xFF);
110 rgb_matrix_set_color(51, 0x00, 0x00, 0xFF);
111 // numpad
112 rgb_matrix_set_color(23, 0xFF, 0xFF, 0x00);
113 rgb_matrix_set_color(24, 0xFF, 0xFF, 0x00);
114 rgb_matrix_set_color(25, 0xFF, 0xFF, 0x00);
115 rgb_matrix_set_color(40, 0xFF, 0xFF, 0x00);
116 rgb_matrix_set_color(42, 0xFF, 0xFF, 0x00);
117 rgb_matrix_set_color(57, 0xFF, 0xFF, 0x00);
118 rgb_matrix_set_color(58, 0xFF, 0xFF, 0x00);
119 rgb_matrix_set_color(59, 0xFF, 0xFF, 0x00);
120 // zero
121 rgb_matrix_set_color(69, 0xFF, 0x00, 0x00);
122 rgb_matrix_set_color(70, 0xFF, 0x00, 0x00);
123 rgb_matrix_set_color(71, 0xFF, 0x00, 0x00);
124 // dot
125 rgb_matrix_set_color(72, 0x00, 0x00, 0xFF);
126 // math shit
127 rgb_matrix_set_color(26, 0x00, 0x00, 0xFF);
128 rgb_matrix_set_color(27, 0x00, 0x00, 0xFF);
129 rgb_matrix_set_color(28, 0x00, 0x00, 0xFF);
130 rgb_matrix_set_color(43, 0x00, 0x00, 0xFF);
131 rgb_matrix_set_color(46, 0x00, 0x00, 0xFF);
132 rgb_matrix_set_color(60, 0x00, 0x00, 0xFF);
133 rgb_matrix_set_color(61, 0x00, 0x00, 0xFF);
134 rgb_matrix_set_color(73, 0x00, 0x00, 0xFF);
135 break;
136
137 case _FNC: {
138 HSV hsv = { rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v };
139 HSV hui = hsv;
140 HSV hud = hsv;
141 HSV sai = hsv;
142 HSV sad = hsv;
143 HSV vai = hsv;
144 HSV vad = hsv;
145 hui.h = hsv.h + 8;
146 hud.h = hsv.h - 8;
147 sai.s = hsv.s + 16 > 255 ? 255u : hsv.s + 16;
148 sad.s = hsv.s - 16 < 0 ? 0 : hsv.s - 16;
149 vai.v = hsv.v + 16 > 255 ? 255 : hsv.v + 16;
150 vad.v = hsv.v - 16 < 0 ? 0 : hsv.v - 16;
151 RGB rgb = hsv_to_rgb(hsv);
152 RGB rgbHUI = hsv_to_rgb(hui);
153 RGB rgbHUD = hsv_to_rgb(hud);
154 RGB rgbSAI = hsv_to_rgb(sai);
155 RGB rgbSAD = hsv_to_rgb(sad);
156 RGB rgbVAI = hsv_to_rgb(vai);
157 RGB rgbVAD = hsv_to_rgb(vad);
158 rgb_matrix_set_color(81, 0xFF, 0xFF, 0xFF); // layer indicator
159 rgb_matrix_set_color(91, 0xFF, 0xFF, 0xFF);
160 rgb_matrix_set_color(93, 0x00, 0x00, 0x00);
161 rgb_matrix_set_color(94, rgb.r, rgb.g, rgb.b);
162 rgb_matrix_set_color(95, rgb.r, rgb.g, rgb.b);
163 rgb_matrix_set_color(96, 0x00, 0x00, 0x00);
164 rgb_matrix_set_color(68, 0xFF, 0x00, 0x00); // MD_BOOT
165 rgb_matrix_set_color(69, 0xFF, 0x00, 0x40); // TG_NKRO
166 rgb_matrix_set_color(32, 0x00, 0x80, 0xFF); // KC_VOLU
167 rgb_matrix_set_color(49, 0x00, 0x80, 0xFF);
168 rgb_matrix_set_color(13, 0xFF, 0x00, 0x00); // KC_MUTE
169 rgb_matrix_set_color(30, 0xFF, 0x00, 0x00); // KC_MSTP
170 rgb_matrix_set_color(47, 0xFF, 0x40, 0x00); // KC_MPRV
171 rgb_matrix_set_color(48, 0xFF, 0x40, 0x00);
172 rgb_matrix_set_color(14, 0x00, 0xFF, 0x00); // KC_MSEL
173 rgb_matrix_set_color(31, 0x00, 0xFF, 0x00); // KC_MPLY
174
175 if (this_led & (1 << !autoshift_enabled)) {
176 rgb_matrix_set_color(15, 0xFF, 0x00, 0x00); // KC_ASTG
177 } else {
178 rgb_matrix_set_color(15, 0xFF, 0xFF, 0x00);
179 }
180
181 rgb_matrix_set_color(44, 0xFF, 0x80, 0x00); //RGB_MOD
182 rgb_matrix_set_color(45, 0xFF, 0x80, 0x00);
183 rgb_matrix_set_color(34, 0xFF, 0x80, 0x00); //RGB_MOD
184 rgb_matrix_set_color(51, 0xFF, 0x80, 0x00);
185 rgb_matrix_set_color(63, 0xFF, 0x40, 0x00); //RGB_TOG
186 rgb_matrix_set_color(64, rgb.r, rgb.g, rgb.b); //MAS_TOG
187 rgb_matrix_set_color(36, rgbHUI.r, rgbHUI.g, rgbHUI.b); //RGB_HUI
188 rgb_matrix_set_color(53, rgbHUD.r, rgbHUD.g, rgbHUD.b);
189 rgb_matrix_set_color(37, rgbSAI.r, rgbSAI.g, rgbSAI.b); //RGB_SAI
190 rgb_matrix_set_color(54, rgbSAD.r, rgbSAD.g, rgbSAD.b);
191 rgb_matrix_set_color(38, rgbVAI.r, rgbVAI.g, rgbVAI.b); //RGB_VAI
192 rgb_matrix_set_color(55, rgbVAD.r, rgbVAD.g, rgbVAD.b);
193 rgb_matrix_set_color(79, rgb.r, rgb.g, rgb.b); // config display
194 rgb_matrix_set_color(75, rgbVAI.r, rgbVAI.g, rgbVAI.b); //RGB_VAI
195 rgb_matrix_set_color(85, rgbVAD.r, rgbVAD.g, rgbVAD.b);
196 rgb_matrix_set_color(35, 0x80, 0x80, 0x80); //RGB_SPI
197 rgb_matrix_set_color(52, 0x80, 0x80, 0x80);
198 rgb_matrix_set_color(84, 0x80, 0x80, 0x80); //RGB_SPI
199 rgb_matrix_set_color(86, 0x80, 0x80, 0x80);
200 rgb_matrix_set_color(41, 0xF0, 0x00, 0xFF); //MAS_MGT
201 rgb_matrix_set_color(42, 0x00, 0x02, 0xFF); //MAS_BLU
202 rgb_matrix_set_color(57, 0xFF, 0x00, 0x00); //MAS_RED
203 rgb_matrix_set_color(58, 0x00, 0x00, 0x00); //MAS_KEY
204 rgb_matrix_set_color(59, 0x00, 0xFF, 0xF7); //MAS_CYN
205 rgb_matrix_set_color(70, 0xFF, 0xDA, 0x00); //MAS_YEL
206 rgb_matrix_set_color(71, 0x00, 0xFF, 0x01); //MAS_GRN
207 rgb_matrix_set_color(72, 0xFF, 0xA5, 0x18); //MAS_CRM
208 rgb_matrix_set_color(60, 0x81, 0x3C, 0xFF); //MAS_PRP
209 rgb_matrix_set_color(43, 0xFF, 0xFF, 0xFF); //MAS_WHT
210 }
211 break;
212 }
213 }
214}
215
216// Runs just one time when the keyboard initializes.
217void matrix_init_user(void)
218{
219 autoshift_disable();
220 rgb_matrix_sethsv(128, 255, 255);
221 // rgb_matrix_sethsv(192, 112, 255);
222 // rgb_matrix_mode(4);
223}; 103};
104# undef _______
105# define _______ KC_TRNS
106#endif
107// clang-format on
224 108
225// Runs constantly in the background, in a loop. 109// Runs just one time when the keyboard initializes.
226void matrix_scan_user(void) 110void matrix_init_user(void) {
227{ 111 rgb_enabled_flag = true; // Initially, keyboard RGB is enabled. Change to false config.h initializes RGB disabled.
228}; 112};
229 113
230#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT)) 114void keyboard_post_init_user(void) { rgb_matrix_enable(); }
231#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL))
232#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT))
233
234bool process_record_user(uint16_t keycode, keyrecord_t* record)
235{
236 static uint32_t key_timer;
237
238 switch (keycode) {
239 case U_T_AUTO:
240 if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
241 TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode");
242 }
243
244 return false;
245
246 case U_T_AGCR:
247 if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
248 TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode");
249 }
250
251 return false;
252
253 case DBG_TOG:
254 if (record->event.pressed) {
255 TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode");
256 }
257
258 return false;
259
260 case DBG_MTRX:
261 if (record->event.pressed) {
262 TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix");
263 }
264
265 return false;
266
267 case DBG_KBD:
268 if (record->event.pressed) {
269 TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard");
270 }
271
272 return false;
273
274 case DBG_MOU:
275 if (record->event.pressed) {
276 TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse");
277 }
278 115
279 return false; 116// Runs constantly in the background, in a loop.
280 117void matrix_scan_user(void){};
281 case MD_BOOT: 118
282 if (record->event.pressed) { 119bool process_record_user(uint16_t keycode, keyrecord_t *record) {
283 key_timer = timer_read32(); 120 static uint32_t key_timer;
284 } else { 121 switch (keycode) {
285 if (timer_elapsed32(key_timer) >= 500) { 122 case U_T_AUTO:
286 reset_keyboard(); 123 if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
287 } 124 TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode");
288 } 125 }
289 126 return false;
290 return false; 127 case U_T_AGCR:
291 128 if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
292 case MAS_TOG: 129 TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode");
293 if (record->event.pressed) { 130 }
294 switch (rgb_matrix_get_flags()) { 131 return false;
295 case LED_FLAG_ALL: { 132 case MD_BOOT:
296 rgb_matrix_set_flags(LED_FLAG_KEYLIGHT); 133 if (record->event.pressed) {
297 rgb_matrix_set_color_all(0, 0, 0); 134 key_timer = timer_read32();
298 } 135 } else {
299 break; 136 if (timer_elapsed32(key_timer) >= 500) {
300 137 reset_keyboard();
301 case LED_FLAG_KEYLIGHT: { 138 }
302 rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); 139 }
303 rgb_matrix_set_color_all(0, 0, 0); 140 return false;
304 } 141 }
305 break; 142
306 143 if (record->event.pressed) {
307 case LED_FLAG_UNDERGLOW: { 144 switch (keycode) {
308 rgb_matrix_set_flags(LED_FLAG_NONE); 145 case DBG_TOG:
309 rgb_matrix_disable_noeeprom(); 146 TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode");
310 } 147 return false;
311 break; 148 case DBG_MTRX:
312 149 TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix");
313 default: { 150 return false;
314 rgb_matrix_set_flags(LED_FLAG_ALL); 151 case DBG_KBD:
315 } 152 TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard");
316 break; 153 return false;
317 } 154 case DBG_MOU:
318 } 155 TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse");
319 156 return false;
320 return false; 157 case RGB_TOG:
321 158 switch (rgb_matrix_get_flags()) {
322 case MAS_CRM: 159 case LED_FLAG_ALL: {
323 if (record->event.pressed) { 160 rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER);
324 rgb_matrix_sethsv(32, 160, 255); 161 rgb_matrix_set_color_all(0, 0, 0);
325 } 162 } break;
326 163 case LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER: {
327 return false; 164 rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
328 165 rgb_matrix_set_color_all(0, 0, 0);
329 case MAS_PRP: 166 } break;
330 if (record->event.pressed) { 167 case LED_FLAG_UNDERGLOW: {
331 rgb_matrix_sethsv(192, 112, 255); 168 // This line is for LED idle timer. It disables the toggle so you can turn off LED completely if you like
332 } 169 rgb_matrix_set_flags(LED_FLAG_NONE);
333 170 rgb_matrix_disable_noeeprom();
334 return false; 171 } break;
335 172 default: {
336 case MAS_RED: 173 rgb_matrix_set_flags(LED_FLAG_ALL);
337 if (record->event.pressed) { 174 rgb_matrix_enable_noeeprom();
338 rgb_matrix_sethsv(0, 255, 255); 175 } break;
339 } 176 }
340 177 return false;
341 return false; 178 // ======================================================== CUSTOM KEYCOADS BELOW ========================================================
342 179 case MAS_CRM:
343 case MAS_GRN: 180 rgb_matrix_sethsv(HSV_CREAM);
344 if (record->event.pressed) { 181 return false;
345 rgb_matrix_sethsv(88, 255, 255); 182 case MAS_PRP:
346 } 183 rgb_matrix_sethsv(HSV_9B59B5);
347 184 return false;
348 return false; 185 case MAS_RED:
349 186 rgb_matrix_sethsv(HSV_RED);
350 case MAS_BLU: 187 return false;
351 if (record->event.pressed) { 188 case MAS_GRN:
352 rgb_matrix_sethsv(168, 255, 255); 189 rgb_matrix_sethsv(HSV_GREEN);
353 } 190 return false;
354 191 case MAS_BLU:
355 return false; 192 rgb_matrix_sethsv(HSV_BLUE);
356 193 return false;
357 case MAS_CYN: 194 case MAS_CYN:
358 if (record->event.pressed) { 195 rgb_matrix_sethsv(HSV_CYAN);
359 rgb_matrix_sethsv(128, 255, 255); 196 return false;
360 } 197 case MAS_MGT:
361 198 rgb_matrix_sethsv(HSV_MAGENTA);
362 return false; 199 return false;
363 200 case MAS_YEL:
364 case MAS_MGT: 201 rgb_matrix_sethsv(HSV_YELLOW);
365 if (record->event.pressed) { 202 return false;
366 rgb_matrix_sethsv(216, 255, 255); 203 case MAS_KEY:
367 } 204 rgb_matrix_sethsv(0, 0, 0);
368 205 return false;
369 return false; 206 case MAS_WHT:
370 207 rgb_matrix_sethsv(128, 0, 255);
371 case MAS_YEL: 208 return false;
372 if (record->event.pressed) { 209 default:
373 rgb_matrix_sethsv(40, 255, 255); 210 return true; // Process all other keycodes normally
374 } 211 }
375 212 }
376 return false; 213 return true;
377 214}
378 case MAS_KEY:
379 if (record->event.pressed) {
380 rgb_matrix_sethsv(0, 0, 0);
381 }
382
383 return false;
384
385 case MAS_WHT:
386 if (record->event.pressed) {
387 rgb_matrix_sethsv(128, 0, 255);
388 }
389
390 return false;
391 215
392 default: 216void set_layer_color(int layer) {
393 return true; //Process all other keycodes normally 217 if (layer == 0) {
394 } 218 return;
219 }
220 for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
221 HSV hsv = {
222 .h = pgm_read_byte(&ledmap[layer][i][0]),
223 .s = pgm_read_byte(&ledmap[layer][i][1]),
224 .v = pgm_read_byte(&ledmap[layer][i][2]),
225 };
226 if (hsv.h || hsv.s || hsv.v) {
227 RGB rgb = hsv_to_rgb(hsv);
228 float f = (float)rgb_matrix_config.hsv.v / UINT8_MAX;
229 rgb_matrix_set_color(i, f * rgb.r, f * rgb.g, f * rgb.b);
230 } else if (layer == _FL) {
231 HSV hsv2 = {rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v};
232 HSV hui = hsv2;
233 HSV hud = hsv2;
234 HSV sai = hsv2;
235 HSV sad = hsv2;
236 HSV vai = hsv2;
237 HSV vad = hsv2;
238 hui.h = hsv2.h + 8;
239 hud.h = hsv2.h - 8;
240 sai.s = hsv2.s + 16 > 255 ? 255 : hsv2.s + 16;
241 sad.s = hsv2.s - 16 < 0 ? 0 : hsv2.s - 16;
242 vai.v = hsv2.v + 16 > 255 ? 255 : hsv2.v + 16;
243 vad.v = hsv2.v - 16 < 0 ? 0 : hsv2.v - 16;
244 RGB rgbHUI = hsv_to_rgb(hui);
245 RGB rgbHUD = hsv_to_rgb(hud);
246 RGB rgbSAI = hsv_to_rgb(sai);
247 RGB rgbSAD = hsv_to_rgb(sad);
248 RGB rgbVAI = hsv_to_rgb(vai);
249 RGB rgbVAD = hsv_to_rgb(vad);
250
251 switch (i) {
252 case 36:
253 rgb_matrix_set_color(i, rgbHUI.r, rgbHUI.g, rgbHUI.b);
254 break;
255 case 53:
256 rgb_matrix_set_color(i, rgbHUD.r, rgbHUD.g, rgbHUD.b);
257 break;
258 case 54:
259 rgb_matrix_set_color(i, rgbSAI.r, rgbSAI.g, rgbSAI.b);
260 break;
261 case 37:
262 rgb_matrix_set_color(i, rgbSAD.r, rgbSAD.g, rgbSAD.b);
263 break;
264 case 38:
265 rgb_matrix_set_color(i, rgbVAI.r, rgbVAI.g, rgbVAI.b);
266 break;
267 case 55:
268 rgb_matrix_set_color(i, rgbVAD.r, rgbVAD.g, rgbVAD.b);
269 break;
270 case 75:
271 rgb_matrix_set_color(i, rgbVAI.r, rgbVAI.g, rgbVAI.b);
272 break;
273 case 85:
274 rgb_matrix_set_color(i, rgbVAD.r, rgbVAD.g, rgbVAD.b);
275 break;
276 }
277 }
278 }
395} 279}
396 280
281void rgb_matrix_indicators_user(void) {
282 if (g_suspend_state || disable_layer_color || rgb_matrix_get_flags() == LED_FLAG_NONE || rgb_matrix_get_flags() == LED_FLAG_UNDERGLOW) {
283 return;
284 }
285 set_layer_color(get_highest_layer(layer_state));
286}
diff --git a/keyboards/massdrop/ctrl/keymaps/matthewrobo/keymap.h b/keyboards/massdrop/ctrl/keymaps/matthewrobo/keymap.h
new file mode 100644
index 000000000..e37f0d60f
--- /dev/null
+++ b/keyboards/massdrop/ctrl/keymaps/matthewrobo/keymap.h
@@ -0,0 +1,86 @@
1/*
2QMK Firmware Massdrop CTRL M-AS Keymap
3Copyright (C) 2020 matthewrobo
4
5This program is free software: you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 3 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#include QMK_KEYBOARD_H
20
21// HID has not yet been implemented for this keyboard
22// #include "raw_hid.h"
23
24#define MILLISECONDS_IN_SECOND 1000
25
26// These are just to make it neater to use builtin HSV values in the keymap
27// clang-format off
28#define WHITE {HSV_WHITE}
29#define RED {HSV_RED}
30#define CORAL {HSV_CORAL}
31#define ORANGE {HSV_ORANGE}
32#define GOLDEN {HSV_GOLDENROD}
33#define GOLD {HSV_GOLD}
34#define YELLOW {HSV_YELLOW}
35#define CHART {HSV_CHARTREUSE}
36#define GREEN {HSV_GREEN}
37#define SPRING {HSV_SPRINGGREEN}
38#define TURQ {HSV_TURQUOISE}
39#define TEAL {HSV_TEAL}
40#define CYAN {HSV_CYAN}
41#define AZURE {HSV_AZURE}
42#define BLUE {HSV_BLUE}
43#define PURPLE {HSV_PURPLE}
44#define MAGENT {HSV_MAGENTA}
45#define PINK {HSV_PINK}
46#define HSV_CREAM 24, 240, 255
47#define CREAM {HSV_CREAM}
48#define HSV_9B59B5 208, 192, 255
49#define M9B59B5 {HSV_9B59B5}
50// clang-format on
51
52#define LT_CAPS LT(_NL, KC_CAPS)
53#define _LAYER_ KC_TRNS
54
55//========================================================== CONFIGURABLE DEFAULTS ==========================================================
56extern bool g_suspend_state;
57extern rgb_config_t rgb_matrix_config;
58bool disable_layer_color;
59
60bool rgb_enabled_flag; // Current LED state flag. If false then LED is off.
61
62enum layout_names {
63 _KL = 0, // Keys Layout: The main keyboard layout that has all the characters
64 _NL, // Navigation Layout: Cursor keys and numpad inputs
65 _FL, // Function Layout: The function key activated layout with default functions and some added ones
66};
67
68enum ctrl_keycodes {
69 U_T_AUTO = SAFE_RANGE, // USB Extra Port Toggle Auto Detect / Always Active
70 U_T_AGCR, // USB Toggle Automatic GCR control
71 DBG_TOG, // DEBUG Toggle On / Off
72 DBG_MTRX, // DEBUG Toggle Matrix Prints
73 DBG_KBD, // DEBUG Toggle Keyboard Prints
74 DBG_MOU, // DEBUG Toggle Mouse Prints
75 MD_BOOT, // Restart into bootloader after hold timeout
76 MAS_CRM,
77 MAS_PRP,
78 MAS_RED,
79 MAS_GRN,
80 MAS_BLU,
81 MAS_CYN,
82 MAS_MGT,
83 MAS_YEL,
84 MAS_KEY,
85 MAS_WHT,
86};
diff --git a/keyboards/massdrop/ctrl/keymaps/matthewrobo/readme.md b/keyboards/massdrop/ctrl/keymaps/matthewrobo/readme.md
new file mode 100644
index 000000000..380d078e2
--- /dev/null
+++ b/keyboards/massdrop/ctrl/keymaps/matthewrobo/readme.md
@@ -0,0 +1,14 @@
1# Massdrop CTRL - M-AS
2
3Based on the ["endgame" keymap](https://github.com/qmk/qmk_firmware/tree/master/keyboards/massdrop/ctrl/keymaps/endgame).
4
5## Layers
6
7### Base Layer
8![Base Layer](https://i.imgur.com/qMXpYUb.png)
9
10### Navigation Layer
11![Navigation Layer](https://i.imgur.com/RSp12Sh.png)
12
13### Function Layer
14![Function Layer](https://i.imgur.com/dp7zs0I.png)
diff --git a/keyboards/massdrop/ctrl/keymaps/matthewrobo/rgb_matrix_user.inc b/keyboards/massdrop/ctrl/keymaps/matthewrobo/rgb_matrix_user.inc
new file mode 100644
index 000000000..d837502ca
--- /dev/null
+++ b/keyboards/massdrop/ctrl/keymaps/matthewrobo/rgb_matrix_user.inc
@@ -0,0 +1,51 @@
1/*
2QMK Firmware Massdrop CTRL M-AS Keymap
3Copyright (C) 2020 matthewrobo
4
5This program is free software: you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 3 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19// !!! DO NOT ADD #pragma once !!! //
20
21// Step 1.
22// Declare custom effects using the RGB_MATRIX_EFFECT macro
23// (note the lack of semicolon after the macro!)
24RGB_MATRIX_EFFECT(SOLID_REACTIVE_WIDE2)
25RGB_MATRIX_EFFECT(SOLID_REACTIVE_MULTIWIDE2)
26RGB_MATRIX_EFFECT(SOLID_REACTIVE_NEXUS2)
27RGB_MATRIX_EFFECT(SOLID_REACTIVE_MULTINEXUS2)
28
29// Step 2.
30// Define effects inside the `RGB_MATRIX_CUSTOM_EFFECT_IMPLS` ifdef block
31#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
32
33static HSV SOLID_REACTIVE_WIDE_math2(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint16_t tick) {
34 uint16_t effect = tick - dist > 255 || dist > 32 ? 255 : tick - dist;
35 hsv.v = qadd8(hsv.v, 255 - effect);
36 return hsv;
37}
38
39static HSV SOLID_REACTIVE_NEXUS_math2(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint16_t tick) {
40 uint16_t effect = tick - dist > 255 || ((dx > 8 || dx < -8) && (dy > 8 || dy < -8)) ? 255 : tick - dist;
41 hsv.v = qadd8(hsv.v, 255 - effect);
42 hsv.h = rgb_matrix_config.hsv.h + dy / 4;
43 return hsv;
44}
45
46bool SOLID_REACTIVE_WIDE2(effect_params_t* params) { return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_WIDE_math2); }
47bool SOLID_REACTIVE_MULTIWIDE2(effect_params_t* params) { return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_WIDE_math2); }
48bool SOLID_REACTIVE_NEXUS2(effect_params_t* params) { return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_NEXUS_math2); }
49bool SOLID_REACTIVE_MULTINEXUS2(effect_params_t* params) { return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_NEXUS_math2); }
50
51#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS
diff --git a/keyboards/massdrop/ctrl/keymaps/matthewrobo/rules.mk b/keyboards/massdrop/ctrl/keymaps/matthewrobo/rules.mk
index 063d135a0..1eb11fded 100644
--- a/keyboards/massdrop/ctrl/keymaps/matthewrobo/rules.mk
+++ b/keyboards/massdrop/ctrl/keymaps/matthewrobo/rules.mk
@@ -1,3 +1,17 @@
1NKRO_ENABLE = yes # USB Nkey Rollover 1#RGBLIGHT_ENABLE = no #Not for MD boards.This is here in case you forget.
2AUTO_SHIFT_ENABLE = yes # Auto Shift 2COMMAND_ENABLE = no # Commands for debug and configuration
3SRC += config_led.c 3#BOOTMAGIC_ENABLE = full #Virtual DIP switch configuration
4#BOOTMAGIC_ENABLE = lite
5#AUTO_SHIFT_ENABLE = yes #Auto Shift
6NKRO_ENABLE = yes # USB Nkey Rollover
7DYNAMIC_MACRO_ENABLE = no # Dynamic macro recording and play
8MOUSEKEY_ENABLE = no # Enable mouse control keycodes. Increases firmware size.
9TAP_DANCE_ENABLE = no # Enable tap dance keys
10CONSOLE_ENABLE = no # Enable debugging console. Increases firmware size.
11SRC += config_led.c # Used to add files to the compilation/linking list.
12TERMINAL_ENABLE = no
13EXTRAKEY_ENABLE = yes # Audio control and System control
14#RAW_ENABLE = yes #Raw HID has not yet been implemented for this keyboard
15#COMBO_ENABLE #Key combo feature
16#LEADER_ENABLE #Enable leader key chording
17RGB_MATRIX_CUSTOM_USER = yes