summaryrefslogtreecommitdiff
path: root/users
diff options
context:
space:
mode:
Diffstat (limited to 'users')
-rw-r--r--users/scotto/config.h25
-rw-r--r--users/scotto/readme.md17
-rw-r--r--users/scotto/rules.mk11
-rw-r--r--users/scotto/scotto.c15
-rw-r--r--users/scotto/scotto.h69
-rw-r--r--users/scotto/tap_dance.c154
-rw-r--r--users/scotto/tap_dance.h39
7 files changed, 330 insertions, 0 deletions
diff --git a/users/scotto/config.h b/users/scotto/config.h
new file mode 100644
index 0000000000..34fe069d6e
--- /dev/null
+++ b/users/scotto/config.h
@@ -0,0 +1,25 @@
1/*
2Copyright 2023 Joe Scotto
3This program is free software: you can redistribute it and/or modify
4it under the terms of the GNU General Public License as published by
5the Free Software Foundation, either version 2 of the License, or
6(at your option) any later version.
7This program is distributed in the hope that it will be useful,
8but WITHOUT ANY WARRANTY; without even the implied warranty of
9MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10GNU General Public License for more details.
11You should have received a copy of the GNU General Public License
12along with this program. If not, see <http://www.gnu.org/licenses/>.
13*/
14
15#pragma once
16
17// config added when Tap Dance is enabled
18#ifdef TAP_DANCE_ENABLE
19# ifdef TAPPING_TERM
20# undef TAPPING_TERM
21# define TAPPING_TERM 135
22# endif
23# define TAPPING_TERM_PER_KEY
24# define PERMISSIVE_HOLD
25#endif
diff --git a/users/scotto/readme.md b/users/scotto/readme.md
new file mode 100644
index 0000000000..f7fdeb24c4
--- /dev/null
+++ b/users/scotto/readme.md
@@ -0,0 +1,17 @@
1# Scotto
2
3Applies to layouts:
4- LAYOUT_ortho_4x10
5- LAYOUT_split_3x5_2
6- LAYOUT_split_3x5_3
7
8### QWERTY
9
10Scotto's default functional layout is Colemak. To compile this layout in QWERTY (US English), append compile command with `KEYMAP=QWERTY` environment variable.
11```
12qmk compile -kb <keyboardName> -km scotto -e KEYMAP=QWERTY
13```
14Example for [Scotto34](/keyboards/scottokeebs/scotto34):
15```
16qmk compile -kb scottokeebs/scotto34 -km scotto -e KEYMAP=QWERTY
17```
diff --git a/users/scotto/rules.mk b/users/scotto/rules.mk
new file mode 100644
index 0000000000..50a0196675
--- /dev/null
+++ b/users/scotto/rules.mk
@@ -0,0 +1,11 @@
1SRC += scotto.c
2
3TAP_DANCE_ENABLE = yes
4
5ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
6 SRC += tap_dance.c
7endif
8
9ifneq ($(strip $(KEYMAP)),)
10 OPT_DEFS += -DKEYMAP_$(KEYMAP)
11endif
diff --git a/users/scotto/scotto.c b/users/scotto/scotto.c
new file mode 100644
index 0000000000..41520973c6
--- /dev/null
+++ b/users/scotto/scotto.c
@@ -0,0 +1,15 @@
1/*
2Copyright 2023 Joe Scotto
3This program is free software: you can redistribute it and/or modify
4it under the terms of the GNU General Public License as published by
5the Free Software Foundation, either version 2 of the License, or
6(at your option) any later version.
7This program is distributed in the hope that it will be useful,
8but WITHOUT ANY WARRANTY; without even the implied warranty of
9MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10GNU General Public License for more details.
11You should have received a copy of the GNU General Public License
12along with this program. If not, see <http://www.gnu.org/licenses/>.
13*/
14
15#include "scotto.h"
diff --git a/users/scotto/scotto.h b/users/scotto/scotto.h
new file mode 100644
index 0000000000..023906852e
--- /dev/null
+++ b/users/scotto/scotto.h
@@ -0,0 +1,69 @@
1/*
2Copyright 2023 Joe Scotto
3This program is free software: you can redistribute it and/or modify
4it under the terms of the GNU General Public License as published by
5the Free Software Foundation, either version 2 of the License, or
6(at your option) any later version.
7This program is distributed in the hope that it will be useful,
8but WITHOUT ANY WARRANTY; without even the implied warranty of
9MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10GNU General Public License for more details.
11You should have received a copy of the GNU General Public License
12along with this program. If not, see <http://www.gnu.org/licenses/>.
13*/
14
15#pragma once
16
17#include QMK_KEYBOARD_H
18
19#ifdef TAP_DANCE_ENABLE
20 #include "tap_dance.h"
21#endif
22
23// Assign rows of keycodes to a single def each
24#define __QWERTY1__ KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P
25#define __QWERTY2__ KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_BSPC
26#define __QWERTY3a_ LSFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RSFT_T(KC_SLSH)
27#define __QWERTY3b_ KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH
28
29#define __COLEMAK1__ KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_BSPC
30#define __COLEMAK2__ KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O
31#define __COLEMAK3a_ LSFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, RSFT_T(KC_SLSH)
32#define __COLEMAK3b_ KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH
33
34#define ______________SYM_MEDIA_NAV1______________ KC_UNDS, KC_MINS, KC_PLUS, KC_EQL, KC_COLN, KC_GRV, KC_MRWD, KC_MPLY, KC_MFFD, KC_DEL
35#define ______________SYM_MEDIA_NAV2______________ KC_LCBR, KC_LPRN, KC_RPRN, KC_RCBR, KC_PIPE, KC_ESC, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT
36#define ______________SYM_MEDIA_NAV3______________ LSFT_T(KC_LBRC), KC_QUOT, KC_DQUO, KC_RBRC, KC_SCLN, KC_TILD, KC_VOLD, KC_MUTE, KC_VOLU, RSFT_T(KC_BSLS)
37
38#define _________________NUM_SYM1_________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_CAPS, KC_BSPC
39#define _________________NUM_SYM2_________________ KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0
40#define _________________NUM_SYM3a________________ KC_LSFT, KC_NO, KC_NO, KC_NO, MO(3), KC_NO, KC_NO, KC_COMM, KC_DOT, RSFT_T(KC_SLSH)
41#define _________________NUM_SYM3b________________ KC_LSFT, KC_NO, KC_NO, KC_NO, MO(8), KC_NO, KC_NO, KC_COMM, KC_DOT, RSFT_T(KC_SLSH)
42
43#define ________________FUNC_SYS1a________________ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, TO(5), TO(4)
44#define ________________FUNC_SYS1b________________ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, TO(4), TO(5), TO(0)
45#define ________________FUNC_SYS2_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10
46#define ________________FUNC_SYS3_________________ KC_F11, KC_NO, KC_NO, QK_BOOT, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_F12
47
48#define _______THUMB6_1_______ TD(TD_LCTL_ESC_SPOTLIGHT_EMOJI), KC_LALT, LGUI_T(KC_SPC), LT(1, KC_TAB), LT(2, KC_ENT), TD(TD_LCTL_ESC_SPOTLIGHT_EMOJI)
49#define _______THUMB6_4_______ TD(TD_LALT_ESC_WINDOWS_EMOJI), KC_LALT, LCTL_T(KC_SPC), LT(6, KC_TAB), LT(7, KC_ENT), TD(TD_LALT_ESC_WINDOWS_EMOJI)
50#define _______THUMB6_5_______ TD(TD_LALT_ESC_WINDOWS_EMOJI), KC_LCTL, KC_SPC, LT(6, KC_TAB), LT(7, KC_ENT), TD(TD_LALT_ESC_WINDOWS_EMOJI)
51#define _____THUMB6_TRNS______ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
52
53#define _______THUMB4_1_______ TD(TD_ESC_LALT_LCTL_SPOTLIGHT_EMOJI), LGUI_T(KC_SPC), LT(1, KC_TAB), LT(2, KC_ENT)
54#define _______THUMB4_4_______ TD(TD_ESC_LCTL_LALT_WINDOWS_EMOJI), LCTL_T(KC_SPC), LT(6, KC_TAB), LT(7, KC_ENT)
55#define _______THUMB4_5_______ KC_LCTL, KC_SPC, LT(6, KC_TAB), LT(7, KC_ENT)
56#define _____THUMB4_TRNS______ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
57
58// set functional layout
59#if defined (KEYMAP_QWERTY)
60 #define _________________KEYMAP1__________________ __QWERTY1__
61 #define _________________KEYMAP2__________________ __QWERTY2__
62 #define _________________KEYMAP3a_________________ __QWERTY3a_
63 #define _________________KEYMAP3b_________________ __QWERTY3b_
64#else
65 #define _________________KEYMAP1__________________ __COLEMAK1__
66 #define _________________KEYMAP2__________________ __COLEMAK2__
67 #define _________________KEYMAP3a_________________ __COLEMAK3a_
68 #define _________________KEYMAP3b_________________ __COLEMAK3b_
69#endif
diff --git a/users/scotto/tap_dance.c b/users/scotto/tap_dance.c
new file mode 100644
index 0000000000..e618384334
--- /dev/null
+++ b/users/scotto/tap_dance.c
@@ -0,0 +1,154 @@
1/*
2Copyright 2023 Joe Scotto
3This program is free software: you can redistribute it and/or modify
4it under the terms of the GNU General Public License as published by
5the Free Software Foundation, either version 2 of the License, or
6(at your option) any later version.
7This program is distributed in the hope that it will be useful,
8but WITHOUT ANY WARRANTY; without even the implied warranty of
9MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10GNU General Public License for more details.
11You should have received a copy of the GNU General Public License
12along with this program. If not, see <http://www.gnu.org/licenses/>.
13*/
14
15#include "tap_dance.h"
16#include "scotto.h"
17
18// Create an instance of 'td_tap_t' for the 'x' tap dance.
19static td_tap_t xtap_state = {
20 .is_press_action = true,
21 .state = TD_NONE
22};
23
24td_state_t cur_dance(tap_dance_state_t *state) {
25 if (state->count == 1) {
26 if (state->interrupted || !state->pressed) {
27 return TD_SINGLE_TAP;
28 } else {
29 return TD_SINGLE_HOLD;
30 }
31 } else if (state->count == 2) {
32 if (state->interrupted || !state->pressed) {
33 return TD_DOUBLE_TAP;
34 } else {
35 return TD_DOUBLE_HOLD;
36 }
37 } else if (state->count == 3) {
38 if (state->interrupted || !state->pressed) {
39 return TD_TRIPLE_TAP;
40 } else {
41 return TD_TRIPLE_HOLD;
42 }
43 }
44
45 return TD_UNKNOWN;
46}
47
48void td_esc_lalt_lctl_spotlight_emoji_finished(tap_dance_state_t *state, void *user_data) {
49 xtap_state.state = cur_dance(state);
50 switch (xtap_state.state) {
51 case TD_SINGLE_TAP: tap_code(KC_ESC); break;
52 case TD_SINGLE_HOLD: register_code(KC_LALT); break;
53 case TD_DOUBLE_HOLD: register_code(KC_LCTL); break;
54 case TD_DOUBLE_TAP: tap_code16(G(KC_SPC)); break;
55 case TD_TRIPLE_TAP: tap_code16(C(G(KC_SPC))); break;
56 default: break;
57 }
58}
59
60void td_esc_lalt_lctl_spotlight_emoji_reset(tap_dance_state_t *state, void *user_data) {
61 switch (xtap_state.state) {
62 case TD_SINGLE_TAP: unregister_code(KC_ESC); break;
63 case TD_SINGLE_HOLD: unregister_code(KC_LALT); break;
64 case TD_DOUBLE_HOLD: unregister_code(KC_LCTL); break;
65 default: break;
66 }
67 xtap_state.state = TD_NONE;
68}
69
70void td_esc_lctl_lalt_windows_emoji_finished(tap_dance_state_t *state, void *user_data) {
71 xtap_state.state = cur_dance(state);
72 switch (xtap_state.state) {
73 case TD_SINGLE_TAP: tap_code16(KC_ESC); break;
74 case TD_SINGLE_HOLD: register_code(KC_LCTL); break;
75 case TD_DOUBLE_HOLD: register_code(KC_LALT); break;
76 case TD_DOUBLE_TAP: tap_code(KC_LGUI); break;
77 case TD_TRIPLE_TAP: tap_code16(G(KC_DOT)); break;
78 default: break;
79 }
80}
81
82void td_esc_lctl_lalt_windows_emoji_reset(tap_dance_state_t *state, void *user_data) {
83 switch (xtap_state.state) {
84 case TD_SINGLE_TAP: unregister_code(KC_ESC); break;
85 case TD_SINGLE_HOLD: unregister_code(KC_LCTL); break;
86 case TD_DOUBLE_HOLD: unregister_code(KC_LALT); break;
87 default: break;
88 }
89 xtap_state.state = TD_NONE;
90}
91
92void td_lalt_esc_windowr_emoji_finished(tap_dance_state_t *state, void *user_data) {
93 xtap_state.state = cur_dance(state);
94 switch (xtap_state.state) {
95 case TD_SINGLE_TAP: register_code(KC_ESC); break;
96 case TD_SINGLE_HOLD: register_code(KC_LALT); break;
97 case TD_DOUBLE_TAP: tap_code(KC_LGUI); break;
98 case TD_TRIPLE_TAP: tap_code16(G(KC_DOT)); break;
99 default: break;
100 }
101}
102
103void td_lalt_esc_windowr_emoji_reset(tap_dance_state_t *state, void *user_data) {
104 switch (xtap_state.state) {
105 case TD_SINGLE_TAP: unregister_code(KC_ESC); break;
106 case TD_SINGLE_HOLD: unregister_code(KC_LALT); break;
107 default: break;
108 }
109 xtap_state.state = TD_NONE;
110}
111
112void td_lctl_esc_spotlight_emoji_finished(tap_dance_state_t *state, void *user_data) {
113 xtap_state.state = cur_dance(state);
114 switch (xtap_state.state) {
115 case TD_SINGLE_TAP: register_code(KC_ESC); break;
116 case TD_SINGLE_HOLD: register_code(KC_LCTL); break;
117 case TD_DOUBLE_TAP: tap_code16(G(KC_SPC)); break;
118 case TD_TRIPLE_TAP: tap_code16(C(G(KC_SPC))); break;
119 default: break;
120 }
121}
122
123void td_lctl_esc_spotlight_emoji_reset(tap_dance_state_t *state, void *user_data) {
124 switch (xtap_state.state) {
125 case TD_SINGLE_TAP: unregister_code(KC_ESC); break;
126 case TD_SINGLE_HOLD: unregister_code(KC_LCTL); break;
127 default: break;
128 }
129 xtap_state.state = TD_NONE;
130}
131
132 // Tap Dance definitions
133tap_dance_action_t tap_dance_actions[] = {
134 [TD_LCTL_ESC_SPOTLIGHT_EMOJI] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, td_lctl_esc_spotlight_emoji_finished, td_lctl_esc_spotlight_emoji_reset),
135 [TD_LALT_ESC_WINDOWS_EMOJI] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, td_lalt_esc_windowr_emoji_finished, td_lalt_esc_windowr_emoji_reset),
136 [TD_ESC_LALT_LCTL_SPOTLIGHT_EMOJI] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, td_esc_lalt_lctl_spotlight_emoji_finished, td_esc_lalt_lctl_spotlight_emoji_reset),
137 [TD_ESC_LCTL_LALT_WINDOWS_EMOJI] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, td_esc_lctl_lalt_windows_emoji_finished, td_esc_lctl_lalt_windows_emoji_reset),
138};
139
140uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
141 switch (keycode) {
142 case TD(TD_LCTL_ESC_SPOTLIGHT_EMOJI) :
143 case TD(TD_LALT_ESC_WINDOWS_EMOJI) :
144 case TD(TD_ESC_LALT_LCTL_SPOTLIGHT_EMOJI) :
145 case TD(TD_ESC_LCTL_LALT_WINDOWS_EMOJI) :
146 case LGUI_T(KC_SPC) :
147 case LT(1, KC_SPC) :
148 case LT(1, KC_TAB) :
149 case LT(2, KC_ENT) :
150 return 200;
151 default:
152 return TAPPING_TERM;
153 }
154};
diff --git a/users/scotto/tap_dance.h b/users/scotto/tap_dance.h
new file mode 100644
index 0000000000..4082d2b9fb
--- /dev/null
+++ b/users/scotto/tap_dance.h
@@ -0,0 +1,39 @@
1/*
2Copyright 2023 Joe Scotto
3This program is free software: you can redistribute it and/or modify
4it under the terms of the GNU General Public License as published by
5the Free Software Foundation, either version 2 of the License, or
6(at your option) any later version.
7This program is distributed in the hope that it will be useful,
8but WITHOUT ANY WARRANTY; without even the implied warranty of
9MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10GNU General Public License for more details.
11You should have received a copy of the GNU General Public License
12along with this program. If not, see <http://www.gnu.org/licenses/>.
13*/
14
15#pragma once
16#include "scotto.h"
17
18typedef enum {
19 TD_NONE = 0,
20 TD_UNKNOWN,
21 TD_SINGLE_HOLD,
22 TD_DOUBLE_HOLD,
23 TD_TRIPLE_HOLD,
24 TD_SINGLE_TAP,
25 TD_DOUBLE_TAP,
26 TD_TRIPLE_TAP
27} td_state_t;
28
29typedef struct {
30 bool is_press_action;
31 td_state_t state;
32} td_tap_t;
33
34enum {
35 TD_LCTL_ESC_SPOTLIGHT_EMOJI = 0,
36 TD_LALT_ESC_WINDOWS_EMOJI,
37 TD_ESC_LALT_LCTL_SPOTLIGHT_EMOJI,
38 TD_ESC_LCTL_LALT_WINDOWS_EMOJI
39};