1
0
Fork 0

Added massdrop/ctrl:xanimos keymap (#16187)

Co-authored-by: xanimos <dan@xanimos.com>
This commit is contained in:
Daniel Weeks 2022-04-22 01:19:06 -07:00 committed by GitHub
parent 56b125ad77
commit 8020950976
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 982 additions and 0 deletions

View file

@ -0,0 +1,132 @@
/* Copyright 2022 Daniel Weeks (@xanimos)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#define MODS_SHIFT (get_mods() & MOD_MASK_SHIFT)
#define MODS_CTRL (get_mods() & MOD_MASK_CTRL)
#define MODS_ALT (get_mods() & MOD_MASK_ALT)
// #define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT) // Key combination that allows the use of magic commands (useful for debugging)
// #define NO_DEBUG // Disable debugging
// #define NO_PRINT // Disable printing/debugging using hid_listen
// #define NO_ACTION_LAYER // Disable layers
// #define NO_ACTION_TAPPING // Disable tap dance and other tapping features
// #define NO_ACTION_ONESHOT // Disable one-shot modifiers
// #define NO_ACTION_MACRO // Disable old style macro handling: MACRO() & action_get_macro
#define TERMINAL_HELP
#define MOUSEKEY_INTERVAL 20
#define MOUSEKEY_DELAY 0
#define MOUSEKEY_TIME_TO_MAX 60
#define MOUSEKEY_MAX_SPEED 10
#define MOUSEKEY_WHEEL_DELAY 0
#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.
// #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.
// #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)
// #define LOCKING_SUPPORT_ENABLE // Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap
// #define LOCKING_RESYNC_ENABLE // Tries to keep switch state consistent with keyboard LED state
#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
// #define TAPPING_TERM_PER_KEY // Enables handling for per key TAPPING_TERM settings
// #define RETRO_TAPPING // Tap anyway, even after TAPPING_TERM, if there was no other key interruption between press and release
#define TAPPING_TOGGLE 2 // How many taps before triggering the toggle
// #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
// #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
// #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)
// #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.
// #define LEADER_PER_KEY_TIMING // Sets the timer for leader key chords to run on each key press rather than overall
// #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.
// #define ONESHOT_TIMEOUT 300 // How long before oneshot times out
// #define ONESHOT_TAP_TOGGLE 2 // How many taps before oneshot toggle is triggered
// #define COMBO_COUNT 2 // Set this to the number of combos that you're using in the Combo feature.
// #define COMBO_TERM 200 // How long for the Combo keys to be detected. Defaults to TAPPING_TERM if not defined.
// #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.
// #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.
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
#define RGB_MATRIX_KEYPRESSES // reacts to keypresses
// #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_ALPHAS_MODS // Sets the default mode, if none has been set
// #define RGBLIGHT_HUE_STEP 12 // Units to step when in/decreasing hue
// #define RGBLIGHT_SAT_STEP 25 // Units to step when in/decreasing saturation
// #define RGBLIGHT_VAL_STEP 12 // Units to step when in/decreasing value (brightness)
// #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
// #define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
// #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)
// #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)
// #define RGBLIGHT_ANIMATIONS // Run RGB animations
// #define RGBLIGHT_ANIMATIONS // Enable all additional animation modes.
// #define RGBLIGHT_EFFECT_ALTERNATING // Enable alternating animation mode.
#define RGBLIGHT_EFFECT_BREATHING // Enable breathing animation mode.
// #define RGBLIGHT_EFFECT_CHRISTMAS // Enable christmas animation mode.
#define RGBLIGHT_EFFECT_KNIGHT // Enable knight animation mode.
// #define RGBLIGHT_EFFECT_RAINBOW_MOOD // Enable rainbow mood animation mode.
// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL // Enable rainbow swirl animation mode.
// #define RGBLIGHT_EFFECT_RGB_TEST // Enable RGB test animation mode.
#define RGBLIGHT_EFFECT_SNAKE // Enable snake animation mode.
// #define RGBLIGHT_EFFECT_STATIC_GRADIENT // Enable static gradient mode.
// #define RGBLIGHT_EFFECT_BREATHE_CENTER // If defined, used to calculate the curve for the breathing animation. Valid values are 1.0 to 2.7
// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // The maximum brightness for the breathing mode. Valid values are 1 to 255
// #define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 1000 // How long to wait between light changes for the "Christmas" animation, in milliseconds
// #define RGBLIGHT_EFFECT_CHRISTMAS_STEP 2 // The number of LEDs to group the red/green colors by for the "Christmas" animation
#define RGBLIGHT_EFFECT_KNIGHT_LED_NUM RGBLED_NUM // The number of LEDs to have the "Knight" animation travel
#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3 // The number of LEDs to light up for the "Knight" animation
#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 0 // The number of LEDs to start the "Knight" animation from the start of the strip by
// #define RGBLIGHT_RAINBOW_SWIRL_RANGE 255 // Range adjustment for the rainbow swirl effect to get different swirls
#define RGBLIGHT_EFFECT_SNAKE_LENGTH 4 // The number of LEDs to light up for the "Snake" animation
// This list in in the correct mode order. Next mode is the following line, previous mode is previous line. Loops around.
// #undef ENABLE_RGB_MATRIX_SOLID_COLOR // Static single hue, no speed support
// #undef ENABLE_RGB_MATRIX_ALPHAS_MODS // Static dual hue, speed is hue for secondary hue
// #undef ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN // Static gradient top to bottom, speed controls how much gradient changes
#undef ENABLE_RGB_MATRIX_BREATHING // Single hue brightness cycling animation
#undef ENABLE_RGB_MATRIX_BAND_SAT // Single hue band fading saturation scrolling left to right
#undef ENABLE_RGB_MATRIX_BAND_VAL // Single hue band fading brightness scrolling left to right
#undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT // Single hue 3 blade spinning pinwheel fades saturation
#undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL // Single hue 3 blade spinning pinwheel fades brightness
#undef ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT // Single hue spinning spiral fades saturation
#undef ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL // Single hue spinning spiral fades brightness
// #undef ENABLE_RGB_MATRIX_CYCLE_ALL // Full keyboard solid hue cycling through full gradient
#undef ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT // Full gradient scrolling left to right
#undef ENABLE_RGB_MATRIX_CYCLE_UP_DOWN // Full gradient scrolling top to bottom
#undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN // Full gradient scrolling out to in
#undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL // Full dual gradients scrolling out to in
// #undef ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON // Full gradent Chevron shapped scrolling left to right
#undef ENABLE_RGB_MATRIX_CYCLE_PINWHEEL // Full gradient spinning pinwheel around center of keyboard
#undef ENABLE_RGB_MATRIX_CYCLE_SPIRAL // Full gradient spinning spiral around center of keyboard
#undef ENABLE_RGB_MATRIX_DUAL_BEACON // Full gradient spinning around center of keyboard
#undef ENABLE_RGB_MATRIX_RAINBOW_BEACON // Full tighter gradient spinning around center of keyboard
#undef ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS // Full dual gradients spinning two halfs of keyboard
// #undef ENABLE_RGB_MATRIX_RAINDROPS // Randomly changes a single key's hue
// #undef ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS // Randomly changes a single key's hue and saturation
// =================================================== Requires RGB_MATRIX_FRAMEBUFFER_EFFECTS =============================================================
// #undef ENABLE_RGB_MATRIX_TYPING_HEATMAP // How hot is your WPM!
// #undef ENABLE_RGB_MATRIX_DIGITAL_RAIN // That famous computer simulation
// =================================================== RGB_MATRIX_KEYPRESSES OR RGB_MATRIX_KEYRELEASES =====================================================
// #undef ENABLE_RGB_MATRIX_SOLID_REACTIVE // Static single hue, pulses keys hit to shifted hue then fades to current hue
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE // Pulses keys hit to hue & value then fades value out
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE // Hue & value pulse near a single key hit then fades value out
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE // Hue & value pulse near multiple key hits then fades value out
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS // Hue & value pulse the same column and row of a single key hit then fades value out
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS // Hue & value pulse the same column and row of multiple key hits then fades value out
// #undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS // Hue & value pulse away on the same column and row of a single key hit then fades value out
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS // Hue & value pulse away on the same column and row of multiple key hits then fades value out
// #undef ENABLE_RGB_MATRIX_SPLASH // Full gradient & value pulse away from a single key hit then fades value out
#undef ENABLE_RGB_MATRIX_MULTISPLASH // Full gradient & value pulse away from multiple key hits then fades value out
// #undef ENABLE_RGB_MATRIX_SOLID_SPLASH // Hue & value pulse away from a single key hit then fades value out
#undef ENABLE_RGB_MATRIX_SOLID_MULTISPLASH // Hue & value pulse away from multiple key hits then fades value out

View file

@ -0,0 +1,97 @@
/* Copyright 2022 Daniel Weeks (@xanimos)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef RGB_MATRIX_ENABLE
#include "ctrl.h"
#include "md_rgb_matrix.h"
#include "rgb_matrix.h"
#include "config_led.h"
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
{ 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
{ 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
{ 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
{ 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
{ 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
{ 8, 59 }, { 23, 59 }, { 38, 59 }, { 83, 59 }, { 129, 59 }, { 144, 59 }, { 159, 59 }, { 174, 59 },
{ 193, 59 }, { 205, 59 }, { 217, 59 },
// Underglow / Border
{ 224, 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 }, { 224, 0 }, { 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
1, 4, 4, 4, 4, 1, 1, 1,
1, 4, 4, 4, 4, 1, 1, 1,
// 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, 1, 1, 1,
1,
// 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
1, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 1, 1,
1,
// 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, 1,
// 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
1, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 1, 1,
// KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
1, 1, 1, 4, 1, 1, 1, 1,
1, 1, 1,
// 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_advanced_kb(uint8_t led_min, uint8_t led_max) {
md_rgb_matrix_indicators_advanced(led_min, led_max);
}
#endif // USB_LED_INDICATOR_ENABLE
#endif

View file

@ -0,0 +1,410 @@
/* Copyright 2022 Daniel Weeks (@xanimos)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "keymap.h"
static uint16_t idle_timer; // Idle LED timeout timer
static uint8_t idle_second_counter; // Idle LED seconds counter, counts seconds not milliseconds
static uint8_t key_event_counter; // This counter is used to check if any keys are being held
static const char * sendstring_commands[] = {
"git init",
"git clone ",
"git add ",
"git diff ",
"git reset --soft ",
"git branch --list",
"git checkout ",
"git remote add ",
"git fetch ",
"git pull",
"git pull upstream ",
"git push",
"git push -u origin ",
"git push --force-with-lease",
"git commit ",
"git commit -m \": [TFS-]\"",
"git status",
"git log",
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_KL] = LAYOUT(
// ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 PRINT SCLCK PAUSE
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,RCS(KC_M),
// ~ 1 2 3 4 5 6 7 8 9 0 - = BCKSP INS HOME PGUP
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,
// TAB Q W E R T Y U I O P [ ] \ DEL END PGDN
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,
// CAPS A S D F G H J K L ; ' ENTER
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 ,
// SHIFT Z X C V B N M , . / RSHIFT UP
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 ,
// CTRL GUI ALT SPACE RALT MENU RGUI RCTRL LEFT DOWN RIGHT
KC_LCTRL, KC_LGUI, KC_LALT, KC_SPC, TD(TD_FN_SWITCH), KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
),
[_FL] = LAYOUT(
// ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 PRINT SCLCK PAUSE
_______, ROUT_TG, ROUT_FM, ROUT_VD, ROUT_VI, _______, _______, _______, _______, _______, _______, KC_WAKE, KC_SLEP, KC_PAUS, _______, KC_MUTE,
// ~ 1 2 3 4 5 6 7 8 9 0 - = BCKSP INS HOME PGUP
RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MSTP, KC_MPLY, KC_VOLU,
// TAB Q W E R T Y U I O P [ ] \ DEL END PGDN
_______, RGB_MOD, RGB_SPI, RGB_VAI, RGB_HUI, RGB_SAI, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD,
// CAPS A S D F G H J K L ; ' ENTER
_______,RGB_RMOD, RGB_SPD, RGB_VAD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______,
// SHIFT Z X C V B N M , . / RSHIFT UP
_______, _______, _______,COPY_ALL, _______, MD_BOOT, NK_TOGG, _______, _______, _______, _______, TOG_NPD, KC_BRIU,
// CTRL GUI ALT SPACE RALT MENU RGUI RCTRL LEFT DOWN RIGHT
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BRID, _______
),
[_GL] = LAYOUT(
// ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 PRINT SCLCK PAUSE
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
// ~ 1 2 3 4 5 6 7 8 9 0 - = BCKSP INS HOME PGUP
G_INIT, G_CLONE, G_REMTE, G_RESET, G_PSFWL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
// TAB Q W E R T Y U I O P [ ] \ DEL END PGDN
_______, G_PUPST, G_PULL, G_PSORG, G_PUSH, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
// CAPS A S D F G H J K L ; ' ENTER
_______, G_ADD, G_STAT, G_DIFF, G_FETCH, _______, _______, _______, _______, _______, _______, _______, _______,
// SHIFT Z X C V B N M , . / RSHIFT UP
_______, G_LOG, G_CHECK, G_COMM, G_COMSG, G_BRANH, _______, _______, _______, _______, _______, _______, _______,
// CTRL GUI ALT SPACE RALT MENU RGUI RCTRL LEFT DOWN RIGHT
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
[_NUMPAD] = LAYOUT(
// ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 PRINT SCLCK PAUSE
TOG_NPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
// ~ 1 2 3 4 5 6 7 8 9 0 - = BCKSP INS HOME PGUP
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
// TAB Q W E R T Y U I O P [ ] \ DEL END PGDN
_______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, _______, _______, _______, _______, _______, _______, _______, _______,
// CAPS A S D F G H J K L ; ' ENTER
_______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, _______, _______, _______, _______,
// SHIFT Z X C V B N M , . / RSHIFT UP
_______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PDOT, _______, _______, _______, _______,
// CTRL GUI ALT SPACE RALT MENU RGUI RCTRL LEFT DOWN RIGHT
_______, _______, _______, KC_P0, _______, _______, _______, _______, _______, _______, _______
),
/*
[X] = LAYOUT(
// ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 PRINT SCLCK PAUSE
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
// ~ 1 2 3 4 5 6 7 8 9 0 - = BCKSP INS HOME PGUP
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
// TAB Q W E R T Y U I O P [ ] \ DEL END PGDN
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
// CAPS A S D F G H J K L ; ' ENTER
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
// SHIFT Z X C V B N M , . / RSHIFT UP
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
// CTRL GUI ALT SPACE RALT MENU RGUI RCTRL LEFT DOWN RIGHT
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
*/
};
#define __OFF__ {0, 0, 0}
const uint8_t PROGMEM ledmap[][DRIVER_LED_TOTAL][3] = {
[_FL] = {
// These remain on base layer rgb to see adjustments ;)
// |----------------------------------|
// _______, ROUT_TG, ROUT_FM, ROUT_VD, ROUT_VI, _______, _______, _______, _______, _______, _______, KC_WAKE, KC_SLEP, KC_PAUS, _______, KC_MUTE,
__OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, YELLOW, YELLOW, ORANGE, __OFF__, GOLD,
// RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MSTP, KC_MPLY, KC_VOLU,
GOLD, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, RED, SPRING, ORANGE,
// _______, RGB_MOD, RGB_SPI, RGB_VAI, RGB_HUI, RGB_SAI, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD,
__OFF__, ORANGE, GREEN, AZURE, GOLDEN, MAGENT, __OFF__, AZURE, AZURE, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, TEAL, TEAL, ORANGE,
// _______,RGB_RMOD, RGB_SPD, RGB_VAD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______,
__OFF__, ORANGE, GREEN, AZURE, GOLDEN, MAGENT, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__,
// _______, _______, _______,COPY_ALL, _______, MD_BOOT, NK_TOGG, _______, _______, _______, _______, TO(_NUMPAD), KC_BRIU,
__OFF__, __OFF__, __OFF__, CORAL, __OFF__, RED, TURQ, __OFF__, __OFF__, __OFF__, __OFF__, CYAN, SPRING,
// _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BRID, _______
__OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, SPRING, __OFF__
},
[_GL] = {
// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
__OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__,
// G_INIT, G_CLONE, G_REMTE, G_RESET, G_PSFWL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
AZURE, CHART, CHART, RED, CORAL, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__,
// _______, G_PUPST, G_PULL, G_PSORG, G_PUSH, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
__OFF__, BLUE, PURPLE, MAGENT, PINK, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__,
// _______, G_ADD, G_STAT, G_DIFF, G_FETCH, _______, _______, _______, _______, _______, _______, _______, _______,
__OFF__, SPRING, GREEN, TURQ, TEAL, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__,
// _______, G_LOG, G_CHECK, G_COMM, G_COMSG, G_BRANH, _______, _______, _______, _______, _______, _______, _______,
__OFF__, CYAN, GOLDEN, YELLOW, GOLD, CHART, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__,
// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
__OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__
},
[_NUMPAD] = {
// TO(_KL), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
RED, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__,
// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
__OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__,
// _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, _______, _______, _______, _______, _______, _______, _______, _______,
__OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, GREEN, GREEN, GREEN, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__,
// _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, _______, _______, _______, _______,
__OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, TURQ, TURQ, TURQ, __OFF__, __OFF__, __OFF__, __OFF__,
// _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PDOT, _______, _______, _______,
__OFF__, __OFF__, __OFF__, __OFF__, __OFF__, CYAN, CYAN, CYAN, AZURE, __OFF__, __OFF__, __OFF__, __OFF__,
// _______, _______, _______, KC_P0, _______, _______, _______, _______, _______, _______, _______
__OFF__, __OFF__, __OFF__, CYAN, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__, __OFF__
},
};
// Runs just one time when the keyboard initializes.
void matrix_init_user(void) {
// Enable or disable debugging
debug_enable = false;
debug_matrix = false;
debug_keyboard = false;
debug_mouse = false;
idle_second_counter = 0; // Counter for number of seconds keyboard has been idle.
key_event_counter = 0; // Counter to determine if keys are being held, neutral at 0.
rgb_time_out_seconds = RGB_DEFAULT_TIME_OUT; // RGB timeout initialized to its default configure in keymap.h
rgb_time_out_enable = false; // Disable RGB timeout by default. Enable using toggle key.
rgb_time_out_user_value = false; // Has to have the same initial value as rgb_time_out_enable.
rgb_enabled_flag = true; // Initially, keyboard RGB is enabled. Change to false config.h initializes RGB disabled.
rgb_time_out_fast_mode_enabled = false; // RGB timeout fast mode disabled initially.
rgb_time_out_saved_flag = rgb_matrix_get_flags(); // Save RGB matrix state for when keyboard comes back from ide.
};
void keyboard_post_init_user(void) {
rgb_matrix_enable();
}
// Runs constantly in the background, in a loop.
void matrix_scan_user(void) {
if(rgb_time_out_enable && rgb_enabled_flag) {
// If the key event counter is not zero then some key was pressed down but not released, thus reset the timeout counter.
if (key_event_counter) {
idle_second_counter = 0;
} else if (timer_elapsed(idle_timer) > MILLISECONDS_IN_SECOND) {
idle_second_counter++;
idle_timer = timer_read();
}
if (idle_second_counter >= rgb_time_out_seconds) {
rgb_time_out_saved_flag = rgb_matrix_get_flags();
rgb_matrix_set_flags(LED_FLAG_NONE);
rgb_matrix_disable_noeeprom();
rgb_enabled_flag = false;
idle_second_counter = 0;
}
}
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
static uint32_t key_timer;
// Increment key event counter for every press and decrement for every release.
if (record->event.pressed) {
key_event_counter++;
} else {
key_event_counter--;
}
if (rgb_time_out_enable) {
idle_timer = timer_read();
// Reset the seconds counter. Without this, something like press> leave x seconds> press, would be x seconds on the effective counter not 0 as it should.
idle_second_counter = 0;
if (!rgb_enabled_flag) {
rgb_matrix_enable_noeeprom();
rgb_matrix_set_flags(rgb_time_out_saved_flag);
rgb_enabled_flag = true;
}
}
switch (keycode) {
case MD_BOOT:
if (record->event.pressed) {
key_timer = timer_read32();
} else {
if (timer_elapsed32(key_timer) >= 500) {
reset_keyboard();
}
}
return false;
}
if (record->event.pressed) {
switch (keycode) {
case RGB_TOG:
rgb_time_out_enable = rgb_time_out_user_value;
switch (rgb_matrix_get_flags()) {
case LED_FLAG_ALL: {
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER);
rgb_matrix_set_color_all(0, 0, 0);
}
break;
case LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER: {
rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
rgb_matrix_set_color_all(0, 0, 0);
}
break;
case LED_FLAG_UNDERGLOW: {
// This line is for LED idle timer. It disables the toggle so you can turn off LED completely if you like
rgb_time_out_enable = false;
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;
// ======================================================== CUSTOM KEYCOADS BELOW ========================================================
case COPY_ALL:
// Selects all and text and copy
SEND_STRING(SS_LCTRL("ac"));
return false;
case ROUT_TG:
// Toggle idle LED timeout on or off
rgb_time_out_enable = !rgb_time_out_enable;
rgb_time_out_user_value = rgb_time_out_enable;
return false;
case ROUT_VI:
// Increase idle LED timeout value in seconds
// Only increase if current value is lower than RGB_TIME_OUT_MAX. Don't care what value the result will be
// Modity RGB_TIME_OUT_STEP for bigger or smaller increments
if (!rgb_time_out_fast_mode_enabled && rgb_time_out_seconds <= RGB_TIME_OUT_MAX) {
rgb_time_out_seconds += RGB_TIME_OUT_STEP;
}
return false;
case ROUT_VD:
// Decrease idle LED timeout value in seconds
// Only decrease if current value is higher than minimum value and the result is larger than zero
// Modity RGB_TIME_OUT_STEP for bigger or smaller decrements
if (!rgb_time_out_fast_mode_enabled && rgb_time_out_seconds > RGB_TIME_OUT_MIN) {
rgb_time_out_seconds -= RGB_TIME_OUT_STEP;
}
return false;
case ROUT_FM:
if (rgb_time_out_fast_mode_enabled) {
rgb_time_out_seconds = rgb_time_out_saved_seconds;
} else {
rgb_time_out_saved_seconds = rgb_time_out_seconds;
rgb_time_out_seconds = RGB_FAST_MODE_TIME_OUT;
}
rgb_time_out_fast_mode_enabled = !rgb_time_out_fast_mode_enabled;
return false;
case G_INIT ... G_LOG:
send_string_with_delay(sendstring_commands[keycode - G_INIT], 5);
return false;
case TOG_NPD:
if (get_highest_layer(layer_state) != _NUMPAD) {
layer_move(_NUMPAD);
} else {
layer_move(_KL);
}
return false;
}
}
return true;
}
void set_layer_color(int layer) {
if (layer == 0) { return; }
for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
HSV hsv = {
.h = pgm_read_byte(&ledmap[layer][i][0]),
.s = pgm_read_byte(&ledmap[layer][i][1]),
.v = pgm_read_byte(&ledmap[layer][i][2]),
};
if (hsv.h || hsv.s || hsv.v) {
RGB rgb = hsv_to_rgb(hsv);
float f = (float)rgb_matrix_config.hsv.v / UINT8_MAX;
rgb_matrix_set_color(i, f * rgb.r, f * rgb.g, f * rgb.b);
continue;
}
if(layer == _FL && i <= 4 && i >= 1) {
continue; // Leave RGB for F1-F4 of function layer to adjust RGB settings
}
rgb_matrix_set_color(i, 0, 0, 0);
}
}
void rgb_matrix_indicators_user(void) {
if (disable_layer_color ||
rgb_matrix_get_flags() == LED_FLAG_NONE ||
rgb_matrix_get_flags() == LED_FLAG_UNDERGLOW) {
return;
}
set_layer_color(get_highest_layer(layer_state));
}
td_state_t cur_dance(qk_tap_dance_state_t *state) {
if (state->pressed && !state->interrupted) {
if (state->count == 1) { return TD_SINGLE_HOLD; }
return TD_DOUBLE_HOLD;
}
return TD_UNKNOWN;
}
static td_tap_t fn_tap_state = {
.is_press_action = true,
.state = TD_NONE
};
void fn_tap_finished(qk_tap_dance_state_t *state, void *user_data) {
fn_tap_state.state = cur_dance(state);
switch (fn_tap_state.state) {
case TD_SINGLE_HOLD:
// set function layer
layer_move(_FL);
break;
case TD_DOUBLE_HOLD:
// set git layer
layer_move(_GL);
break;
case TD_UNKNOWN:
register_code(KC_APP);
break;
default:
break;
}
}
void fn_tap_reset(qk_tap_dance_state_t *state, void *user_data) {
switch (fn_tap_state.state) {
case TD_UNKNOWN:
unregister_code(KC_APP);
break;
case TD_DOUBLE_HOLD:
case TD_SINGLE_HOLD:
// Set default layer if we didn't activate numpad layer in function
if (get_highest_layer(layer_state) != _NUMPAD) {
layer_move(_KL);
}
break;
break;
default:
break;
}
fn_tap_state.state = TD_NONE;
}
qk_tap_dance_action_t tap_dance_actions[] = {
[TD_FN_SWITCH] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, fn_tap_finished, fn_tap_reset)
};

