forked from mirrors/qmk_userspace
Keymap: Added Leader Key Functionality (#4025)
* deleting arkag branch, forcibly moving changes over to master * fade_color function added, not tested * added half functions some stuff * surround_type function implemented and working. * added flashing function and removed fading, flashing supports infinite flashing along with controlled number flashes * added a fade state machine and functionality * build optimizations, changed fade to bounce between bounds rather than roll over, added a HALMAK layout * changes to sleep breath function, changed how I will switch to HALMAK * support for halmak added * support for activity detection added, condensed fading and flashing state machines, removed support for HALMAK and COLEMAK because arkag is stupid * changed sleep and inactive behaviors, now the color shifting reverses on state change, yay! save_color and reset_color are made to enable layer color changing to look cooler. * reformatted some if statements in state detection * changes to force fade to pause on boot, or plug in. * Attempting to move over to userspace, pushing to repository for help * userspace stuff.... * userspace stuff.... * layout changes, working userspace, Removed left side shift and replaced it with a MT() for LSFT and SPC. Userspace seems to be working properly now! HURRAY * Layout change Removed space/shift and reset modifiers to what they were originally. Added homerow modifiers. * Removed excessive tabs in files * Moved mods on homerow around... * changes recommended by @drashna * removed homerow mods, more flashy lighting! * changed delays for lighting. * velocikey code retro fit into userspace to match typing speed currently "working" but isn't as reactive as I want. * Readme and other documentation hidden throughout code * Added a pretty picture * pretty picture actually added * More readme updates * Velocikey now working inside my userspace! * Changed repo macro and fixed readme * Removed media layer, moved media control to LAZY layer * fixed more merge issues when I had to merge... * implemented some leader key stuff * removed merge garbage... * changes requested by @drashna, leader key switch from macros
This commit is contained in:
parent
170507896d
commit
3875d6f581
5 changed files with 117 additions and 166 deletions
|
@ -370,10 +370,115 @@ void matrix_init_user(void) {
|
|||
set_os(current_os, false);
|
||||
}
|
||||
|
||||
LEADER_EXTERNS();
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
check_state();
|
||||
flash_rgb();
|
||||
fade_rgb();
|
||||
LEADER_DICTIONARY() {
|
||||
leading = false;
|
||||
leader_end();
|
||||
|
||||
// begin OS functions
|
||||
SEQ_TWO_KEYS(KC_P, KC_B) {
|
||||
if (current_os == OS_WIN) {
|
||||
SEND_STRING(SS_DOWN(X_LGUI) SS_TAP(X_PAUSE) SS_UP(X_LGUI));
|
||||
} else {
|
||||
}
|
||||
}
|
||||
SEQ_THREE_KEYS(KC_C, KC_A, KC_D) {
|
||||
if (current_os == OS_WIN) {
|
||||
SEND_STRING(SS_DOWN(X_LCTRL) SS_DOWN(X_LALT) SS_TAP(X_DELETE) SS_UP(X_LALT) SS_UP(X_LCTRL));
|
||||
} else {
|
||||
}
|
||||
}
|
||||
SEQ_FOUR_KEYS(KC_C, KC_A, KC_L, KC_C) {
|
||||
if (current_os == OS_WIN) {
|
||||
SEND_STRING(SS_TAP(X_CALCULATOR));
|
||||
} else if (current_os == OS_MAC) {
|
||||
SEND_STRING(SS_DOWN(X_LGUI) SS_TAP(X_SPACE) SS_UP(X_LGUI) "calculator" SS_TAP(X_ENTER));
|
||||
}
|
||||
}
|
||||
// end OS functions
|
||||
|
||||
// begin format functions
|
||||
SEQ_ONE_KEY(KC_B) {
|
||||
surround_type(4, KC_8, true);
|
||||
}
|
||||
SEQ_ONE_KEY(KC_I) {
|
||||
surround_type(2, KC_8, true);
|
||||
}
|
||||
SEQ_ONE_KEY(KC_U) {
|
||||
surround_type(4, KC_MINS, true);
|
||||
}
|
||||
SEQ_ONE_KEY(KC_S) {
|
||||
surround_type(4, KC_GRAVE, true);
|
||||
}
|
||||
SEQ_TWO_KEYS(KC_S, KC_S) {
|
||||
if (current_os == OS_MAC) {
|
||||
long_keystroke(3, (uint16_t[]){KC_LGUI, KC_LSFT, KC_4});
|
||||
} else if (current_os == OS_WIN) {
|
||||
long_keystroke(3, (uint16_t[]){KC_LGUI, KC_LSFT, KC_S});
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
SEQ_ONE_KEY(KC_C) {
|
||||
surround_type(2, KC_GRAVE, false);
|
||||
}
|
||||
SEQ_TWO_KEYS(KC_C, KC_C) {
|
||||
surround_type(6, KC_GRAVE, false);
|
||||
}
|
||||
// end format functions
|
||||
|
||||
// start fancy functions
|
||||
SEQ_THREE_KEYS(KC_C, KC_C, KC_C) {
|
||||
surround_type(6, KC_GRAVE, false);
|
||||
pri_mod(true);
|
||||
tap_key(KC_V);
|
||||
pri_mod(false);
|
||||
tap_key(KC_RGHT);
|
||||
tap_key(KC_RGHT);
|
||||
tap_key(KC_RGHT);
|
||||
tap_key(KC_ENTER);
|
||||
}
|
||||
// end fancy functions
|
||||
|
||||
// start typing functions
|
||||
SEQ_TWO_KEYS(KC_T, KC_M) {
|
||||
// ™
|
||||
send_unicode_hex_string("2122");
|
||||
}
|
||||
SEQ_THREE_KEYS(KC_G, KC_G, KC_T) {
|
||||
SEND_STRING("@GrahamGoldenTech.com");
|
||||
}
|
||||
SEQ_THREE_KEYS(KC_L, KC_O, KC_D) {
|
||||
// ಠ__ಠ
|
||||
send_unicode_hex_string("0CA0 005F 005F 0CA0");
|
||||
}
|
||||
SEQ_FOUR_KEYS(KC_R, KC_E, KC_P, KC_O) {
|
||||
SEND_STRING("https://github.com/qmk/qmk_firmware/tree/master/users/arkag");
|
||||
}
|
||||
SEQ_FOUR_KEYS(KC_F, KC_L, KC_I, KC_P) {
|
||||
// (╯‵Д′)╯彡┻━┻
|
||||
send_unicode_hex_string("0028 256F 2035 0414 2032 0029 256F 5F61 253B 2501 253B");
|
||||
}
|
||||
SEQ_FIVE_KEYS(KC_U, KC_F, KC_L, KC_I, KC_P) {
|
||||
// ┬─┬ノ( º _ º ノ)
|
||||
send_unicode_hex_string("252C 2500 252C 30CE 0028 0020 00BA 0020 005F 0020 00BA 0020 30CE 0029");
|
||||
}
|
||||
SEQ_FIVE_KEYS(KC_L, KC_E, KC_N, KC_N, KC_Y) {
|
||||
// ( ͡° ͜ʖ ͡°)
|
||||
send_unicode_hex_string("0028 0020 0361 00B0 0020 035C 0296 0020 0361 00B0 0029");
|
||||
}
|
||||
SEQ_FIVE_KEYS(KC_S, KC_H, KC_R, KC_U, KC_G) {
|
||||
// ¯\_(ツ)_/¯
|
||||
send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF");
|
||||
}
|
||||
// end typing functions
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
|
@ -394,138 +499,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
}
|
||||
return false;
|
||||
|
||||
case M_P_B:
|
||||
if (record->event.pressed) {
|
||||
if (current_os == OS_WIN) {
|
||||
SEND_STRING(SS_DOWN(X_LGUI) SS_TAP(X_PAUSE) SS_UP(X_LGUI));
|
||||
} else {
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
case M_C_A_D:
|
||||
if (record->event.pressed) {
|
||||
if (current_os == OS_WIN) {
|
||||
SEND_STRING(SS_DOWN(X_LCTRL) SS_DOWN(X_LALT) SS_TAP(X_DELETE) SS_UP(X_LALT) SS_UP(X_LCTRL));
|
||||
} else {
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
case M_CALC:
|
||||
if (record->event.pressed) {
|
||||
if (current_os == OS_WIN) {
|
||||
SEND_STRING(SS_TAP(X_CALCULATOR));
|
||||
} else if (current_os == OS_MAC) {
|
||||
SEND_STRING(SS_DOWN(X_LGUI) SS_TAP(X_SPACE) SS_UP(X_LGUI) "calculator" SS_TAP(X_ENTER));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
case M_OS:
|
||||
if (record->event.pressed) {
|
||||
set_os((current_os+1) % _OS_COUNT, true);
|
||||
}
|
||||
return false;
|
||||
|
||||
case M_LOD:
|
||||
if (record->event.pressed) {
|
||||
send_unicode_hex_string("0CA0 005F 005F 0CA0");
|
||||
}
|
||||
return false;
|
||||
|
||||
case M_LENNY:
|
||||
if (record->event.pressed) {
|
||||
send_unicode_hex_string("0028 0020 0361 00B0 0020 035C 0296 0020 0361 00B0 0029");
|
||||
}
|
||||
return false;
|
||||
|
||||
|
||||
case M_TF:
|
||||
if (record->event.pressed) {
|
||||
send_unicode_hex_string("0028 256F 2035 0414 2032 0029 256F 5F61 253B 2501 253B");
|
||||
}
|
||||
return false;
|
||||
|
||||
case M_UF:
|
||||
if (record->event.pressed) {
|
||||
send_unicode_hex_string("252C 2500 252C 30CE 0028 0020 00BA 0020 005F 0020 00BA 0020 30CE 0029");
|
||||
}
|
||||
return false;
|
||||
|
||||
case M_SHRUG:
|
||||
if (record->event.pressed) {
|
||||
send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF");
|
||||
}
|
||||
return false;
|
||||
|
||||
case M_TM:
|
||||
if (record->event.pressed) {
|
||||
send_unicode_hex_string("2122");
|
||||
}
|
||||
return false;
|
||||
|
||||
case M_REPO:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING("https://github.com/qmk/qmk_firmware/tree/master/users/arkag");
|
||||
}
|
||||
return false;
|
||||
|
||||
case M_GGT:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING("@GrahamGoldenTech.com");
|
||||
}
|
||||
return false;
|
||||
|
||||
case M_SNIPT:
|
||||
if (record->event.pressed) {
|
||||
surround_type(6, KC_GRAVE, false);
|
||||
pri_mod(true);
|
||||
tap_key(KC_V);
|
||||
pri_mod(false);
|
||||
tap_key(KC_RGHT);
|
||||
tap_key(KC_RGHT);
|
||||
tap_key(KC_RGHT);
|
||||
tap_key(KC_ENTER);
|
||||
}
|
||||
return false;
|
||||
|
||||
case M_BOLD:
|
||||
if (record->event.pressed) {
|
||||
surround_type(4, KC_8, true);
|
||||
}
|
||||
return false;
|
||||
|
||||
case M_ITAL:
|
||||
if (record->event.pressed) {
|
||||
surround_type(2, KC_8, true);
|
||||
}
|
||||
return false;
|
||||
|
||||
case M_ULIN:
|
||||
if (record->event.pressed) {
|
||||
surround_type(4, KC_MINS, true);
|
||||
}
|
||||
return false;
|
||||
|
||||
case KC_LSFT:
|
||||
if (record->event.pressed) {
|
||||
save_color(underglow);
|
||||
underglow = mod_color(underglow, true, 75);
|
||||
SEND_STRING(SS_DOWN(X_LSHIFT));
|
||||
} else {
|
||||
reset_color();
|
||||
SEND_STRING(SS_UP(X_LSHIFT));
|
||||
}
|
||||
return false;
|
||||
|
||||
case MEDIA:
|
||||
case LAZY:
|
||||
case KEEB:
|
||||
case RAISE:
|
||||
case LOWER:
|
||||
return true;
|
||||
|
||||
default:
|
||||
if (record->event.pressed) {
|
||||
state = active;
|
||||
|
@ -535,36 +514,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
}
|
||||
}
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
switch (biton32(state)) {
|
||||
case _LAZY:
|
||||
save_color(underglow);
|
||||
underglow = mod_color(underglow, true, 50);
|
||||
break;
|
||||
case _MEDIA:
|
||||
save_color(underglow);
|
||||
underglow = mod_color(underglow, true, 150);
|
||||
break;
|
||||
case _KEEB:
|
||||
save_color(underglow);
|
||||
underglow = mod_color(underglow, false, 150);
|
||||
break;
|
||||
case _LOWER:
|
||||
save_color(underglow);
|
||||
underglow = mod_color(underglow, false, 100);
|
||||
break;
|
||||
case _RAISE:
|
||||
save_color(underglow);
|
||||
underglow = mod_color(underglow, true, 100);
|
||||
break;
|
||||
default:
|
||||
reset_color();
|
||||
break;
|
||||
}
|
||||
set_color(underglow, false);
|
||||
return state;
|
||||
}
|
||||
|
||||
//Tap Dance Definitions
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
[TD_3_GRV_ACT] = ACTION_TAP_DANCE_FN (dance_3),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue