Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update personal userspace and keymaps + improve custom functionality #5289

Merged
merged 28 commits into from Mar 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
6f386ca
Change how desktop commands work
vomindoraan Jan 28, 2019
6695c87
Add DST_MOD_MASK as a config option
vomindoraan Jan 28, 2019
f2543c3
DST_RMV → DST_REM
vomindoraan Jan 28, 2019
012c5ef
Update custom SEND_STRING
vomindoraan Jan 31, 2019
db1ace5
Add melody96:konstantin keymap
vomindoraan Jan 11, 2019
ef189da
Move feature flags from userspace into keyboard rules
vomindoraan Feb 9, 2019
ea23035
Use "Vo-", "Vo+" instead of "VoD", "VoU" in keymap comments
vomindoraan Feb 11, 2019
d163b22
Add RGB controls and numpad Unicode to Melody96 keymap
vomindoraan Feb 11, 2019
2f07627
Add RGB_SET keycode to Melody96 and RGB files to userspace
vomindoraan Feb 11, 2019
ddb0f39
Generate UNICODE and UNICODEMAP constants using macros
vomindoraan Feb 11, 2019
7b11d74
Avoid collisions with X_* send string constants
vomindoraan Feb 11, 2019
5a41c06
Switch to UNICODEMAP in keyboard rules
vomindoraan Feb 18, 2019
bd43df5
Use two spaces before inline comments
vomindoraan Feb 16, 2019
be65a0c
Add _keymap versions of other custom Quantum functions
vomindoraan Feb 16, 2019
784e2af
Make toggle_numpad a nested function in process_record_user
vomindoraan Feb 16, 2019
f09a237
Remove most _keymap and _user definitions in userspace
vomindoraan Feb 17, 2019
8e0dfdf
Set Melody96 underglow color to Godspeed blue on EEPROM reset
vomindoraan Feb 16, 2019
de2e036
Update GODSPEED_BLUE values and RGB mode keys
vomindoraan Feb 16, 2019
fbe2eba
Add GODSPEED_YELLOW color
vomindoraan Feb 18, 2019
45dddfa
Set preferred intervals for rgblight effects
vomindoraan Feb 18, 2019
1b3b941
Update tap dance function names
vomindoraan Feb 18, 2019
b05a4b1
Replace td_lshift_fn with generic td_mod_layer, add TD_RCTL_FN
vomindoraan Feb 18, 2019
14908f8
Replace td_fn_rctrl with generic td_layer_mod
vomindoraan Feb 18, 2019
6a088f7
Add blank lines, prefer explicit initialization
vomindoraan Feb 18, 2019
9baee84
ACTION_TAP_DANCE_DOUBLE_MODS → ACTION_TAP_DANCE_DOUBLE_MOD
vomindoraan Feb 18, 2019
f9c070e
Update Godspeed colors
vomindoraan Feb 19, 2019
51182a4
Add media controls to Melody96 keymap
vomindoraan Feb 19, 2019
be1d5c6
Add SysRq, Break combos and other keys to Melody96 keymap
vomindoraan Feb 22, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c
Expand Up @@ -56,17 +56,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤
* │ │ ← │ ↓ │ → │PgD│ │ │ │MW↑│M← │M↓ │M→ │ │
* ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤
* │ │Mut│VoD│VoU│Ply│Prv│Nxt│MW←│MW→│M4 │M5 │ │ │
* │ │Mut│Vo-│Vo+│Ply│Prv│Nxt│MW←│MW→│M4 │M5 │ │ │
* └─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┘
* ││ MW↓ │MAcl2│ │
* │DPR│DstNA│ MW↓ │MAcl2│ │
* └───┴─────┴───────────────────────────┴─────┴───┘
*/
[L_FN] = LAYOUT(
_______, 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_INS,
_______, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, _______, _______, _______, KC_BTN1, KC_MS_U, KC_BTN2, KC_BTN3, KC_DEL,
_______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, _______, KC_WH_U, KC_MS_L, KC_MS_D, KC_MS_R, _______,
_______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY, KC_MPRV, KC_MNXT, KC_WH_L, KC_WH_R, KC_BTN4, KC_BTN5, _______, _______,
XXXXXXX, _______, _______, KC_WH_D, KC_ACL2, _______, XXXXXXX
XXXXXXX, DST_P_R, DST_N_A, KC_WH_D, KC_ACL2, _______, XXXXXXX
),