View file

@ -0,0 +1,129 @@
/* Copyright 2022 Daniel Weeks (@xanimos)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
#include <print.h>
#include <string.h>
#define MILLISECONDS_IN_SECOND 1000
// These are just to make it neater to use builtin HSV values in the keymap
#define RED {HSV_RED}
#define CORAL {HSV_CORAL}
#define ORANGE {HSV_ORANGE}
#define GOLDEN {HSV_GOLDENROD}
#define GOLD {HSV_GOLD}
#define YELLOW {HSV_YELLOW}
#define CHART {HSV_CHARTREUSE}
#define GREEN {HSV_GREEN}
#define SPRING {HSV_SPRINGGREEN}
#define TURQ {HSV_TURQUOISE}
#define TEAL {HSV_TEAL}
#define CYAN {HSV_CYAN}
#define AZURE {HSV_AZURE}
#define BLUE {HSV_BLUE}
#define PURPLE {HSV_PURPLE}
#define MAGENT {HSV_MAGENTA}
#define PINK {HSV_PINK}
//========================================================== CONFIGURABLE DEFAULTS ==========================================================
#define RGB_DEFAULT_TIME_OUT 30
#define RGB_FAST_MODE_TIME_OUT 3
#define RGB_TIME_OUT_MAX 600
#define RGB_TIME_OUT_MIN 10
#define RGB_TIME_OUT_STEP 10
extern rgb_config_t rgb_matrix_config;
bool disable_layer_color;
bool rgb_enabled_flag; // Current LED state flag. If false then LED is off.
bool rgb_time_out_enable; // Idle LED toggle enable. If false then LED will not turn off after idle timeout.
bool rgb_time_out_fast_mode_enabled; // Enable flag for RGB timeout fast mode
bool rgb_time_out_user_value; // This holds the toggle value set by user with ROUT_TG. It's necessary as RGB_TOG changes timeout enable.
uint16_t rgb_time_out_seconds; // Idle LED timeout value, in seconds not milliseconds
uint16_t rgb_time_out_saved_seconds; // The saved user config for RGB timeout period
led_flags_t rgb_time_out_saved_flag; // Store LED flag before timeout so it can be restored when LED is turned on again.
enum layout_names {
_KL=0, // Keys Layout: The main keyboard layout that has all the characters
_FL, // Function Layout: The function key activated layout with default functions and some added ones
_GL, // GIT Layout: GIT shortcuts and macros
_NUMPAD, // Numpad Layout: Adds a numpad to the keys
};
// Tap Dance keycodes
enum td_keycodes {
TD_FN_SWITCH = 0
};
// Define a type containing as many tapdance states as you need
typedef enum {
TD_NONE,
TD_UNKNOWN,
TD_SINGLE_HOLD,
TD_DOUBLE_HOLD
} td_state_t;
typedef struct {
bool is_press_action;
td_state_t state;
} td_tap_t;
// Declare your tapdance functions:
// Function to determine the current tapdance state
td_state_t cur_dance(qk_tap_dance_state_t *state);
// `finished` and `reset` functions for each tapdance keycode
void fn_tap_finished(qk_tap_dance_state_t *state, void *user_data);
void fn_tap_reset(qk_tap_dance_state_t *state, void *user_data);
enum ctrl_keycodes {
MD_BOOT = SAFE_RANGE, // Restart into bootloader after hold timeout
ROUT_TG, // Timeout Toggle. Toggle idle LED time out on or off
ROUT_VI, // Timeout Value Increase. Increase idle time out before LED disabled
ROUT_VD, // Timeout Value Decrease. Decrease idle time out before LED disabled
ROUT_FM, // RGB timeout fast mode toggle
TOG_NPD, // Toggle Numpad On/Off
COPY_ALL, // Copy all text using ctrl(a+c)
};
enum string_macro_keycodes {
// The start of this enum should always be equal to end of ctrl_keycodes + 1
G_INIT = COPY_ALL + 1, // git init
G_CLONE, // git clone
G_ADD, // git add
G_DIFF, // git diff
G_RESET, // git reset --soft
G_BRANH, // git branch list
G_CHECK, // git checkout
G_REMTE, // git remote add
G_FETCH, // git fetch
G_PULL, // git pull
G_PUPST, // git pull upstream
G_PUSH, // git push
G_PSORG, // git push -u origin
G_PSFWL, // git push --force-with-lease
G_COMM, // git commit
G_COMSG, // git commit -m ": [TFS-]"
G_STAT, // git status
G_LOG, // git log
};

View file

@ -0,0 +1,200 @@
# Massdrop Ctrl Xanimos
This keymap is the one I use on my MD CTRL, as a professional software engineer I like to make things my own. I'm also up for spreading the love.
Massdrop has had a pretty bad rap with qmk the past but recently it's not too bad once you put a little pizzazz into it.
I started with the Endgame keymap and have re-written most of and expanded upon it.
## Layers
### Typing Layer
_I physically switched around my RALT and Menu keys as my personal preference. The label is still in default location but you can see they are mapped to my liking._
```
__________ ___________________________________________ ___________________________________________ ___________________________________________ ________________________________
| ESC | | F1 | F2 | F3 | F4 | | F5 | F6 | F7 | F8 | | F9 | F10 | F11 | F12 | | PRINT | SCLCK | PAUSE |
| ------ | | ------ | ------ | ------ | ------ | | ------ | ------ | ------ | ------ | | ------ | ------ | ------ | ------ | | ------ | ------ | ------ |
| 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 | RCS(M) |
|__________| |__________|__________|__________|__________| |__________|__________|__________|__________| |__________|__________|__________|__________| |__________|__________|__________|
____________________________________________________________________________________________________________________________________________________________________ ________________________________
| ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BCKSP | | INS | HOME | PGUP |
| ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | | ------ | ------ | ------ |
| 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 |
|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|_____________________| |__________|__________|__________|
| TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | | DEL | END | PGDN |
| ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | | ------ | ------ | ------ |
| 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 |
|_______________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|________________| |__________|__________|__________|
| CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER |
| ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ |
| 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 |
|_________________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|_________________________| __________
| SHIFT | Z | X | C | V | B | N | M | , | . | / | RSHIFT | | UP |
| ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | | ------ |
| 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 |
|____________________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|_________________________________| __________|__________|__________
| CTRL | GUI | ALT | SPACE | RALT | MENU | RGUI | RCTRL | | LEFT | DOWN | RIGHT |
| ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | | ------ | ------ | ------ |
| KC_LCTRL | KC_LGUI | KC_LALT | KC_SPC | FN_SWTCH | KC_RALT | KC_RGUI | KC_RCTL | | KC_LEFT | KC_DOWN | KC_RGHT |
|_____________|_____________|_____________|_________________________________________________________________|______________|_____________|_____________|_____________| |__________|__________|__________|
```
### Function Layer
```
__________ ___________________________________________ ___________________________________________ ___________________________________________ ________________________________
| ESC | | F1 | F2 | F3 | F4 | | F5 | F6 | F7 | F8 | | F9 | F10 | F11 | F12 | | PRINT | SCLCK | PAUSE |
| ------ | | ------ | ------ | ------ | ------ | | ------ | ------ | ------ | ------ | | ------ | ------ | ------ | ------ | | ------ | ------ | ------ |
| | | ROUT_TG | ROUT_RM | ROUT_VD | ROUT_VI | | | | | | | | KC_WAKE | KC_SLEP | | | KC_PAUS | | KC_MUTE |
|__________| |__________|__________|__________|__________| |__________|__________|__________|__________| |__________|__________|__________|__________| |__________|__________|__________|
____________________________________________________________________________________________________________________________________________________________________ ________________________________
| ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BCKSP | | INS | HOME | PGUP |
| ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | | ------ | ------ | ------ |
| | | | | | | | | | | | | | | | KC_MSTP | KC_MPLY | KC_VOLU |
|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|_____________________| |__________|__________|__________|
| TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | | DEL | END | PGDN |
| ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | | ------ | ------ | ------ |
| | RGB_MOD | RGB_SPI | RBG_VAI | RGB_HUI | | | | | | | | | | | KC_MPRV | KC_MNXT | KC_VOLD |
|_______________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|________________| |__________|__________|__________|
| CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER |
| ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ |
| | RGB_RMOD | RGB_SPD | RGB_VAD | RGB_HUD | | | | | | | | |
|_________________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|_________________________| __________
| SHIFT | Z | X | C | V | B | N | M | , | . | / | RSHIFT | | UP |
| ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | | ------ |
| | | | COPY_ALL | | MD_BOOT | NK_TOGG | | | | | TOGGLE_NUMPAD | | KC_BRIU |
|____________________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|_________________________________| __________|__________|__________
| CTRL | GUI | ALT | SPACE | RALT | MENU | RGUI | RCTRL | | LEFT | DOWN | RIGHT |
| ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | | ------ | ------ | ------ |
| | | | | | | | | | | KC_BRID | |
|_____________|_____________|_____________|_________________________________________________________________|______________|_____________|_____________|_____________| |__________|__________|__________|
```
### Git Layer
```
__________ ___________________________________________ ___________________________________________ ___________________________________________ ________________________________
| ESC | | F1 | F2 | F3 | F4 | | F5 | F6 | F7 | F8 | | F9 | F10 | F11 | F12 | | PRINT | SCLCK | PAUSE |
| ------ | | ------ | ------ | ------ | ------ | | ------ | ------ | ------ | ------ | | ------ | ------ | ------ | ------ | | ------ | ------ | ------ |
| | | | | | | | | | | | | | | | | | | | |
|__________| |__________|__________|__________|__________| |__________|__________|__________|__________| |__________|__________|__________|__________| |__________|__________|__________|
____________________________________________________________________________________________________________________________________________________________________ ________________________________
| ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BCKSP | | INS | HOME | PGUP |
| ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | | ------ | ------ | ------ |
| G_INIT | G_CLONE | G_REMTE | G_RESET | G_PSFWL | | | | | | | | | | | | | |
|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|_____________________| |__________|__________|__________|
| TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | | DEL | END | PGDN |
| ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | | ------ | ------ | ------ |
| | G_PUPST | G_PULL | G_PSORG | G_PUSH | | | | | | | | | | | | | |
|_______________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|________________| |__________|__________|__________|
| CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER |
| ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ |
| | G_ADD | G_STAT | G_DIFF | G_FETCH | | | | | | | | |
|_________________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|_________________________| __________
| SHIFT | Z | X | C | V | B | N | M | , | . | / | RSHIFT | | UP |
| ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | | ------ |
| | G_LOG | G_CHECK | G_COMM | G_COMSG | G_BRANH | | | | | | | | |
|____________________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|_________________________________| __________|__________|__________
| CTRL | GUI | ALT | SPACE | RALT | MENU | RGUI | RCTRL | | LEFT | DOWN | RIGHT |
| ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | | ------ | ------ | ------ |
| | | | | | | | | | | | |
|_____________|_____________|_____________|_________________________________________________________________|______________|_____________|_____________|_____________| |__________|__________|__________|
```
- These are the strings that are dumped/keyed in for each associated keycode
```
G_INIT "git init"
G_CLONE "git clone "
G_ADD "git add "
G_DIFF "git diff "
G_RESET "git reset --soft "
G_BRANH "git branch --list"
G_CHECK "git checkout "
G_REMTE "git remote add "
G_FETCH "git fetch "
G_PULL "git pull"
G_PUPST "git pull upstream "
G_PUSH "git push"
G_PSORG "git push -u origin "
G_PSFWL "git push --force-with-lease"
G_COMM "git commit "
G_COMSG "git commit -m \": [TFS-]\""
G_STAT "git status"
G_LOG "git log"
```
### Numpad Layer
*activated via the __Function Layer__ and stays active until you escape*
```
__________ ___________________________________________ ___________________________________________ ___________________________________________ ________________________________
| ESC | | F1 | F2 | F3 | F4 | | F5 | F6 | F7 | F8 | | F9 | F10 | F11 | F12 | | PRINT | SCLCK | PAUSE |
| ------ | | ------ | ------ | ------ | ------ | | ------ | ------ | ------ | ------ | | ------ | ------ | ------ | ------ | | ------ | ------ | ------ |
| TOG_NPD | | | | | | | | | | | | | | | | | | | |
|__________| |__________|__________|__________|__________| |__________|__________|__________|__________| |__________|__________|__________|__________| |__________|__________|__________|
____________________________________________________________________________________________________________________________________________________________________ ________________________________
| ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BCKSP | | INS | HOME | PGUP |
| ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | | ------ | ------ | ------ |
| | | | | | | | | | | | | | | | | | |
|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|_____________________| |__________|__________|__________|
| TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | | DEL | END | PGDN |
| ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | | ------ | ------ | ------ |
| | | | | | | KC_P7 | KC_P8 | KC_P9 | | | | | | | | | |
|_______________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|________________| |__________|__________|__________|
| CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER |
| ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ |
| | | | | | | KC_P4 | KC_P5 | KC_P6 | | | | |
|_________________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|_________________________| __________
| SHIFT | Z | X | C | V | B | N | M | , | . | / | RSHIFT | | UP |
| ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | | ------ |
| | | | | | KC_P1 | KC_P2 | KC_P3 | KC_PDOT | | | | | |
|____________________|__________|__________|__________|__________|__________|__________|__________|__________|__________|__________|_________________________________| __________|__________|__________
| CTRL | GUI | ALT | SPACE | RALT | MENU | RGUI | RCTRL | | LEFT | DOWN | RIGHT |
| ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | | ------ | ------ | ------ |
| | | | KC_P0 | | | | | | | | |
|_____________|_____________|_____________|_________________________________________________________________|______________|_____________|_____________|_____________| |__________|__________|__________|
```
## Features
These are the features currently used by this keymap:
### RGB Time Out
This allows setting a dynamic timeout for RGB to turn off. The following is supported:
1. Restores on the first click of any key.
2. Restores to its previous state before timeout. i.e. if it was edge only before timeout it will restore to edge only, same for all modes.
3. Doesn't interfere with RGB modes. You can set keyboard to All, Edge Only or Off and timeout will not interfere with these modes.
4. The time before RGB is turned off is dynamically adjustable using keycodes ROUT_VI to increase, ROUT_VD to decrease. They have a 10 second steps by default. Minimum value 10 seconds by default and maximum is 10 minutes.
5. Can be toggled on or off dyncamically with the ROUT_TG keycode.
6. Can be put in fast mode using ROUT_FM, for movie watching purposes. Default value is 3 seconds. Note that fast mode disabled ROUT_VD and ROUT_VI so to use them again you have to toggle fast mode off with ROUT_FM. It doesn't impact ROUT_TG and ROUT_TG will remember if fast mode was enabled when toggled back on, so it doesn't disable fast mode on its own, only ROUT_FM can disable or enable fast mode.
### Tapdance Keys
Created a tapdance setup to use the same key to switch between the layers, aka a function key. ;)
Layers are temporary while holding the function key down.
- Single tap and hold: Activates the Function Layer.
- Double tap and hold: Activates the Git Layer.
### Numpad
Activated in the *Function Layer* by holding down the fn key and pressing the toggle key (RSHIFT). The keeps the layer activated without needing to hold the fn key anymore.
To leave the numpad layer press the ESC key or hold and let go of the fn key.
### Space Cadet Shift
The typing layer is setup to use the [Space Cadet Shift](https://docs.qmk.fm/#/feature_space_cadet). As a software engineer this is massively useful :)
_Sorry ISO users, you'll need to configure it for your own setup or disable it._
## Credits
- [endgame](https://github.com/qmk/qmk_firmware/tree/master/keyboards/massdrop/ctrl/keymaps/endgame) by [ash0x0](https://github.com/ash0x0)
For the base keymap I started with.

View file

@ -0,0 +1,14 @@
# RGBLIGHT_ENABLE = no # Not for MD boards. This is here in case you forget.
COMMAND_ENABLE = no # Commands for debug and configuration
# AUTO_SHIFT_ENABLE = yes # Auto Shift
NKRO_ENABLE = yes # USB Nkey Rollover
DYNAMIC_MACRO_ENABLE = no # Dynamic macro recording and play
MOUSEKEY_ENABLE = no # Enable mouse control keycodes. Increases firmware size.
TAP_DANCE_ENABLE = yes # Enable tap dance keys
CONSOLE_ENABLE = no # Enable debugging console. Increases firmware size.
SRC += config_led.c # Used to add files to the compilation/linking list.
EXTRAKEY_ENABLE = yes # Audio control and System control
TERMINAL_ENABLE = no
# RAW_ENABLE = yes # Raw HID has not yet been implemented for this keyboard
# COMBO_ENABLE # Key combo feature
# LEADER_ENABLE # Enable leader key chording