diff options
Diffstat (limited to 'users')
-rw-r--r-- | users/arkag/arkag.c | 286 | ||||
-rw-r--r-- | users/arkag/arkag.h | 35 | ||||
-rw-r--r-- | users/arkag/config.h | 2 | ||||
-rw-r--r-- | users/drashna/config.h | 8 | ||||
-rw-r--r-- | users/drashna/drashna.c | 6 | ||||
-rw-r--r-- | users/drashna/drashna.h | 5 | ||||
-rw-r--r-- | users/drashna/process_records.c | 45 | ||||
-rw-r--r-- | users/drashna/rgb_stuff.c | 37 | ||||
-rw-r--r-- | users/drashna/rules.mk | 4 | ||||
-rw-r--r-- | users/jarred/jarred.h | 4 | ||||
-rw-r--r-- | users/stanrc85/config.h | 2 | ||||
-rw-r--r-- | users/stanrc85/stanrc85.c | 56 | ||||
-rw-r--r-- | users/stanrc85/stanrc85.h | 31 |
13 files changed, 341 insertions, 180 deletions
diff --git a/users/arkag/arkag.c b/users/arkag/arkag.c index 212d06de67..9e8c7af247 100644 --- a/users/arkag/arkag.c +++ b/users/arkag/arkag.c @@ -5,34 +5,7 @@ https://github.com/arkag/qmk_firmware/blob/master/keyboards/mechmini/v2/keymaps/arkag/keymap.c */ -// Start: Written by konstantin: vomindoraan -#include <ctype.h> -#include <stdlib.h> -#include <string.h> - -void send_unicode_hex_string(const char *str) { - if (!str) { return; } // Saftey net - while (*str) { - // Find the next code point (token) in the string - for (; *str == ' '; str++); - size_t n = strcspn(str, " "); // Length of the current token - char code_point[n+1]; - strncpy(code_point, str, n); - code_point[n] = '\0'; // Make sure it's null-terminated - - // Normalize the code point: make all hex digits lowercase - for (char *p = code_point; *p; p++) { - *p = tolower(*p); - } - - // Send the code point as a Unicode input string - unicode_input_start(); - send_string(code_point); - unicode_input_finish(); - str += n; // Move to the first ' ' (or '\0') after the current token - } -} -// End: Written by konstantin: vomindoraan +#include <stdbool.h> // Start: Written by Chris Lewis #ifndef MIN @@ -78,6 +51,8 @@ Color underglow, flashState flash_state = no_flash; fadeState fade_state = add_fade; activityState state = boot; +bool aesthetic = false, + shifty = false; void set_color (Color new, bool update) { rgblight_sethsv_eeprom_helper(new.h, new.s, new.v, update); @@ -146,7 +121,7 @@ void check_state (void) { case sleeping: if (!slept) { - rgblight_mode_noeeprom(4); + rgblight_mode_noeeprom(5); slept = true; activated = false; deactivated = false; @@ -249,11 +224,6 @@ void set_os (uint8_t os, bool update) { num_extra_flashes_off = 1; } -void tap_key(uint8_t keycode) { - register_code(keycode); - unregister_code(keycode); -} - // register GUI if Mac or Ctrl if other void pri_mod(bool press) { if (press) { @@ -293,13 +263,13 @@ void surround_type(uint8_t num_of_chars, uint16_t keycode, bool use_shift) { register_code(KC_LSFT); } for (int i = 0; i < num_of_chars; i++) { - tap_key(keycode); + tap_code(keycode); } if (use_shift) { unregister_code(KC_LSFT); } for (int i = 0; i < (num_of_chars/2); i++) { - tap_key(KC_LEFT); + tap_code(KC_LEFT); } } @@ -307,7 +277,7 @@ void long_keystroke(size_t num_of_keys, uint16_t keys[]) { for (int i = 0; i < num_of_keys-1; i++) { register_code(keys[i]); } - tap_key(keys[num_of_keys-1]); + tap_code(keys[num_of_keys-1]); for (int i = 0; i < num_of_keys-1; i++) { unregister_code(keys[i]); } @@ -315,7 +285,10 @@ void long_keystroke(size_t num_of_keys, uint16_t keys[]) { void dance_grv (qk_tap_dance_state_t *state, void *user_data) { if (state->count == 1) { - tap_key(KC_GRV); + tap_code(KC_GRV); + if (aesthetic) { + tap_code(KC_SPACE); + } } else if (state->count == 2) { surround_type(2, KC_GRAVE, false); } else { @@ -325,7 +298,10 @@ void dance_grv (qk_tap_dance_state_t *state, void *user_data) { void dance_quot (qk_tap_dance_state_t *state, void *user_data) { if (state->count == 1) { - tap_key(KC_QUOT); + tap_code(KC_QUOT); + if (aesthetic) { + tap_code(KC_SPACE); + } } else if (state->count == 2) { surround_type(2, KC_QUOTE, false); } else if (state->count == 3) { @@ -333,35 +309,73 @@ void dance_quot (qk_tap_dance_state_t *state, void *user_data) { } } -void dance_strk (qk_tap_dance_state_t *state, void *user_data) { +void dance_hyph (qk_tap_dance_state_t *state, void *user_data) { if (state->count == 1) { - surround_type(4, KC_TILDE, true); + tap_code(KC_MINS); + if (aesthetic) { + tap_code(KC_SPACE); + } } else if (state->count == 2) { - 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; + register_code(KC_LSFT); + tap_code(KC_MINS); + if (aesthetic) { + tap_code(KC_SPACE); } + unregister_code(KC_LSFT); + } else if (state->count == 3) { + send_unicode_hex_string("2014"); } } -void dance_3 (qk_tap_dance_state_t *state, void *user_data) { +void dance_obrck (qk_tap_dance_state_t *state, void *user_data) { if (state->count == 1) { - tap_key(KC_3); + tap_code(KC_LBRC); + if (aesthetic) { + tap_code(KC_SPACE); + } } else if (state->count == 2) { - send_unicode_hex_string("00E8"); - } else if (state->count == 3) { - send_unicode_hex_string("00E9"); + register_code(KC_LSFT); + tap_code(KC_9); + if (aesthetic) { + tap_code(KC_SPACE); + } + unregister_code(KC_LSFT); } } -void dance_c (qk_tap_dance_state_t *state, void *user_data) { +void dance_cbrck (qk_tap_dance_state_t *state, void *user_data) { if (state->count == 1) { - tap_key(KC_C); + tap_code(KC_RBRC); + if (aesthetic) { + tap_code(KC_SPACE); + } } else if (state->count == 2) { - send_unicode_hex_string("00E7"); + register_code(KC_LSFT); + tap_code(KC_0); + if (aesthetic) { + tap_code(KC_SPACE); + } + unregister_code(KC_LSFT); + } +} + +void dance_game (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + + } else if (state->count == 2) { + + } else if (state->count == 3) { + uint8_t layer = biton32(layer_state); + if (layer == _QWERTY) { + layer_off(_QWERTY); + layer_on(_GAMING); + // swirling rgb + rgblight_mode_noeeprom(12); + } else { + layer_off(_GAMING); + layer_on(_QWERTY); + rgblight_mode_noeeprom(1); + } } } @@ -383,13 +397,29 @@ void matrix_scan_user(void) { // 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)); + long_keystroke(2, (uint16_t[]){KC_LGUI, KC_PAUSE}); + } else { + return; + } + } + SEQ_TWO_KEYS(KC_LSFT, M_PMOD) { + if (current_os == OS_WIN) { + long_keystroke(3, (uint16_t[]){KC_LCTL, KC_LSFT, KC_ESC}); + } else { + } + } + 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_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)); + long_keystroke(3, (uint16_t[]){KC_LCTL, KC_LALT, KC_DEL}); } else { } } @@ -415,33 +445,33 @@ void matrix_scan_user(void) { 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); + send_unicode_hex_string("00E7"); } SEQ_TWO_KEYS(KC_C, KC_C) { + surround_type(2, KC_GRAVE, false); + } + SEQ_THREE_KEYS(KC_C, KC_C, KC_C) { surround_type(6, KC_GRAVE, false); } + SEQ_ONE_KEY(KC_E) { + send_unicode_hex_string("00E8"); + } + SEQ_TWO_KEYS(KC_E, KC_E) { + send_unicode_hex_string("00E9"); + } // end format functions // start fancy functions - SEQ_THREE_KEYS(KC_C, KC_C, KC_C) { + SEQ_THREE_KEYS(KC_C, KC_C, KC_ENT) { surround_type(6, KC_GRAVE, false); pri_mod(true); - tap_key(KC_V); + tap_code(KC_V); pri_mod(false); - tap_key(KC_RGHT); - tap_key(KC_RGHT); - tap_key(KC_RGHT); - tap_key(KC_ENTER); + tap_code(KC_RGHT); + tap_code(KC_RGHT); + tap_code(KC_RGHT); + tap_code(KC_ENTER); } // end fancy functions @@ -450,8 +480,8 @@ void matrix_scan_user(void) { // ™ send_unicode_hex_string("2122"); } - SEQ_THREE_KEYS(KC_G, KC_G, KC_T) { - SEND_STRING("@GrahamGoldenTech.com"); + SEQ_TWO_KEYS(KC_D, KC_D) { + SEND_STRING(".\\Administrator"); } SEQ_THREE_KEYS(KC_L, KC_O, KC_D) { // ಠ__ಠ @@ -482,29 +512,103 @@ void matrix_scan_user(void) { } bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (aesthetic) { + switch (keycode) { + case KC_A ... KC_0: + case KC_SPACE ... KC_SLASH: + if (record->event.pressed) { + state = active; + velocikey_accelerate(); + tap_code(keycode); + tap_code(KC_SPACE); + } + return false; + + case KC_BSPACE: + if (record->event.pressed) { + state = active; + velocikey_accelerate(); + tap_code(keycode); + tap_code(keycode); + } + return false; + default: // Do nothing + break; + } + } + + if (shifty) { + switch (keycode) { + case KC_A ... KC_Z: + if (record->event.pressed) { + int shift = rand() % 2; + state = active; + velocikey_accelerate(); + if (shift == 1){ + register_code(KC_LSFT); + } + tap_code(keycode); + if (shift == 1){ + unregister_code(KC_LSFT); + } + } + return false; + case KC_SPC: + if (record->event.pressed) { + state = active; + velocikey_accelerate(); + tap_code(keycode); + } + return false; + default: // Do nothing + break; + } + } + switch (keycode) { case M_PMOD: - if (record->event.pressed) { - pri_mod(true); - } else { - pri_mod(false); - } + pri_mod(record->event.pressed); return false; case M_SMOD: - if (record->event.pressed) { - sec_mod(true); - } else { - sec_mod(false); - } + sec_mod(record->event.pressed); return false; case M_OS: - if (record->event.pressed) { + if (record->event.pressed){ set_os((current_os+1) % _OS_COUNT, true); } + return false; + case M_SPC: + if(record->event.pressed){ + if (aesthetic) { + aesthetic = false; + rgblight_mode_noeeprom(1); + } else { + aesthetic = true; + shifty = false; + // snake mode + rgblight_mode_noeeprom(20); + } + return false; + } + + case M_SFT: + if(record->event.pressed){ + if (shifty) { + shifty = false; + rgblight_mode_noeeprom(1); + } else { + shifty = true; + aesthetic = false; + // knight mode + rgblight_mode_noeeprom(23); + } + return false; + } + default: if (record->event.pressed) { state = active; @@ -516,13 +620,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { //Tap Dance Definitions qk_tap_dance_action_t tap_dance_actions[] = { - [TD_3_GRV_ACT] = ACTION_TAP_DANCE_FN (dance_3), - [TD_C_CED] = ACTION_TAP_DANCE_FN (dance_c), [TD_GRV_3GRV] = ACTION_TAP_DANCE_FN (dance_grv), [TD_SING_DOUB] = ACTION_TAP_DANCE_FN (dance_quot), - [TD_STRK_SHOT] = ACTION_TAP_DANCE_FN (dance_strk), - [TD_HYPH_UNDR] = ACTION_TAP_DANCE_DOUBLE (KC_MINS, LSFT(KC_MINS)), - [TD_BRCK_PARN_O] = ACTION_TAP_DANCE_DOUBLE (KC_LBRC, LSFT(KC_9)), - [TD_BRCK_PARN_C] = ACTION_TAP_DANCE_DOUBLE (KC_RBRC, LSFT(KC_0)), + [TD_HYPH_UNDR] = ACTION_TAP_DANCE_FN (dance_hyph), + [TD_BRCK_PARN_O] = ACTION_TAP_DANCE_FN (dance_obrck), + [TD_BRCK_PARN_C] = ACTION_TAP_DANCE_FN (dance_cbrck), [TD_LALT_RALT] = ACTION_TAP_DANCE_DOUBLE (KC_LALT, KC_RALT), + [TD_GAME] = ACTION_TAP_DANCE_FN (dance_game), }; diff --git a/users/arkag/arkag.h b/users/arkag/arkag.h index a4672a8e82..fdc4a5fee6 100644 --- a/users/arkag/arkag.h +++ b/users/arkag/arkag.h @@ -14,12 +14,13 @@ #define STRIKE TD(TD_STRK_SHOT) #define HYPHEN TD(TD_HYPH_UNDR) #define CEDILLA TD(TD_C_CED) +#define GAME TD(TD_GAME) #define RAISE MO(1) #define LOWER MO(2) -#define KEEB MO(3) -#define MEDIA MO(4) -#define LAZY MO(5) +#define MEDIA MO(3) +#define FUNCT MO(4) +#define KEEB MO(5) #define MOD_CTL_MASK (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) #define MOD_GUI_MASK (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI)) @@ -37,9 +38,10 @@ enum { _QWERTY = 0, _RAISE, _LOWER, - _KEEB, _MEDIA, - _LAZY, + _FUNCT, + _KEEB, + _GAMING, }; typedef enum { @@ -76,22 +78,9 @@ typedef enum { enum custom_keycodes { M_PMOD = SAFE_RANGE, M_SMOD, - M_P_B, - M_C_A_D, - M_CALC, M_OS, - M_TF, - M_TM, - M_GGT, - M_LOD, - M_LENNY, - M_BOLD, - M_ITAL, - M_ULIN, - M_SNIPT, - M_REPO, - M_SHRUG, - M_UF, + M_SFT, + M_SPC, }; enum tapdances { @@ -101,16 +90,13 @@ enum tapdances { TD_SLSH_HTTP, TD_SING_DOUB, TD_HYPH_UNDR, - TD_STRK_SHOT, TD_SPECIAL, TD_BRCK_PARN_O, TD_BRCK_PARN_C, TD_LALT_RALT, - SPC_SFT_NSFT, + TD_GAME, }; -void send_unicode_hex_string(const char *str); - void velocikey_accelerate(void); void velocikey_decelerate(void); uint8_t velocikey_match_speed(uint8_t minValue, uint8_t maxValue); @@ -146,6 +132,7 @@ void dance_quot (qk_tap_dance_state_t *state, void *user_data); void dance_strk (qk_tap_dance_state_t *state, void *user_data); void dance_3 (qk_tap_dance_state_t *state, void *user_data); void dance_c (qk_tap_dance_state_t *state, void *user_data); +void dance_game (qk_tap_dance_state_t *state, void *user_data); int cur_dance (qk_tap_dance_state_t *state); void spc_finished (qk_tap_dance_state_t *state, void *user_data); diff --git a/users/arkag/config.h b/users/arkag/config.h index 2e0a9ad019..5a89a18f60 100644 --- a/users/arkag/config.h +++ b/users/arkag/config.h @@ -1,6 +1,6 @@ #pragma once #define TAPPING_TERM 200 -#define LEADER_TIMEOUT 250 +#define LEADER_TIMEOUT 300 #define LEADER_PER_KEY_TIMING diff --git a/users/drashna/config.h b/users/drashna/config.h index 2e125d1e4e..2abd326dac 100644 --- a/users/drashna/config.h +++ b/users/drashna/config.h @@ -15,10 +15,10 @@ // #ifdef RGBLIGHT_ENABLE // #define NO_MUSIC_MODE // #endif //RGBLIGHT_ENABLE/ - #ifndef __arm__ - #undef NOTE_REST - #define NOTE_REST 1.00f - #endif // !__arm__ + // #ifndef __arm__ + // #undef NOTE_REST + // #define NOTE_REST 1.00f + // #endif // !__arm__ #define UNICODE_SONG_OSX SONG(RICK_ROLL) #define UNICODE_SONG_LNX SONG(RICK_ROLL) diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 8019f26676..6968a4b928 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -144,9 +144,9 @@ void shutdown_user (void) { rgblight_setrgb_red(); #endif // RGBLIGHT_ENABLE #ifdef RGB_MATRIX_ENABLE - uint16_t timer_start = timer_read(); - rgb_matrix_set_color_all( 0xFF, 0x00, 0x00 ); - while(timer_elapsed(timer_start) < 250) { wait_ms(1); } + // uint16_t timer_start = timer_read(); + // rgb_matrix_set_color_all( 0xFF, 0x00, 0x00 ); + // while(timer_elapsed(timer_start) < 250) { wait_ms(1); } #endif //RGB_MATRIX_ENABLE shutdown_keymap(); } diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index ca55198e3e..c19b189434 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -53,11 +53,6 @@ enum userspace_layers { /* define modifiers here, since MOD_* doesn't seem to work for these */ -#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) -#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL)) -#define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) -#define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) - bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed); diff --git a/users/drashna/process_records.c b/users/drashna/process_records.c index 73cad92f60..2d9025b375 100644 --- a/users/drashna/process_records.c +++ b/users/drashna/process_records.c @@ -12,7 +12,6 @@ bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { return true; } - // Defines actions tor my global custom keycodes. Defined in drashna.h file // Then runs the _keymap's record handier if not processed here bool process_record_user(uint16_t keycode, keyrecord_t *record) { @@ -35,30 +34,28 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader if (!record->event.pressed) { - #if !defined(KEYBOARD_viterbi) - uint8_t temp_mod = get_mods(); - uint8_t temp_osm = get_oneshot_mods(); - clear_mods(); clear_oneshot_mods(); - #endif + uint8_t temp_mod = get_mods(); + uint8_t temp_osm = get_oneshot_mods(); + clear_mods(); clear_oneshot_mods(); send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), MACRO_TIMER); - #if defined(KEYBOARD_viterbi) - send_string_with_delay_P(PSTR(":dfu" SS_TAP(X_ENTER)), MACRO_TIMER); - #else - if (temp_mod & MODS_SHIFT_MASK || temp_osm & MODS_SHIFT_MASK) { - #if defined(__arm__) - send_string_with_delay_P(PSTR(":dfu-util"), MACRO_TIMER); - #elif defined(BOOTLOADER_DFU) - send_string_with_delay_P(PSTR(":dfu"), MACRO_TIMER); - #elif defined(BOOTLOADER_HALFKAY) - send_string_with_delay_P(PSTR(":teensy"), MACRO_TIMER); - #elif defined(BOOTLOADER_CATERINA) - send_string_with_delay_P(PSTR(":avrdude"), MACRO_TIMER); - #endif // bootloader options - } - if (temp_mod & MODS_CTRL_MASK || temp_osm & MODS_CTRL_MASK) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), MACRO_TIMER); } - send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), MACRO_TIMER); - set_mods(temp_mod); - #endif +#ifndef MAKE_BOOTLOADER + if ( ( temp_mod | temp_osm ) & MOD_MASK_SHIFT ) +#endif + { + #if defined(__arm__) + send_string_with_delay_P(PSTR(":dfu-util"), MACRO_TIMER); + #elif defined(BOOTLOADER_DFU) + send_string_with_delay_P(PSTR(":dfu"), MACRO_TIMER); + #elif defined(BOOTLOADER_HALFKAY) + send_string_with_delay_P(PSTR(":teensy"), MACRO_TIMER); + #elif defined(BOOTLOADER_CATERINA) + send_string_with_delay_P(PSTR(":avrdude"), MACRO_TIMER); + #endif // bootloader options + } + if ( ( temp_mod | temp_osm ) & MOD_MASK_CTRL) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), MACRO_TIMER); } + send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), MACRO_TIMER); + set_mods(temp_mod); + set_oneshot_mods(temp_osm); } break; diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c index 7eaa7e9491..a98ad590cc 100644 --- a/users/drashna/rgb_stuff.c +++ b/users/drashna/rgb_stuff.c @@ -4,6 +4,7 @@ #if defined(RGBLIGHT_ENABLE) extern rgblight_config_t rgblight_config; +bool has_initialized; #elif defined(RGB_MATRIX_ENABLE) extern rgb_config_t rgb_matrix_config; #endif @@ -17,7 +18,7 @@ void rgblight_sethsv_default_helper(uint8_t index) { #ifdef INDICATOR_LIGHTS void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { if (userspace_config.rgb_layer_change && biton32(layer_state) == 0) { - if (this_mod & MODS_SHIFT_MASK || this_led & (1<<USB_LED_CAPS_LOCK) || this_osm & MODS_SHIFT_MASK) { + if ( (this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1<<USB_LED_CAPS_LOCK) ) { #ifdef SHFT_LED1 rgblight_sethsv_at(120, 255, 255, SHFT_LED1); #endif // SHFT_LED1 @@ -32,7 +33,7 @@ void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { rgblight_sethsv_default_helper(SHFT_LED2); #endif // SHFT_LED2 } - if (this_mod & MODS_CTRL_MASK || this_osm & MODS_CTRL_MASK) { + if ( (this_mod | this_osm) & MOD_MASK_CTRL) { #ifdef CTRL_LED1 rgblight_sethsv_at(0, 255, 255, CTRL_LED1); #endif // CTRL_LED1 @@ -47,7 +48,7 @@ void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { rgblight_sethsv_default_helper(CTRL_LED2); #endif // CTRL_LED2 } - if (this_mod & MODS_GUI_MASK || this_osm & MODS_GUI_MASK) { + if ( (this_mod | this_osm) & MOD_MASK_GUI) { #ifdef GUI_LED1 rgblight_sethsv_at(51, 255, 255, GUI_LED1); #endif // GUI_LED1 @@ -62,7 +63,7 @@ void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { rgblight_sethsv_default_helper(GUI_LED2); #endif // GUI_LED2 } - if (this_mod & MODS_ALT_MASK || this_osm & MODS_ALT_MASK) { + if ( (this_mod | this_osm) & MOD_MASK_ALT) { #ifdef ALT_LED1 rgblight_sethsv_at(240, 255, 255, ALT_LED1); #endif // ALT_LED1 @@ -81,7 +82,9 @@ void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { } void matrix_scan_indicator(void) { - set_rgb_indicators(get_mods(), host_keyboard_leds(), get_oneshot_mods()); + if (has_initialized) { + set_rgb_indicators(get_mods(), host_keyboard_leds(), get_oneshot_mods()); + } } #endif //INDICATOR_LIGHTS @@ -244,22 +247,16 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { void keyboard_post_init_rgb(void) { - #ifdef RGBLIGHT_ENABLE - if (userspace_config.rgb_layer_change) { - rgblight_enable_noeeprom(); - switch (biton32(eeconfig_read_default_layer())) { - case _COLEMAK: - rgblight_sethsv_noeeprom_magenta(); break; - case _DVORAK: - rgblight_sethsv_noeeprom_springgreen(); break; - case _WORKMAN: - rgblight_sethsv_noeeprom_goldenrod(); break; - default: - rgblight_sethsv_noeeprom_cyan(); break; - } - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); - } + rgblight_enable_noeeprom(); + layer_state_set_user(layer_state); + uint16_t old_hue = rgblight_config.hue; + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + for (uint16_t i = 360; i > 0; i--) { + rgblight_sethsv_noeeprom( ( i + old_hue) % 360, 255, 255); + wait_ms(10); + } + layer_state_set_user(layer_state); #endif } diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk index 6d8612e71a..5050704a53 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk @@ -42,3 +42,7 @@ ifdef CONSOLE_ENABLE OPT_DEFS += -DKEYLOGGER_ENABLE endif endif + +ifeq ($(strip $(MAKE_BOOTLOADER)), yes) + OPT_DEFS += -DMAKE_BOOTLOADER +endif diff --git a/users/jarred/jarred.h b/users/jarred/jarred.h index 3f27163ab1..ae48adb70c 100644 --- a/users/jarred/jarred.h +++ b/users/jarred/jarred.h @@ -50,6 +50,8 @@ enum { // Wrappers #define LAYOUT_planck_grid_wrapper(...) LAYOUT_planck_grid(__VA_ARGS__) +#define LAYOUT_atreus62_grid_wrapper(...) LAYOUT(__VA_ARGS__) +#define LAYOUT_ergotravel_grid_wrapper(...) LAYOUT(__VA_ARGS__) /* Qwerty Layer */ #define QWERTY_L1 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T @@ -127,6 +129,8 @@ enum { #define MOUSE_4_DOX _______, _______, _______, _______, _______, _______ +#define BLANK_12 KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO + #define QWERTY_1_12 QWERTY_L1, QWERTY_R1 #define QWERTY_2_12 QWERTY_L2, QWERTY_R2 #define QWERTY_3_12 QWERTY_L3, QWERTY_R3 diff --git a/users/stanrc85/config.h b/users/stanrc85/config.h index 14284435be..42306727ce 100644 --- a/users/stanrc85/config.h +++ b/users/stanrc85/config.h @@ -1,6 +1,6 @@ #pragma once -#define TAPPING_TERM 200 +#define TAPPING_TERM 250 #define RETRO_TAPPING #ifdef RGBLIGHT_ENABLE diff --git a/users/stanrc85/stanrc85.c b/users/stanrc85/stanrc85.c index bddc14d7e2..78b0c4a149 100644 --- a/users/stanrc85/stanrc85.c +++ b/users/stanrc85/stanrc85.c @@ -1,10 +1,55 @@ #include "stanrc85.h" +static td_state_t td_state; + __attribute__ ((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } +// determine the tapdance state to return +int cur_dance (qk_tap_dance_state_t *state) { + if (state->count == 1) { + if (state->interrupted || !state->pressed) { return SINGLE_TAP; } + else { return SINGLE_HOLD; } + } + if (state->count == 2) { return DOUBLE_TAP; } + else { return 3; } // any number higher than the maximum state value you return above +} + +// handle the possible states for each tapdance keycode you define: +void ctl_copy_finished (qk_tap_dance_state_t *state, void *user_data) { + td_state = cur_dance(state); + switch (td_state) { + case SINGLE_TAP: + SEND_STRING(SS_LCTRL("c")); + break; + case SINGLE_HOLD: + register_mods(MOD_BIT(KC_RCTL)); + break; + case DOUBLE_TAP: + SEND_STRING(SS_LCTRL("v")); + } +} + +void ctl_copy_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (td_state) { + case SINGLE_TAP: + break; + case SINGLE_HOLD: + unregister_mods(MOD_BIT(KC_RCTL)); + break; + case DOUBLE_TAP: + break; + } +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_WIN] = ACTION_TAP_DANCE_DOUBLE(KC_CAD, KC_LOCK), + [TD_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_GRV), + [TD_RCTL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ctl_copy_finished, ctl_copy_reset) +}; + bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case KC_MAKE: @@ -32,7 +77,16 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10); set_mods(mods); } - return false; + break; + case KC_RDP: //Opens Windows RDP + if (!record->event.pressed) { + register_code(KC_LGUI); + tap_code(KC_R); + unregister_code(KC_LGUI); + wait_ms(200); + send_string_with_delay_P(PSTR("mstsc"), 10); + send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10); + } break; } return process_record_keymap(keycode, record); diff --git a/users/stanrc85/stanrc85.h b/users/stanrc85/stanrc85.h index 1d9602a05e..da52df09ba 100644 --- a/users/stanrc85/stanrc85.h +++ b/users/stanrc85/stanrc85.h @@ -8,11 +8,6 @@ #define LAYER2 2 //Function keys, arrows, custom shortcuts, volume control #define LAYER3 3 //RGB Underglow controls and RESET -enum custom_keycodes { - KC_MAKE = SAFE_RANGE, - NEW_SAFE_RANGE //use "NEW_SAFE_RANGE" for keymap specific codes -}; - //Aliases for longer keycodes #define KC_CAD LALT(LCTL(KC_DEL)) #define KC_LOCK LGUI(KC_L) @@ -22,3 +17,29 @@ enum custom_keycodes { #define LT_SPCF LT(2, KC_SPC) #define TD_TESC TD(TD_ESC) #define TD_TWIN TD(TD_WIN) +#define TD_TCTL TD(TD_RCTL) + +enum cust_keys { + KC_MAKE = SAFE_RANGE, + KC_RDP +}; + +enum tap_dance { + TD_WIN, + TD_ESC, + TD_RCTL +}; + +// define a type containing as many tapdance states as you need +typedef enum { + SINGLE_TAP, + SINGLE_HOLD, + DOUBLE_TAP +} td_state_t; + +// function to determine the current tapdance state +int cur_dance (qk_tap_dance_state_t *state); + +// `finished` and `reset` functions for each tapdance keycode +void ctl_copy_finished (qk_tap_dance_state_t *state, void *user_data); +void ctl_copy_reset (qk_tap_dance_state_t *state, void *user_data); |