/* RCtrl layer
Expand All @@ -79,14 +79,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤
* │ │ │ │ │ │ │ │ │ │ │ │ │ │
* └─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┘
* │Dst│Dstp←│ │Dstp→│ │
* │DtR│DstA │ │ │ │
* └───┴─────┴───────────────────────────┴─────┴───┘
*/
[L_RCTRL] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, TOP, MV_UP, BOTTOM, PRV_TAB, _______, _______, _______, _______, _______, _______, _______, _______, CLEAR,
_______, MV_LEFT, MV_DOWN, MV_RGHT, NXT_TAB, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
XXXXXXX, DESKTOP, DSKTP_L, _______, DSKTP_R, _______, XXXXXXX
XXXXXXX, DST_REM, DST_ADD, _______, _______, _______, XXXXXXX
),
};
9 changes: 9 additions & 0 deletions keyboards/kbdfans/kbd6x/keymaps/konstantin/rules.mk
@@ -1,2 +1,11 @@
BOOTMAGIC_ENABLE = no
COMMAND_ENABLE = yes
CONSOLE_ENABLE = yes
EXTRAKEY_ENABLE = yes
MOUSEKEY_ENABLE = yes
NKRO_ENABLE = yes
TAP_DANCE_ENABLE = yes
UNICODEMAP_ENABLE = yes

BACKLIGHT_ENABLE = no
RGBLIGHT_ENABLE = no
3 changes: 3 additions & 0 deletions keyboards/melody96/keymaps/konstantin/config.h
@@ -0,0 +1,3 @@
#pragma once

#define LAYER_FN
78 changes: 78 additions & 0 deletions keyboards/melody96/keymaps/konstantin/keymap.c
@@ -0,0 +1,78 @@
#include QMK_KEYBOARD_H
#include "konstantin.h"

static const hsv_t *colors[] = { &GODSPEED_BLUE, &GODSPEED_YELLOW };
static size_t cnum = sizeof colors / sizeof *colors;
static size_t cidx = 0;

void eeconfig_init_keymap(void) {
rgblight_sethsv(colors[cidx]->h, colors[cidx]->s, colors[cidx]->v);
}

enum keycodes_keymap {
RGB_SET = RANGE_KEYMAP,
};

bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case RGB_SET:
if (record->event.pressed) {
cidx = (cidx + 1) % cnum;
rgblight_sethsv(colors[cidx]->h, colors[cidx]->s, colors[cidx]->v);
}
return false;

default:
return true;
}
}

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Base layer
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
* │Esc│F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│PSc│Ins│Hom│End│PgU│PgD│
* ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
* │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │Del│NLk│P/ │P* │P- │
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┼───┼───┼───┤
* │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │Bspc │P7 │P8 │P9 │ │
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┼───┼───┤P+ │
* │FnCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │P4 │P5 │P6 │ │
* ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┼───┼───┼───┤
* │LSft│RAG│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │RShift│ ↑ │P1 │P2 │P3 │ │
* ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┴┬──┴──┬───┼───┼───┼───┼───┤PEn│
* │LCtl│LGui│LAlt│ Space │RAlGu│RCtrl│ ← │ ↓ │ → │P0 │P. │ │
* └────┴────┴────┴────────────────────────┴─────┴─────┴───┴───┴───┴───┴───┴───┘
*/
[L_BASE] = LAYOUT( \
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_INS, KC_HOME, KC_END, KC_PGUP, KC_PGDN,
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_BSLS, KC_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
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_BSPC, KC_P7, KC_P8, KC_P9, XXXXXXX,
FN_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS,
KC_LSFT, RAL_RGU, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXXX,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, RAL_RGU, XXXXXXX, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT
),

/* Function layer
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
* │ │ │ │ │ │ │ │ │ │ │ │ │ │Sys│SLk│Pau│Brk│Top│Btm│
* ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
* │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │RTg│ ÷ │ × │ − │
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┼───┼───┼───┤
* │ M4 │M2 │M↑ │M1 │M3 │M5 │ │UCM│ │Stp│Ply│Prv│Nxt│Clear│RH+│RS+│RV+│ │
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┼───┼───┤RSt│
* │ │M← │M↓ │M→ │MW↑│ │ │ │ │ │ │ │ │RH-│RS-│RV-│ │
* ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┼───┼───┼───┤
* │ │ │MA0│MA2│MW←│MW→│ │ │ │Vo-│Vo+│Mut│ │PgU│RMR│RMS│RMB│ │
* ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┴┬──┴──┬───┼───┼───┼───┼───┤RMP│
* │ │DtPR│DtNA│ MW↓ │ │ App │Hom│PgD│End│RM-│RM+│ │
* └────┴────┴────┴────────────────────────┴─────┴─────┴───┴───┴───┴───┴───┴───┘
*/
[L_FN] = LAYOUT( \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_SYSR, KC_SLCK, KC_PAUS, KC_BRK, TOP, BOTTOM,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, DIVIDE, TIMES, MINUS,
KC_BTN4, KC_BTN2, KC_MS_U, KC_BTN1, KC_BTN3, KC_BTN5, _______, UC_MOD, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, CLEAR, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX,
_______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_U, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SET,
_______, _______, KC_ACL0, KC_ACL2, KC_WH_L, KC_WH_R, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, KC_PGUP, RGB_M_R, RGB_M_SN,RGB_M_B, XXXXXXX,
_______, DST_P_R, DST_N_A, KC_WH_D, _______, XXXXXXX, KC_APP, KC_HOME, KC_PGDN, KC_END, RGB_RMOD,RGB_MOD, RGB_M_P
),
};
10 changes: 10 additions & 0 deletions keyboards/melody96/keymaps/konstantin/rules.mk
@@ -0,0 +1,10 @@
BOOTMAGIC_ENABLE = no
COMMAND_ENABLE = yes
CONSOLE_ENABLE = no
EXTRAKEY_ENABLE = yes
MOUSEKEY_ENABLE = yes
NKRO_ENABLE = yes
TAP_DANCE_ENABLE = yes
UNICODEMAP_ENABLE = yes

BACKLIGHT_ENABLE = no
8 changes: 4 additions & 4 deletions keyboards/whitefox/keymaps/konstantin/keymap.c
Expand Up @@ -25,23 +25,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

/* Function layer
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
* │ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│Num│Scr│Pau│
* │ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│Num│SLk│Pau│
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤
* │ M4 │M2 │M↑ │M1 │M3 │M5 │ │UCM│ │Stp│Ply│Prv│Nxt│Clear│Ins│
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤
* │ │M← │M↓ │M→ │MW↑│ │ │ │ │ │ │ │ │Top│
* ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤
* │ │MA0│MA2│MW←│MW→│ │ │ │VoD│VoU│Mut│ App │PgU│Btm│
* │ │MA0│MA2│MW←│MW→│ │ │ │Vo-│Vo+│Mut│ App │PgU│Btm│
* ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤
* │ │Dstp│Dst←│ MW↓ │Dst→│ │ │Hom│PgD│End│
* │ │DtPR│DtNA│ MW↓ │ │ │ │Hom│PgD│End│
* └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘
*/
[L_FN] = LAYOUT_truefox( \
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, NUMPAD, KC_SLCK, KC_PAUS, \
KC_BTN4, KC_BTN2, KC_MS_U, KC_BTN1, KC_BTN3, KC_BTN5, _______, UC_MOD, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, CLEAR, KC_INS, \
_______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_U, _______, _______, _______, _______, _______, _______, _______, _______, TOP, \
_______, KC_ACL0, KC_ACL2, KC_WH_L, KC_WH_R, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_APP, KC_PGUP, BOTTOM, \
_______, DESKTOP, DSKTP_L, KC_WH_D, DSKTP_R, _______, KC_HOME, KC_PGDN, KC_END \
_______, DST_P_R, DST_N_A, KC_WH_D, _______, _______, KC_HOME, KC_PGDN, KC_END \
),

/* Numpad layer
Expand Down
9 changes: 9 additions & 0 deletions keyboards/whitefox/keymaps/konstantin/rules.mk
@@ -1,2 +1,11 @@
BOOTMAGIC_ENABLE = no
COMMAND_ENABLE = yes
CONSOLE_ENABLE = yes
EXTRAKEY_ENABLE = yes
MOUSEKEY_ENABLE = yes
NKRO_ENABLE = yes
TAP_DANCE_ENABLE = yes
UNICODEMAP_ENABLE = yes

BACKLIGHT_ENABLE = no
VISUALIZER_ENABLE = no
54 changes: 43 additions & 11 deletions users/konstantin/konstantin.c
@@ -1,15 +1,25 @@
#include "konstantin.h"

#ifdef LAYER_NUMPAD
static void toggle_numpad(void) {
layer_invert(L_NUMPAD);
bool numpad_on = IS_LAYER_ON(L_NUMPAD);
bool num_lock_on = IS_HOST_LED_ON(USB_LED_NUM_LOCK);
if (num_lock_on != numpad_on) {
tap_code(KC_NLCK); // Toggle Num Lock to match layer state
}
__attribute__((weak))
void keyboard_pre_init_keymap(void) {}

void keyboard_pre_init_user(void) {
keyboard_pre_init_keymap();
}

__attribute__((weak))
void eeconfig_init_keymap(void) {}

void eeconfig_init_user(void) {
eeconfig_init_keymap();
}

__attribute__((weak))
void keyboard_post_init_keymap(void) {}

void keyboard_post_init_user(void) {
keyboard_post_init_keymap();
}
#endif

__attribute__((weak))
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
Expand All @@ -21,19 +31,41 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return false;
}

#ifdef LAYER_NUMPAD
void toggle_numpad(void) {
layer_invert(L_NUMPAD);
bool numpad = IS_LAYER_ON(L_NUMPAD), num_lock = IS_HOST_LED_ON(USB_LED_NUM_LOCK);
if (num_lock != numpad) {
tap_code(KC_NLCK); // Toggle Num Lock to match layer state
}
}
#endif

switch (keycode) {
case CLEAR:
if (record->event.pressed) {
SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE));
}
return false;

case DST_P_R:
(record->event.pressed ? register_code16 : unregister_code16)(
(get_mods() & DST_MOD_MASK) ? DST_REM : DST_PRV
);
return false;

case DST_N_A:
(record->event.pressed ? register_code16 : unregister_code16)(
(get_mods() & DST_MOD_MASK) ? DST_ADD : DST_NXT
);
return false;

#ifdef LAYER_FN
static bool fn_lock;
static bool fn_lock;

case FN_FNLK:
if (record->event.pressed && record->tap.count == TAPPING_TOGGLE) {
fn_lock = !IS_LAYER_ON(L_FN); // Fn layer will be toggled after this
fn_lock = !IS_LAYER_ON(L_FN); // Fn layer will be toggled after this
}
return true;
#endif
Expand Down
33 changes: 27 additions & 6 deletions users/konstantin/konstantin.h
@@ -1,10 +1,13 @@
#pragma once

#include "quantum.h"
#if defined(RGBLIGHT_ENABLE) || defined(RGBMATRIX_ENABLE)
#include "rgb.h"
#endif
#ifdef TAP_DANCE_ENABLE
#include "tap_dance.h"
#endif
#ifdef UNICODE_ENABLE
#if defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE)
#include "unicode.h"
#endif

Expand All @@ -14,6 +17,10 @@
#define FN_FNLK TT(L_FN)
#endif

#define KC_SYSR LALT(KC_PSCR)
#undef KC_BRK
#define KC_BRK LCTL(KC_PAUS)

#define MV_UP LCTL(KC_UP)
#define MV_DOWN LCTL(KC_DOWN)
#define MV_LEFT LCTL(KC_LEFT)
Expand All @@ -23,20 +30,30 @@
#define PRV_TAB LCTL(KC_PGUP)
#define NXT_TAB LCTL(KC_PGDN)

#define DST_ADD LCTL(LGUI(KC_D))
#define DST_REM LCTL(LGUI(KC_F4))
#define DST_PRV LCTL(LGUI(KC_LEFT))
#define DST_NXT LCTL(LGUI(KC_RGHT))
#ifndef DST_MOD_MASK
#define DST_MOD_MASK MOD_MASK_CTRL
#endif

#define LCT_CPS LCTL_T(KC_CAPS)

#ifdef SEND_STRING_CLEAN
#undef SEND_STRING
#define SEND_STRING(...) { \
uint8_t ss_mods = get_mods(); \
clear_mods(); \
send_string_P(PSTR(__VA_ARGS__)); \
set_mods(ss_mods); \
#define SEND_STRING(string) { \
uint8_t ss_mods = get_mods(); \
clear_mods(); \
send_string_P(PSTR(string)); \
set_mods(ss_mods); \
}
#endif

enum keycodes_user {
CLEAR = SAFE_RANGE,
DST_P_R,
DST_N_A,
#ifdef LAYER_NUMPAD
NUMPAD,
#endif
Expand All @@ -56,5 +73,9 @@ enum layers_user {
L_RANGE_KEYMAP,
};

void keyboard_pre_init_keymap(void);
void eeconfig_init_keymap(void);
void keyboard_post_init_keymap(void);

bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
uint32_t layer_state_set_keymap(uint32_t state);
24 changes: 24 additions & 0 deletions users/konstantin/rgb.c
@@ -0,0 +1,24 @@
#include "rgb.h"

#ifdef RGBLIGHT_EFFECT_BREATHING
const uint8_t RGBLED_BREATHING_INTERVALS[] PROGMEM = {20, 30, 5, 10};
#endif

#ifdef RGBLIGHT_EFFECT_RAINBOW_MOOD
const uint8_t RGBLED_RAINBOW_MOOD_INTERVALS[] PROGMEM = {20, 50, 100};
#endif

#ifdef RGBLIGHT_EFFECT_RAINBOW_SWIRL
const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[] PROGMEM = {20, 50, 100};
#endif

#ifdef RGBLIGHT_EFFECT_SNAKE
const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {20, 50, 100};
#endif

#ifdef RGBLIGHT_EFFECT_KNIGHT
const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {20, 50, 100};
#endif

const hsv_t GODSPEED_BLUE = { .h = 280, .s = 68, .v = RGBLIGHT_LIMIT_VAL };
const hsv_t GODSPEED_YELLOW = { .h = 38, .s = 153, .v = RGBLIGHT_LIMIT_VAL };
18 changes: 18 additions & 0 deletions users/konstantin/rgb.h
@@ -0,0 +1,18 @@
#pragma once

#include "quantum.h"

typedef struct {
uint16_t h; // 0–360
uint8_t s; // 0–255
uint8_t v; // 0–255
} hsv_t;

typedef struct {
uint8_t r; // 0–255
uint8_t g; // 0–255
uint8_t b; // 0–255
} rgb_t;

extern const hsv_t GODSPEED_BLUE;
extern const hsv_t GODSPEED_YELLOW;