summaryrefslogtreecommitdiff
path: root/users/danielo515
diff options
context:
space:
mode:
Diffstat (limited to 'users/danielo515')
-rw-r--r--users/danielo515/danielo515.c171
-rw-r--r--users/danielo515/tap_dance.c22
-rw-r--r--users/danielo515/tap_dance.h22
3 files changed, 126 insertions, 89 deletions
diff --git a/users/danielo515/danielo515.c b/users/danielo515/danielo515.c
index 9b09aed9d7..aa33f55d66 100644
--- a/users/danielo515/danielo515.c
+++ b/users/danielo515/danielo515.c
@@ -4,84 +4,121 @@ bool onMac = true;
//**************** LEADER *********************//
#ifdef LEADER_ENABLE
-LEADER_EXTERNS();
+void leader_start_user(vodi) {
# ifdef RGBLIGHT_ENABLE
-
-void leader_start() { rgblight_setrgb_range(5, 100, 199, 10, 15); };
-
-void leader_end() { rgblight_setrgb_range(200, 200, 255, 10, 15); };
+ rgblight_setrgb_range(5, 100, 199, 10, 15);
# endif
+}
-void matrix_scan_user(void) {
- if (leading && leader_sequence_size > 0 && timer_elapsed(leader_time) > LEADER_TIMEOUT) {
- leading = false;
- SEQ_ONE_KEY(KC_T) { SEND_STRING("``" SS_TAP(X_LEFT)); }
- // Triple ticks
- SEQ_TWO_KEYS(KC_T, KC_T) { SEND_STRING("```" SS_TAP(X_ENTER) SS_TAP(X_ENTER) "```" SS_TAP(X_UP)); }
- // ==== International spanish accent vowels ====
- SEQ_ONE_KEY(KC_A) { SEND_STRING(SS_LALT("e") "a"); }
- SEQ_ONE_KEY(KC_E) { SEND_STRING(SS_LALT("e") "e"); }
- SEQ_ONE_KEY(KC_I) { SEND_STRING(SS_LALT("e") "i"); }
- SEQ_ONE_KEY(KC_O) { SEND_STRING(SS_LALT("e") "o"); }
- SEQ_ONE_KEY(KC_U) { SEND_STRING(SS_LALT("e") "u"); }
- SEQ_ONE_KEY(KC_N) { SEND_STRING(SS_LALT("n") "n"); }
- // ==== MACROS ===
- SEQ_ONE_KEY(KC_G) { SEND_STRING(" | grep "); }
- SEQ_ONE_KEY(KC_K) { onMac ? SEND_STRING(SS_LCTL(" ")) : SEND_STRING(SS_LCTL("f")); }
- // vim delete all
- SEQ_TWO_KEYS(KC_D, KC_G) {
- if (onMac) {
- SEND_STRING(SS_LGUI("a") SS_TAP(X_D));
- } else {
- SEND_STRING(SS_LCTL("a") SS_TAP(X_D));
- }
+void leader_end_user() {
+ if (leader_sequence_one_key(KC_T)) {
+ SEND_STRING("``" SS_TAP(X_LEFT));
+ }
+ // Triple ticks
+ if (leader_sequence_two_keys(KC_T, KC_T)) {
+ SEND_STRING("```" SS_TAP(X_ENTER) SS_TAP(X_ENTER) "```" SS_TAP(X_UP));
+ }
+ // ==== International spanish accent vowels ====
+ if (leader_sequence_one_key(KC_A)) {
+ SEND_STRING(SS_LALT("e") "a");
+ }
+ if (leader_sequence_one_key(KC_E)) {
+ SEND_STRING(SS_LALT("e") "e");
+ }
+ if (leader_sequence_one_key(KC_I)) {
+ SEND_STRING(SS_LALT("e") "i");
+ }
+ if (leader_sequence_one_key(KC_O)) {
+ SEND_STRING(SS_LALT("e") "o");
+ }
+ if (leader_sequence_one_key(KC_U)) {
+ SEND_STRING(SS_LALT("e") "u");
+ }
+ if (leader_sequence_one_key(KC_N)) {
+ SEND_STRING(SS_LALT("n") "n");
+ }
+ // ==== MACROS ===
+ if (leader_sequence_one_key(KC_G)) {
+ SEND_STRING(" | grep ");
+ }
+ if (leader_sequence_one_key(KC_K)) {
+ onMac ? SEND_STRING(SS_LCTL(" ")) : SEND_STRING(SS_LCTL("f"));
+ }
+ // vim delete all
+ if (leader_sequence_two_keys(KC_D, KC_G)) {
+ if (onMac) {
+ SEND_STRING(SS_LGUI("a") SS_TAP(X_D));
+ } else {
+ SEND_STRING(SS_LCTL("a") SS_TAP(X_D));
}
- // tripe delete!
- SEQ_ONE_KEY(KC_BACKSPACE) { SEND_STRING(SS_TAP(X_BACKSPACE) SS_TAP(X_BACKSPACE) SS_TAP(X_BACKSPACE)); }
- SEQ_TWO_KEYS(KC_P, KC_G) { SEND_STRING("ps -ef | grep "); }
- SEQ_TWO_KEYS(KC_J, KC_A) { SEND_STRING("() => {}" SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT)); }
- // this is a pain to type
- SEQ_TWO_KEYS(KC_S, KC_S) { SEND_STRING("~/.ssh/ "); }
- SEQ_TWO_KEYS(KC_F, KC_T) { SEND_STRING("feat():" SS_TAP(X_LEFT) SS_TAP(X_LEFT)); }
- // ### LAYER CHANGE
- SEQ_ONE_KEY(KC_1) { layer_on(1); }
- // control enter, because yes
- SEQ_ONE_KEY(KC_H) { SEND_STRING(SS_DOWN(X_LCTL) SS_TAP(X_ENTER) SS_UP(X_LCTL)); }
- // paste all
- SEQ_ONE_KEY(KC_P) {
- if (onMac) {
- SEND_STRING(SS_LGUI("a") SS_LGUI("v"));
- } else {
- SEND_STRING(SS_LCTL("a") SS_LCTL("v"));
- }
+ }
+ // tripe delete!
+ if (leader_sequence_one_key(KC_BACKSPACE)) {
+ SEND_STRING(SS_TAP(X_BACKSPACE) SS_TAP(X_BACKSPACE) SS_TAP(X_BACKSPACE));
+ }
+ if (leader_sequence_two_keys(KC_P, KC_G)) {
+ SEND_STRING("ps -ef | grep ");
+ }
+ if (leader_sequence_two_keys(KC_J, KC_A)) {
+ SEND_STRING("() => {}" SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT) SS_TAP(X_LEFT));
+ }
+ // this is a pain to type
+ if (leader_sequence_two_keys(KC_S, KC_S)) {
+ SEND_STRING("~/.ssh/ ");
+ }
+ if (leader_sequence_two_keys(KC_F, KC_T)) {
+ SEND_STRING("feat():" SS_TAP(X_LEFT) SS_TAP(X_LEFT));
+ }
+ // ### LAYER CHANGE
+ if (leader_sequence_one_key(KC_1)) {
+ layer_on(1);
+ }
+ // control enter, because yes
+ if (leader_sequence_one_key(KC_H)) {
+ SEND_STRING(SS_DOWN(X_LCTL) SS_TAP(X_ENTER) SS_UP(X_LCTL));
+ }
+ // paste all
+ if (leader_sequence_one_key(KC_P)) {
+ if (onMac) {
+ SEND_STRING(SS_LGUI("a") SS_LGUI("v"));
+ } else {
+ SEND_STRING(SS_LCTL("a") SS_LCTL("v"));
}
- SEQ_THREE_KEYS(KC_M, KC_A, KC_C) {
- onMac = true;
+ }
+ if (leader_sequence_three_keys(KC_M, KC_A, KC_C)) {
+ onMac = true;
# ifdef RGBLIGHT_ENABLE
- rgblight_setrgb(255, 255, 255);
+ rgblight_setrgb(255, 255, 255);
# endif
- }
- SEQ_THREE_KEYS(KC_W, KC_I, KC_N) {
- onMac = false;
+ }
+ if (leader_sequence_three_keys(KC_W, KC_I, KC_N)) {
+ onMac = false;
# ifdef RGBLIGHT_ENABLE
- rgblight_setrgb(255, 255, 0);
+ rgblight_setrgb(255, 255, 0);
# endif
+ }
+ /* Copy all */
+ if (leader_sequence_one_key(KC_Y)) {
+ if (onMac) {
+ SEND_STRING(SS_LGUI("a") SS_LGUI("c"));
+ } else {
+ SEND_STRING(SS_LCTL("a") SS_LCTL("c"));
}
- /* Copy all */
- SEQ_ONE_KEY(KC_Y) {
- if (onMac) {
- SEND_STRING(SS_LGUI("a") SS_LGUI("c"));
- } else {
- SEND_STRING(SS_LCTL("a") SS_LCTL("c"));
- }
- }
- // emoji bar
- SEQ_TWO_KEYS(KC_E, KC_E) { SEND_STRING(SS_DOWN(X_LGUI) SS_LCTL(" ") SS_UP(X_LGUI)); }
-
- SEQ_TWO_KEYS(KC_F, KC_F) { SEND_STRING("ps -ef | grep "); }
- SEQ_TWO_KEYS(KC_H, KC_T) { SEND_STRING("https://"); }
+ }
+ // emoji bar
+ if (leader_sequence_two_keys(KC_E, KC_E)) {
+ SEND_STRING(SS_DOWN(X_LGUI) SS_LCTL(" ") SS_UP(X_LGUI));
+ }
- leader_end();
+ if (leader_sequence_two_keys(KC_F, KC_F)) {
+ SEND_STRING("ps -ef | grep ");
}
+ if (leader_sequence_two_keys(KC_H, KC_T)) {
+ SEND_STRING("https://");
+ }
+
+# ifdef RGBLIGHT_ENABLE
+ rgblight_setrgb_range(200, 200, 255, 10, 15);
+# endif
}
#endif // LEADER
diff --git a/users/danielo515/tap_dance.c b/users/danielo515/tap_dance.c
index a07b4c792f..b69ee715d4 100644
--- a/users/danielo515/tap_dance.c
+++ b/users/danielo515/tap_dance.c
@@ -1,7 +1,7 @@
#include "tap_dance.h"
//**************** Definitions needed for quad function to work *********************//
#ifdef QUAD_DANCE
-int cur_dance(qk_tap_dance_state_t *state)
+int cur_dance(tap_dance_state_t *state)
{
if (state->count == 1)
{
@@ -30,8 +30,8 @@ int cur_dance(qk_tap_dance_state_t *state)
# endif
// Slightly better tap dance double: interruption sends double single and any number over double sends the single that number of times
-void qk_tap_dance_pair_finished_safe(qk_tap_dance_state_t *state, void *user_data) {
- qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data;
+void tap_dance_pair_finished_safe(tap_dance_state_t *state, void *user_data) {
+ tap_dance_pair_t *pair = (tap_dance_pair_t *)user_data;
int count = state->count;
if (state->count == 2) {
if (state->interrupted){
@@ -47,8 +47,8 @@ void qk_tap_dance_pair_finished_safe(qk_tap_dance_state_t *state, void *user_dat
}
}
-void qk_tap_dance_pair_reset_safe(qk_tap_dance_state_t *state, void *user_data) {
- qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data;
+void tap_dance_pair_reset_safe(tap_dance_state_t *state, void *user_data) {
+ tap_dance_pair_t *pair = (tap_dance_pair_t *)user_data;
if (state->count == 2) {
unregister_code16 (pair->kc2);
return;
@@ -58,7 +58,7 @@ void qk_tap_dance_pair_reset_safe(qk_tap_dance_state_t *state, void *user_data)
//**************** Tap dance functions *********************//
-qk_tap_dance_action_t tap_dance_actions[] = {
+tap_dance_action_t tap_dance_actions[] = {
[COPY_CUT] = ACTION_TAP_DANCE_FN(td_copy_cut),
[PASTE_DANCE] = ACTION_TAP_DANCE_FN(td_paste),
[_TD_F1] = ACTION_TAP_DANCE_DOUBLE(KC_1, KC_F1),
@@ -86,7 +86,7 @@ qk_tap_dance_action_t tap_dance_actions[] = {
[_TD_PASTE] = ACTION_TAP_DANCE_FN(dance_paste)
};
-void td_copy_cut(qk_tap_dance_state_t *state, void *user_data)
+void td_copy_cut(tap_dance_state_t *state, void *user_data)
{
if (state->count == 2)
{
@@ -99,7 +99,7 @@ void td_copy_cut(qk_tap_dance_state_t *state, void *user_data)
reset_tap_dance(state);
};
-void td_paste(qk_tap_dance_state_t *state, void *user_data)
+void td_paste(tap_dance_state_t *state, void *user_data)
{
if (state->count == 2)
{
@@ -113,7 +113,7 @@ void td_paste(qk_tap_dance_state_t *state, void *user_data)
};
//===== The awesome tap dance for CUT, COPY and PASTE letters
-void dance_copy (qk_tap_dance_state_t *state, void *user_data) {
+void dance_copy (tap_dance_state_t *state, void *user_data) {
if (state->count == 1) { tap_code16(KC_C); }
else
if (state->interrupted) { tap_code16(KC_C);tap_code16(KC_C);}
@@ -122,13 +122,13 @@ void dance_copy (qk_tap_dance_state_t *state, void *user_data) {
reset_tap_dance (state);
}
-void dance_cut (qk_tap_dance_state_t *state, void *user_data) {
+void dance_cut (tap_dance_state_t *state, void *user_data) {
if (state->count == 1) { tap_code16(KC_X); }
else { CMD(KC_X); }
reset_tap_dance (state);
}
-void dance_paste (qk_tap_dance_state_t *state, void *user_data) {
+void dance_paste (tap_dance_state_t *state, void *user_data) {
if (state->count == 1) {
tap_code16(KC_V);
}
diff --git a/users/danielo515/tap_dance.h b/users/danielo515/tap_dance.h
index 880ad525ee..aaf3864841 100644
--- a/users/danielo515/tap_dance.h
+++ b/users/danielo515/tap_dance.h
@@ -4,8 +4,8 @@ extern bool onMac;
#define ACTION_TAP_DANCE_DOUBLE_SAFE(kc1, kc2) { \
- .fn = { NULL, qk_tap_dance_pair_finished_safe, qk_tap_dance_pair_reset_safe }, \
- .user_data = (void *)&((qk_tap_dance_pair_t) { kc1, kc2 }), \
+ .fn = { NULL, tap_dance_pair_finished_safe, tap_dance_pair_reset_safe }, \
+ .user_data = (void *)&((tap_dance_pair_t) { kc1, kc2 }), \
}
#ifdef QUAD_DANCE
@@ -18,7 +18,7 @@ enum {
DOUBLE_SINGLE_TAP = 5 //send SINGLE_TAP twice - NOT DOUBLE_TAP
// Add more enums here if you want for triple, quadruple, etc.
};
-int cur_dance (qk_tap_dance_state_t *state);
+int cur_dance (tap_dance_state_t *state);
# endif
enum tap_dance {
@@ -48,14 +48,14 @@ enum tap_dance {
_TD_CUT,
_TD_PASTE,
};
-void qk_tap_dance_pair_finished_safe(qk_tap_dance_state_t *state, void *user_data);
-void qk_tap_dance_pair_reset_safe(qk_tap_dance_state_t *state, void *user_data);
-void td_copy_cut (qk_tap_dance_state_t *state, void *user_data);
-void td_paste(qk_tap_dance_state_t *state, void *user_data);
-int cur_dance (qk_tap_dance_state_t *state);
-void dance_cut (qk_tap_dance_state_t *state, void *user_data);
-void dance_copy (qk_tap_dance_state_t *state, void *user_data);
-void dance_paste (qk_tap_dance_state_t *state, void *user_data);
+void tap_dance_pair_finished_safe(tap_dance_state_t *state, void *user_data);
+void tap_dance_pair_reset_safe(tap_dance_state_t *state, void *user_data);
+void td_copy_cut (tap_dance_state_t *state, void *user_data);
+void td_paste(tap_dance_state_t *state, void *user_data);
+int cur_dance (tap_dance_state_t *state);
+void dance_cut (tap_dance_state_t *state, void *user_data);
+void dance_copy (tap_dance_state_t *state, void *user_data);
+void dance_paste (tap_dance_state_t *state, void *user_data);
// Ready to use Tap dance definitions, just put them on your layout
#define TD_COPY TD(_TD_COPY)