aboutsummaryrefslogtreecommitdiff
path: root/users
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2021-08-14 01:15:07 +0000
committerQMK Bot <hello@qmk.fm>2021-08-14 01:15:07 +0000
commite80772da401e545887b84b8addc4169b090cfa3e (patch)
tree5bc04994077f4e34b1f1c50bd9e42c4e413b8e32 /users
parent1412a785ed012f7c2695632fc48ef080fc440f80 (diff)
parentade989962af613b24687f20f54e2dd0e37240216 (diff)
downloadqmk_firmware-e80772da401e545887b84b8addc4169b090cfa3e.tar.gz
qmk_firmware-e80772da401e545887b84b8addc4169b090cfa3e.zip
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'users')
-rw-r--r--users/replicaJunction/config.h66
-rw-r--r--users/replicaJunction/features/.gitignore2
-rw-r--r--users/replicaJunction/features/caps_word.c105
-rw-r--r--users/replicaJunction/features/caps_word.h26
-rw-r--r--users/replicaJunction/features/mouse_jiggle.c46
-rw-r--r--users/replicaJunction/features/mouse_jiggle.h23
-rw-r--r--users/replicaJunction/features/num_word.c129
-rw-r--r--users/replicaJunction/features/num_word.h27
-rw-r--r--users/replicaJunction/features/secrets.c51
-rw-r--r--users/replicaJunction/features/secrets.h30
-rw-r--r--users/replicaJunction/features/super_alt_tab.c52
-rw-r--r--users/replicaJunction/features/super_alt_tab.h27
-rw-r--r--users/replicaJunction/keycode_aliases.h85
-rw-r--r--users/replicaJunction/matrix_scan.c35
-rw-r--r--users/replicaJunction/process_records.c149
-rw-r--r--users/replicaJunction/process_records.h21
-rw-r--r--users/replicaJunction/readme.md101
-rw-r--r--users/replicaJunction/replicaJunction.c164
-rw-r--r--users/replicaJunction/replicaJunction.h138
-rw-r--r--users/replicaJunction/rj_keycodes.h63
-rw-r--r--users/replicaJunction/rj_layers.h40
-rw-r--r--users/replicaJunction/rules.mk32
22 files changed, 1086 insertions, 326 deletions
diff --git a/users/replicaJunction/config.h b/users/replicaJunction/config.h
deleted file mode 100644
index 4b58b579f..000000000
--- a/users/replicaJunction/config.h
+++ /dev/null
@@ -1,66 +0,0 @@
1#pragma once
2
3
4////////////////////////////////////////////////////////////////////////////////
5// Features That Can Be Enabled
6// https://docs.qmk.fm/reference/config-options#features-that-can-be-enabled
7////////////////////////////////////////////////////////////////////////////////
8
9////////////////////////////////////////////////////////////////////////////////
10// Behaviors That Can Be Configured
11// https://docs.qmk.fm/reference/config-options#behaviors-that-can-be-configured
12////////////////////////////////////////////////////////////////////////////////
13
14// MS the button needs to be held before a tap becomes a hold (default: 200)
15#undef TAPPING_TERM
16#define TAPPING_TERM 250
17
18// Makes it easier for fast typists to use dual-role keys. See additional details here:
19// https://docs.qmk.fm/features/advanced-keycodes#permissive-hold
20#define PERMISSIVE_HOLD
21
22// MS after tapping the Leader key to listen for a sequence (default: 300)
23#undef LEADER_TIMEOUT
24#define LEADER_TIMEOUT 750
25
26// This makes it possible to do rolling combos (zx) with keys that convert to other keys on hold
27// (for example, if z becomes ctrl when you hold it, when this option isn't enabled, z rapidly
28// followed by x actually sends Ctrl-x. That's bad.)
29#define IGNORE_MOD_TAP_INTERRUPT
30
31
32
33////////////////////////////////////////////////////////////////////////////////
34// Mouse Key Options
35// https://docs.qmk.fm/reference/config-options#mouse-key-options
36////////////////////////////////////////////////////////////////////////////////
37
38#ifdef MOUSEKEY_ENABLE
39// Mouse key config
40
41// Frequency with which cursor movements are sent. Lower means more resolution / DPI.
42// Default: 20
43// #undef MOUSEKEY_INTERVAL
44// #define MOUSEKEY_INTERVAL 20
45
46// MS after pressing the key before initial movement begins. Lower means quicker response.
47// Default: 0
48// #undef MOUSEKEY_DELAY
49// #define MOUSEKEY_DELAY 0
50
51// MS it takes the cursor to accelerate to max speed
52// Default: 60
53// #undef MOUSEKEY_TIME_TO_MAX
54// #define MOUSEKEY_TIME_TO_MAX 60
55
56// Maximum speed for the mouse keys
57// Default: 7
58// #undef MOUSEKEY_MAX_SPEED
59// #define MOUSEKEY_MAX_SPEED 7
60
61// Delay before the mouse wheel
62// Default: 0
63// #undef MOUSEKEY_WHEEL_DELAY
64// #define MOUSEKEY_WHEEL_DELAY 0
65
66#endif // MOUSEKEY_ENABLE
diff --git a/users/replicaJunction/features/.gitignore b/users/replicaJunction/features/.gitignore
new file mode 100644
index 000000000..9b590ee80
--- /dev/null
+++ b/users/replicaJunction/features/.gitignore
@@ -0,0 +1,2 @@
1# Do not include the secrets definitions
2secret_definitions.h
diff --git a/users/replicaJunction/features/caps_word.c b/users/replicaJunction/features/caps_word.c
new file mode 100644
index 000000000..536da81ec
--- /dev/null
+++ b/users/replicaJunction/features/caps_word.c
@@ -0,0 +1,105 @@
1/* Copyright 2021 Joshua T.
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "caps_word.h"
18
19static bool is_caps_word_on = false;
20
21bool is_caps_word_enabled(void) {
22 return is_caps_word_on;
23}
24
25void enable_caps_word(void) {
26 if (is_caps_word_on) return;
27 is_caps_word_on = true;
28 tap_code(KC_CAPS);
29}
30
31void disable_caps_word(void) {
32 if (!is_caps_word_on) return;
33 is_caps_word_on = false;
34 tap_code(KC_CAPS);
35}
36
37void toggle_caps_word(void) {
38 if (is_caps_word_on) {
39 disable_caps_word();
40 }
41 else {
42 enable_caps_word();
43 }
44}
45
46bool should_terminate_caps_word(uint16_t keycode, const keyrecord_t *record) {
47 switch (keycode) {
48 // Keycodes which should not disable caps word mode
49 case KC_A ... KC_Z:
50 case KC_1 ... KC_0:
51 case KC_MINS:
52 case KC_UNDS:
53 case KC_BSPC:
54 return false;
55
56 default:
57 if (record->event.pressed) {
58 return true;
59 }
60 return false;
61 }
62
63 // Should be unreachable
64 return false;
65}
66
67
68bool process_record_caps_word(uint16_t keycode, const keyrecord_t *record) {
69 // Nothing in this function acts on key release
70 if (!record->event.pressed) {
71 return true;
72 }
73
74 // Handle the custom keycodes that go with this feature
75 if (keycode == CAPWORD) {
76 enable_caps_word();
77 return false;
78 }
79
80 // If the behavior isn't enabled and the keypress isn't a keycode to
81 // toggle the behavior, allow QMK to handle the keypress as usual
82 if (!is_caps_word_on) {
83 return true;
84 }
85
86 // Get the base keycode of a mod or layer tap key
87 switch (keycode) {
88 case QK_MOD_TAP ... QK_MOD_TAP_MAX:
89 case QK_LAYER_TAP ... QK_LAYER_TAP_MAX:
90 case QK_TAP_DANCE ... QK_TAP_DANCE_MAX:
91 // Earlier return if this has not been considered tapped yet
92 if (record->tap.count == 0)
93 return true;
94 keycode = keycode & 0xFF;
95 break;
96 default:
97 break;
98 }
99
100 if (should_terminate_caps_word(keycode, record)) {
101 disable_caps_word();
102 }
103
104 return true;
105}
diff --git a/users/replicaJunction/features/caps_word.h b/users/replicaJunction/features/caps_word.h
new file mode 100644
index 000000000..4182ce582
--- /dev/null
+++ b/users/replicaJunction/features/caps_word.h
@@ -0,0 +1,26 @@
1/* Copyright 2021 Joshua T.
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18#include QMK_KEYBOARD_H
19#include "rj_keycodes.h"
20
21bool is_caps_word_enabled(void);
22void enable_caps_word(void);
23void disable_caps_word(void);
24void toggle_caps_word(void);
25
26bool process_record_caps_word(uint16_t keycode, const keyrecord_t *record);
diff --git a/users/replicaJunction/features/mouse_jiggle.c b/users/replicaJunction/features/mouse_jiggle.c
new file mode 100644
index 000000000..b2c451d33
--- /dev/null
+++ b/users/replicaJunction/features/mouse_jiggle.c
@@ -0,0 +1,46 @@
1/* Copyright 2021 Joshua T.
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "mouse_jiggle.h"
18
19bool is_mouse_jiggle_active = false;
20
21void matrix_scan_mouse_jiggle(void) {
22 if (is_mouse_jiggle_active) {
23 tap_code(KC_MS_UP);
24 tap_code(KC_MS_DOWN);
25 }
26}
27
28bool process_record_mouse_jiggle(uint16_t keycode, const keyrecord_t *record) {
29 if (!record->event.pressed) {
30 return true;
31 }
32
33 if (is_mouse_jiggle_active) {
34 // If active, quit whenever another key is pressed
35 is_mouse_jiggle_active = false;
36 return true;
37 }
38
39 if (keycode != MS_JIGL) {
40 return true;
41 }
42
43 is_mouse_jiggle_active = true;
44 SEND_STRING("Mouse jiggler enabled");
45 return false;
46}
diff --git a/users/replicaJunction/features/mouse_jiggle.h b/users/replicaJunction/features/mouse_jiggle.h
new file mode 100644
index 000000000..ba2c6e757
--- /dev/null
+++ b/users/replicaJunction/features/mouse_jiggle.h
@@ -0,0 +1,23 @@
1/* Copyright 2021 Joshua T.
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18#include QMK_KEYBOARD_H
19#include "rj_keycodes.h"
20
21void matrix_scan_mouse_jiggle(void);
22
23bool process_record_mouse_jiggle(uint16_t keycode, const keyrecord_t *record);
diff --git a/users/replicaJunction/features/num_word.c b/users/replicaJunction/features/num_word.c
new file mode 100644
index 000000000..4cca5c19a
--- /dev/null
+++ b/users/replicaJunction/features/num_word.c
@@ -0,0 +1,129 @@
1/* Copyright 2021 Joshua T.
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "num_word.h"
18
19static uint16_t num_word_timer = 0;
20static bool is_num_word_on = false;
21
22bool is_num_word_enabled(void) {
23 return is_num_word_on;
24}
25
26void enable_num_word(void) {
27 if (is_num_word_on) return;
28 is_num_word_on = true;
29 layer_on(L_NUMBERS);
30}
31
32void disable_num_word(void) {
33 if (!is_num_word_on) return;
34 is_num_word_on = false;
35 layer_off(L_NUMBERS);
36}
37
38void toggle_num_word(void) {
39 if (is_num_word_on) {
40 disable_num_word();
41 }
42 else {
43 enable_num_word();
44 }
45}
46
47bool should_terminate_num_word(uint16_t keycode, const keyrecord_t *record) {
48 switch (keycode) {
49 // Keycodes which should not disable num word mode.
50 // We could probably be more brief with these definitions by using
51 // a couple more ranges, but I believe "explicit is better than
52 // implicit"
53 case KC_1 ... KC_0:
54 case KC_EQL:
55 case KC_SCLN:
56 case KC_MINS:
57 case KC_DOT:
58
59 // Numpad keycodes
60 case KC_P1 ... KC_P0:
61 case KC_PSLS ... KC_PPLS:
62 case KC_PDOT:
63
64 // Misc
65 case KC_UNDS:
66 case KC_BSPC:
67 return false;
68
69 default:
70 if (record->event.pressed) {
71 return true;
72 }
73 return false;
74 }
75
76 // Should be unreachable
77 return false;
78}
79
80
81bool process_record_num_word(uint16_t keycode, const keyrecord_t *record) {
82 // Handle the custom keycodes that go with this feature
83 if (keycode == NUMWORD) {
84 if (record->event.pressed) {
85 enable_num_word();
86 num_word_timer = timer_read();
87 return false;
88 }
89 else {
90 if (timer_elapsed(num_word_timer) > TAPPING_TERM) {
91 // If the user held the key longer than TAPPING_TERM,
92 // consider it a hold, and disable the behavior on
93 // key release.
94 disable_num_word();
95 return false;
96 }
97 }
98 }
99
100 // Other than the custom keycodes, nothing else in this feature will
101 // activate if the behavior is not on, so allow QMK to handle the
102 // event as usual
103 if (!is_num_word_on) return true;
104
105 // Nothing else acts on key release, either
106 if (!record->event.pressed) {
107 return true;
108 }
109
110 // Get the base keycode of a mod or layer tap key
111 switch (keycode) {
112 case QK_MOD_TAP ... QK_MOD_TAP_MAX:
113 case QK_LAYER_TAP ... QK_LAYER_TAP_MAX:
114 case QK_TAP_DANCE ... QK_TAP_DANCE_MAX:
115 // Earlier return if this has not been considered tapped yet
116 if (record->tap.count == 0)
117 return true;
118 keycode = keycode & 0xFF;
119 break;
120 default:
121 break;
122 }
123
124 if (should_terminate_num_word(keycode, record)) {
125 disable_num_word();
126 }
127
128 return true;
129}
diff --git a/users/replicaJunction/features/num_word.h b/users/replicaJunction/features/num_word.h
new file mode 100644
index 000000000..194c4e2e0
--- /dev/null
+++ b/users/replicaJunction/features/num_word.h
@@ -0,0 +1,27 @@
1/* Copyright 2021 Joshua T.
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18#include QMK_KEYBOARD_H
19#include "rj_keycodes.h"
20#include "rj_layers.h"
21
22bool is_num_word_enabled(void);
23void enable_num_word(void);
24void disable_num_word(void);
25void toggle_num_word(void);
26
27bool process_record_num_word(uint16_t keycode, const keyrecord_t *record);
diff --git a/users/replicaJunction/features/secrets.c b/users/replicaJunction/features/secrets.c
new file mode 100644
index 000000000..3e1ea283d
--- /dev/null
+++ b/users/replicaJunction/features/secrets.c
@@ -0,0 +1,51 @@
1/* Copyright 2021 Joshua T.
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17// Before you can compile with this feature, you'll need to manually
18// create a file in this directory called "secret_definitions.h"
19// containing the data to be added.
20//
21// Example implementation:
22//
23// #pragma once
24// static const char * const secrets[] = {
25// "secret1",
26// "secret2",
27// "secret3",
28// "secret4"
29// }
30
31#include QMK_KEYBOARD_H
32#include "replicaJunction.h"
33#include "secrets.h"
34#include "secret_definitions.h"
35
36#ifndef MACRO_TIMER
37# define MACRO_TIMER 5
38#endif
39
40bool process_record_secrets(uint16_t keycode, const keyrecord_t *record) {
41 switch (keycode) {
42 case K_SECR1 ... K_SECR4: // Secrets! Externally defined strings, not stored in repo
43 if (!record->event.pressed) {
44 clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
45 send_string_with_delay(secrets[keycode - K_SECR1], MACRO_TIMER);
46 }
47 return false;
48 }
49
50 return true;
51}
diff --git a/users/replicaJunction/features/secrets.h b/users/replicaJunction/features/secrets.h
new file mode 100644
index 000000000..ef4396227
--- /dev/null
+++ b/users/replicaJunction/features/secrets.h
@@ -0,0 +1,30 @@
1/* Copyright 2021 Joshua T.
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18#include QMK_KEYBOARD_H
19
20// NOTE: In some implementations of the "secrets" functionality, the
21// secrets.h file is the file that actually contains secret text.
22//
23// This is not the case in my implementation. That file is called
24// "secret_definitions.h", and it's in a local .gitignore file so it
25// does not get committed.
26//
27// The inclusion of this file is not an error, and there is no sensitive
28// text here.
29
30bool process_record_secrets(uint16_t keycode, const keyrecord_t *record);
diff --git a/users/replicaJunction/features/super_alt_tab.c b/users/replicaJunction/features/super_alt_tab.c
new file mode 100644
index 000000000..9759898c8
--- /dev/null
+++ b/users/replicaJunction/features/super_alt_tab.c
@@ -0,0 +1,52 @@
1/* Copyright 2021 Joshua T.
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "super_alt_tab.h"
18
19// https://docs.qmk.fm/#/feature_macros?id=super-alt%E2%86%AFtab
20
21bool is_alt_tab_active = false;
22uint16_t alt_tab_timer = 0;
23
24void matrix_scan_super_alt_tab(void) {
25 if (is_alt_tab_active) {
26 if (timer_elapsed(alt_tab_timer) > USER_SUPER_ALT_TAB_TIMEOUT) {
27 unregister_code(KC_LALT);
28 is_alt_tab_active = false;
29 }
30 }
31}
32
33
34bool process_record_super_alt_tab(uint16_t keycode, const keyrecord_t *record) {
35 if (keycode != SALTTAB) {
36 return true;
37 }
38
39 if (record->event.pressed) {
40 if (!is_alt_tab_active) {
41 is_alt_tab_active = true;
42 register_code(KC_LALT);
43 }
44 alt_tab_timer = timer_read();
45 register_code(KC_TAB);
46 }
47 else {
48 unregister_code(KC_TAB);
49 }
50
51 return false;
52}
diff --git a/users/replicaJunction/features/super_alt_tab.h b/users/replicaJunction/features/super_alt_tab.h
new file mode 100644
index 000000000..8bdf2bc22
--- /dev/null
+++ b/users/replicaJunction/features/super_alt_tab.h
@@ -0,0 +1,27 @@
1/* Copyright 2021 Joshua T.
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18#include QMK_KEYBOARD_H
19#include "rj_keycodes.h"
20
21#ifndef USER_SUPER_ALT_TAB_TIMEOUT
22# define USER_SUPER_ALT_TAB_TIMEOUT 500
23#endif
24
25void matrix_scan_super_alt_tab(void);
26
27bool process_record_super_alt_tab(uint16_t keycode, const keyrecord_t *record);
diff --git a/users/replicaJunction/keycode_aliases.h b/users/replicaJunction/keycode_aliases.h
new file mode 100644
index 000000000..b1006a863
--- /dev/null
+++ b/users/replicaJunction/keycode_aliases.h
@@ -0,0 +1,85 @@
1/* Copyright 2021 Joshua T.
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18
19#include QMK_KEYBOARD_H
20
21// Transparent, but indicates that this key must be blocked (for example, a layer shift key)
22#define ooooooo KC_TRNS
23
24
25#define SFT_TAB LSFT(KC_TAB)
26#define WIN_TAB LGUI(KC_TAB)
27#define WIN_L LGUI(KC_L)
28#define WIN_V LGUI(KC_V)
29#define ALT_F4 LALT(KC_F4)
30#define CTL_DEL LCTL_T(KC_DEL)
31#define CTL_ESC CTL_T(KC_ESC)
32#define ALT_ENT ALT_T(KC_ENT)
33#define ALT_TAB ALT_T(KC_TAB)
34
35#define OSM_LSF OSM(MOD_LSFT)
36#define OSM_RSF OSM(MOD_RSFT)
37
38// OS shortcuts (Windows)
39#define OS_COPY LCTL(KC_C)
40#define OS_PAST LCTL(KC_V)
41#define OS_CUT LCTL(KC_X)
42#define OS_UNDO LCTL(KC_Z)
43#define OS_SALL LCTL(KC_A)
44#define OS_FIND LCTL(KC_F)
45
46
47// Home row modifiers
48#define GUI_A LGUI_T(KC_A)
49#define ALT_R LALT_T(KC_R)
50#define SFT_S LSFT_T(KC_S)
51#define CRT_T LCTL_T(KC_T) // we can't call this CTL_T because that name is taken!
52
53#define CRT_N RCTL_T(KC_N)
54#define SFT_E RSFT_T(KC_E)
55#define ALT_I RALT_T(KC_I)
56#define GUI_O RGUI_T(KC_O)
57
58
59// Mouse keys
60#define M_UP KC_MS_UP
61#define M_DOWN KC_MS_DOWN
62#define M_LEFT KC_MS_LEFT
63#define M_RIGHT KC_MS_RIGHT
64#define M_LCLIK KC_MS_BTN1
65#define M_RCLIK KC_MS_BTN2
66#define M_MCLIK KC_MS_BTN3
67#define M_WHLUP KC_WH_U
68#define M_WHLDN KC_WH_D
69
70
71// Windows 10 shortcuts: change desktop to the left/right
72#define DESKLFT LCTL(LGUI(KC_LEFT))
73#define DESKRGT LCTL(LGUI(KC_RGHT))
74
75
76// Application-specific shortcuts
77
78// Search: defined in Everything Search Engine as the keypress to show/hide the window
79#define SEARCH HYPR(KC_S)
80
81// Microsoft PowerToys hotkeys
82// https://github.com/microsoft/PowerToys
83#define PTYRUN LALT(KC_SPC) // PowerToys Run
84#define PTYZONE LGUI(KC_GRV) // PowerToys FancyZones
85#define PTYCOLR LGUI(LSFT(KC_C)) // PowerToys ColorPicker
diff --git a/users/replicaJunction/matrix_scan.c b/users/replicaJunction/matrix_scan.c
new file mode 100644
index 000000000..969799550
--- /dev/null
+++ b/users/replicaJunction/matrix_scan.c
@@ -0,0 +1,35 @@
1/* Copyright 2021 Joshua T.
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include QMK_KEYBOARD_H
18#include "replicaJunction.h"
19
20__attribute__ ((weak))
21void matrix_scan_user_kb(void) { }
22
23// Runs on every matrix scan. Be careful what goes here - you can really impact the
24// responsiveness of your keyboard if you add too much in this function.
25void matrix_scan_user(void) {
26#ifdef USER_MOUSE_JIGGLE_ENABLE
27 matrix_scan_mouse_jiggle();
28#endif
29
30#ifdef USER_SUPER_ALT_TAB_ENABLE
31 matrix_scan_super_alt_tab();
32#endif
33
34 matrix_scan_user_kb();
35}
diff --git a/users/replicaJunction/process_records.c b/users/replicaJunction/process_records.c
new file mode 100644
index 000000000..abce21526
--- /dev/null
+++ b/users/replicaJunction/process_records.c
@@ -0,0 +1,149 @@
1/* Copyright 2021 Joshua T.
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include QMK_KEYBOARD_H
18#include "process_records.h"
19
20uint8_t mod_state;
21
22
23__attribute__ ((weak))
24bool process_record_user_kb(uint16_t keycode, keyrecord_t *record) {
25 return true;
26}
27
28// Runs for each key down or up event.
29bool process_record_user(uint16_t keycode, keyrecord_t *record) {
30 // Returning true here will cause QMK to continue handling the key normally.
31 // Returning false indicates that we've handled everything the keycode should do, and QMK
32 // should not continue handling the keypress.
33 //
34 // NOTE: There is also a process_record_kb function that can be defined in the keyboard-
35 // specific code. This allows the keyboard to have its own process_record function.
36 // This is supposed to be "higher" than the user function, meaning the kb function
37 // is shared for all keymaps for the keyboard.
38 //
39 // For this reason, I add my own function, called process_record_user_kb, and at the end
40 // of this function, I defer to that one if it exists.
41 // return process_record_user(keycode, record);
42
43
44 // Custom keycode / function handling, based on the core function
45 // process_record_quantum
46 // https://github.com/qmk/qmk_firmware/blob/master/quantum/quantum.c
47
48 if (!(
49#ifdef USER_CAPS_WORD_ENABLE
50 process_record_caps_word(keycode, record) &&
51#endif
52#ifdef USER_MOUSE_JIGGLE_ENABLE
53 process_record_mouse_jiggle(keycode, record) &&
54#endif
55#ifdef USER_NUM_WORD_ENABLE
56 process_record_num_word(keycode, record) &&
57#endif
58#ifdef USER_SECRETS_ENABLE
59 process_record_secrets(keycode, record) &&
60#endif
61#ifdef USER_SUPER_ALT_TAB_ENABLE
62 process_record_super_alt_tab(keycode, record) &&
63#endif
64 true)) {
65 return false;
66 }
67
68
69 // Miscellaneous keycode handling
70 mod_state = get_mods();
71
72 switch(keycode)
73 {
74 case QK_MAKE: {
75 if (record->event.pressed)
76 SEND_STRING("qmk compile --keyboard " QMK_KEYBOARD " --keymap " QMK_KEYMAP);
77 return false;
78 }
79 case QK_FLSH: {
80 if (record->event.pressed) {
81 SEND_STRING("qmk flash --keyboard " QMK_KEYBOARD " --keymap " QMK_KEYMAP);
82 }
83 return false;
84 }
85 case QK_VERS: {
86 if (record->event.pressed) {
87 SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE);
88 }
89 return false;
90 }
91 case PRG_EQ: {
92 if (record->event.pressed) {
93 SEND_STRING("==");
94 }
95 return false;
96 }
97 case PRG_NE: {
98 if (record->event.pressed) {
99 SEND_STRING("!=");
100 }
101 return false;
102 }
103 case PRG_GEQ: {
104 if (record->event.pressed) {
105 SEND_STRING(">=");
106 }
107 return false;
108 }
109 case PRG_LEQ: {
110 if (record->event.pressed) {
111 SEND_STRING("<=");
112 }
113 return false;
114 }
115 case PRG_ARR: {
116 if (record->event.pressed) {
117 SEND_STRING("=>");
118 }
119 return false;
120 }
121
122 case PS_ITEM: {
123 if (record->event.pressed) {
124 SEND_STRING("$_");
125 }
126 return false;
127 }
128 case FS_PIPE: {
129 if (record->event.pressed) {
130 SEND_STRING("|>");
131 }
132 return false;
133 }
134 case FS_ARR: {
135 if (record->event.pressed) {
136 SEND_STRING("->");
137 }
138 return false;
139 }
140 case SHEBANG: {
141 if (record->event.pressed) {
142 SEND_STRING("#!");
143 }
144 return false;
145 }
146 }
147
148 return process_record_user_kb(keycode, record);
149}
diff --git a/users/replicaJunction/process_records.h b/users/replicaJunction/process_records.h
new file mode 100644
index 000000000..224bc6f4f
--- /dev/null
+++ b/users/replicaJunction/process_records.h
@@ -0,0 +1,21 @@
1/* Copyright 2021 Joshua T.
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18#include QMK_KEYBOARD_H
19#include "replicaJunction.h"
20
21bool process_record_user_kb(uint16_t keycode, keyrecord_t *record);
diff --git a/users/replicaJunction/readme.md b/users/replicaJunction/readme.md
index 2a9cad272..9d728f902 100644
--- a/users/replicaJunction/readme.md
+++ b/users/replicaJunction/readme.md
@@ -1,14 +1,93 @@
1Copyright 2018 @<replicaJunction> 1replicaJunction QMK Userspace
2=============================
2 3
3This program is free software: you can redistribute it and/or modify 4# Overview
4it under the terms of the GNU General Public License as published by 5I alternate between a few keyboards, one of which is the 44-key Keyboardio Atreus. Small keyboards require a liberal use of layers. Even though larger keyboards don't rely on layers as heavily, my muscle memory adapted to my Atreus layout, so I've ended up building several of those features in my keymaps for larger boards as well.
5the Free Software Foundation, either version 2 of the License, or
6(at your option) any later version.
7 6
8This program is distributed in the hope that it will be useful, 7The result, I believe, is a good compromise between ergonomics and ease of use.
9but WITHOUT ANY WARRANTY; without even the implied warranty of
10MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11GNU General Public License for more details.
12 8
13You should have received a copy of the GNU General Public License 9The code in this userspace is designed to be very modular. I use a few different keyboards, and I'm constantly tweaking one or another, so I want the ability to add and remove features from the firmware at compile-time. While my endgame goal is to get all the layouts to be compatible, in practice, it's been years and I'm still not to that point...
14along with this program. If not, see <http://www.gnu.org/licenses/>. \ No newline at end of file 10
11Modular code also means that it should be easy to identify and adapt specific pieces to your own firmware.
12
13## Keyboards and Keymaps
14
15The following keyboards use the files in this userspace:
16
17* [Atreus](../../keyboards/atreus/keymaps/replicaJunction/readme.md) (42-key)
18* [Ergodox](../../layouts/community/ergodox/replicaJunction/readme.md)
19* [Keyboardio Atreus](../../keyboards/keyboardio/atreus/keymaps/replicaJunction/readme.md) (44-key)
20* [XD75](../../keyboards/xd75/keymaps/replicaJunction/readme.md)
21
22# Features
23
24* **Secrets**, as [explained by Drashna](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/readme_secrets.md)
25* **CAPSWORD** and **NUMWORD**
26* Mouse jiggler
27* Super alt-tab
28
29## Secrets
30My implementation of the "secrets" concept is very similar to Drashna's, but I've chosen to allow most of the supporting code to be committed to the repo. The only thing missing is a file called `secret_definitions.h`, which contains the actual text contained in those macros.
31
32To use my implementation, create a file of that name in the same directory. Make sure you've got a `.gitignore` file in place, and add these contents to the definitions file:
33
34```c
35#pragma once
36static const char * const secrets[] = {
37 "secret1",
38 "secret2",
39 "secret3",
40 "secret4"
41}
42```
43
44Change the quoted text to the text you'd like and you're golden. If you need more (or fewer) items, you'll probably need to adjust the code in `secrets.c` as well, since it looks for up to four items in a switch case.
45
46## CAPSWORD and NUMWORD
47The concept here is simple: more often than you'd think, you need to type a single word in ALL CAPS. An easy example for me, as a programmer, is a constant value; in most programming languages, constants are typed in all caps by convention.
48
49You typically have a few choices, but each one comes with a drawback. Here are the options I'm aware of:
50
51* Use proper typing technique and alternate which hand holds Shift for each keypress
52 * This can often end up requiring you to switch / re-press Shift again and again, making this a tedious process
53* Hold a single Shift key down
54 * This can lead to uncomfortable finger gymnastics
55* Hit the Caps Lock key, then hit it again when you're done
56 * Requires you to remember to hit it again, meaning a higher cognitive load
57 * In some layouts for smaller keyboards, Caps Lock is not easily accessible (sometimes not mapped at all)
58
59The solution to this problem is CAPSWORD. When enabled, it activates Caps Lock and begins running an additional callback on each keypress. If the keypress is an alphanumeric key or one of a specific few symbols (such as the underscore), nothing happens. Otherwise, before processing the keypress, Caps Lock is disabled again.
60
61NUMWORD is a similar concept, but has a slightly more elaborate implementation. There's a bit of extra logic in the NUMWORD code that allows the keycode to act as a tap/hold key as well. Tapping enables NUMWORD while number keys are in use, while holding the key enables a number layer for the duration of the key hold and disables it again afterwards.
62
63**Note:** The implementation of NUMWORD requires that the keyboard's layer definitions be accessible in a header file. In my case, since I use a fairly standard set of layers, I've declared it in my userspace.
64
65## Mouse Jiggler
66This adds a keycode that will move the mouse cursor on each matrix scan. Used to prevent the screen from locking if you're temporarily doing something else (working on a different machine, reading / writing, etc.).
67
68When you press the keycode, the keyboard will write the text "Mouse jiggler enabled" to signify that the behavior is active. I suggest opening a Notepad window before pressing the key.
69
70Pressing any key will automatically disable the feature again. This is because it causes a huge hit to the reliability and performance of the keyboard while it's active (adding stuff to every matrix scan will do that). I kept forgetting to turn it off before trying to use the keyboard again, so I decided to make it automatically disable itself.
71
72Enable this by setting `USER_MOUSE_JIGGLE_ENABLE = yes` in your `rules.mk` file. The feature also depends on the Mouse Keys feature, so ensure you don't disable `MOUSEKEY_ENABLE`.
73
74## Super Alt-Tab
75Taken [straight out of the QMK documentation](https://docs.qmk.fm/#/feature_macros?id=super-alt%E2%86%AFtab), this is an easy way to shift between a couple different windows. I use it with a very low interval when I'm alternating back and forth between two known windows with no real need for the visual feedback and thought. If you want to be able to browse the open windows before the function releases Alt, I'd suggest raising `USER_SUPER_ALT_TAB_TIMEOUT` to a higher value.
76
77# Credits
78I'm absolutely sure I've missed a few sources here. If you see something in my code that you think is yours and isn't credited here, I sincerely apologize.
79
80[bpruitt-goddard](https://github.com/qmk/qmk_firmware/blob/master/keyboards/ergodox_ez/keymaps/bpruitt-goddard/readme.md)
81* Dynamic macro tap-dance (no longer used, but I did use this for a while)
82
83[Drashna](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/readme.md)
84* Secrets concept and basic implementation
85* "Wrappers" concept (no longer used, but I did use this for a while)
86
87[Treeman](https://github.com/treeman/qmk_firmware/blob/master/keyboards/kyria/keymaps/treeman)
88* CAPSWORD and NUMBERWORD concept
89 * I re-implented some of the code based on my own prefences, but I did use some implementation code from here
90 * [Treeman's blog post](https://www.jonashietala.se/blog/2021/06/03/the-t-34-keyboard-layout/) provides more context on these features, and is a great read
91
92[QMK issue #452](https://github.com/qmk/qmk_firmware/issues/452)
93* Helped clarify a good organizational structure for the individual features in this userspace
diff --git a/users/replicaJunction/replicaJunction.c b/users/replicaJunction/replicaJunction.c
index f0bc59d25..55d8b7716 100644
--- a/users/replicaJunction/replicaJunction.c
+++ b/users/replicaJunction/replicaJunction.c
@@ -1,149 +1,25 @@
1/* Copyright 2021 Joshua T.
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include QMK_KEYBOARD_H
1#include "replicaJunction.h" 18#include "replicaJunction.h"
2#include "version.h"
3
4#ifdef TAP_DANCE_ENABLE
5void dance_layer(qk_tap_dance_state_t *state, void *user_data)
6{
7 uint8_t layer = biton32(layer_state);
8
9 if (state->count >= 5)
10 {
11 // 5 or more taps resets the keyboard
12 reset_keyboard();
13 }
14 #ifdef L_QWERTY
15 else if (state->count == 3)
16 {
17 // Triple tap changes to QWERTY layer
18 if (layer == L_QWERTY)
19 {
20 layer_off(L_QWERTY);
21 }
22 else
23 {
24 layer_on(L_QWERTY);
25 }
26 }
27 #endif
28 #ifdef L_NUM
29 else if (state->count == 2)
30 {
31 // Double tap toggles Number layer
32 if (layer == L_NUM)
33 {
34 layer_off(L_NUM);
35 }
36 else
37 {
38 layer_on(L_NUM);
39 }
40 }
41 #endif
42 else
43 {
44 // Single tap sends Escape, and also turns off layers
45 // That's mostly in case I get stuck and forget where I am
46 #ifdef L_NUM
47 layer_off(L_NUM);
48 #endif
49 #ifdef L_EXTEND
50 layer_off(L_EXTEND);
51 #endif
52 #ifdef L_SYMBOL
53 layer_off(L_SYMBOL);
54 #endif
55 #ifdef L_QWERTY
56 layer_off(L_QWERTY);
57 #endif
58 register_code(KC_ESC);
59 unregister_code(KC_ESC);
60 }
61};
62
63// Tap Dance Definitions
64// Note - this needs to come AFTER the function is declared
65qk_tap_dance_action_t tap_dance_actions[] = {
66 [TD_LAYER_TOGGLE] = ACTION_TAP_DANCE_FN(dance_layer)
67};
68
69#endif // TAP_DANCE_ENABLE
70
71// These functions can be overridden in individual keymap files.
72// This allows a user function to be shared for all my keyboards, while each
73// keyboard can also have a keyboard-specific section.
74
75// Note that keymaps don't need to override these if there's nothing to
76// override them with.
77__attribute__ ((weak))
78void matrix_init_keymap(void) {}
79 19
80__attribute__ ((weak)) 20__attribute__ ((weak))
81void matrix_scan_keymap(void) {} 21void keyboard_post_init_user_kb(void) { }
82 22
83__attribute__ ((weak)) 23void keyboard_post_init_user(void) {
84bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { 24 keyboard_post_init_user_kb();
85 return true;
86};
87
88// Runs just one time when the keyboard initializes.
89void matrix_init_user(void) {
90 #ifdef UNICODEMAP_ENABLE
91 // Set Unicode input to use WinCompose
92 // https://github.com/samhocevar/wincompose
93 set_unicode_input_mode(UC_WINC);
94 #endif // UNICODEMAP_ENABLE
95
96 matrix_init_keymap();
97};
98
99// Runs constantly in the background, in a loop.
100void matrix_scan_user(void) {
101 matrix_scan_keymap();
102} 25}
103
104bool process_record_user(uint16_t keycode, keyrecord_t *record) {
105 if (record->event.pressed)
106 return true;
107
108 switch(keycode)
109 {
110 case RJ_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader
111 SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP
112 #if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU))
113 ":dfu"
114 #elif defined(BOOTLOADER_HALFKAY)
115 ":teensy"
116 #elif defined(BOOTLOADER_CATERINA)
117 ":avrdude"
118 #endif // bootloader options
119 //SS_TAP(X_ENTER)
120 );
121 return false;
122 case RJ_QMKV:
123 SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
124 return false;
125 case RJ_EQ:
126 SEND_STRING("==");
127 return false;
128 case RJ_NEQ:
129 SEND_STRING("!=");
130 return false;
131 case RJ_GEQ:
132 SEND_STRING(">=");
133 return false;
134 case RJ_LEQ:
135 SEND_STRING("<=");
136 return false;
137 case RJ_GEQR:
138 SEND_STRING("=>");
139 return false;
140 case RJ_DUND:
141 SEND_STRING("$_");
142 return false;
143 case RJ_SELS:
144 SEND_STRING("select *");
145 return false;
146 }
147
148 return process_record_keymap(keycode, record);
149};
diff --git a/users/replicaJunction/replicaJunction.h b/users/replicaJunction/replicaJunction.h
index 9b5772543..f3b7bcea0 100644
--- a/users/replicaJunction/replicaJunction.h
+++ b/users/replicaJunction/replicaJunction.h
@@ -1,114 +1,42 @@
1#pragma once 1/* Copyright 2021 Joshua T.
2 2 *
3#include "quantum.h" 3 * This program is free software: you can redistribute it and/or modify
4 4 * it under the terms of the GNU General Public License as published by
5/////////////////////////////////////////////////////////////////////////////// 5 * the Free Software Foundation, either version 2 of the License, or
6// Keymap definitions 6 * (at your option) any later version.
7/////////////////////////////////////////////////////////////////////////////// 7 *
8 8 * This program is distributed in the hope that it will be useful,
9// Layer definitions 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10// #define L_COLEMAK 0 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// #define L_QWERTY 1 11 * GNU General Public License for more details.
12// #define L_NUM 2 12 *
13// #define L_EXTEND 3 13 * You should have received a copy of the GNU General Public License
14// #define L_FUNC 4 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15// #define L_GAMING 5 15 */
16// #define L_SYMBOL 6
17// #define L_LL_R 7
18// #define L_LL_S 8
19// #define L_LL_E 9
20// #define L_LL_I 10
21
22// Keyboard aliases
23#define ooooooo KC_TRNS
24
25#define MO_FUNC MO(L_FUNC)
26#define TT_NUM TT(L_NUM)
27#define TG_GAME TG(L_GAMING)
28#define OSL_SYM OSL(L_SYMBOL)
29
30#define OSM_LSF OSM(MOD_LSFT)
31#define OSM_RSF OSM(MOD_RSFT)
32
33#define KX_CTSF LCTL(KC_LSFT)
34#define KX_STAB LSFT(KC_TAB)
35#define KX_CGR LCTL(KC_GRV)
36#define KX_PAST LCTL(LGUI(LALT(KC_V)))
37#define KX_SRCH LCTL(LGUI(LALT(KC_S)))
38 16
39#define KX_BKNM LT(L_NUM, KC_BSPC) 17#pragma once
40#define KX_DCTL CTL_T(KC_DEL) 18#include QMK_KEYBOARD_H
41#define KX_NALT ALT_T(KC_ENT) 19#include "rj_keycodes.h"
42#define KX_ECTL CTL_T(KC_ESC) 20#include "rj_layers.h"
43#define KX_SPAC LT(L_EXTEND, KC_SPC) 21#include "keycode_aliases.h"
44 22#include "version.h"
45#define KX_Z_MT CTL_T(KC_Z) 23
46#define KX_X_MT GUI_T(KC_X) 24#ifdef USER_CAPS_WORD_ENABLE
47#define KX_C_MT MT(MOD_LCTL | MOD_LALT, KC_C) 25# include "features/caps_word.h"
48#define KX_D_MT ALT_T(KC_D)
49
50#define KX_SLMT CTL_T(KC_SLSH)
51#define KX_DOMT GUI_T(KC_DOT)
52#define KX_COMT MT(MOD_LCTL | MOD_LALT, KC_COMM)
53#define KX_H_MT ALT_T(KC_H)
54
55#ifdef L_LL_R
56 #define KC_R_LT LT(L_LL_R, KC_R)
57#else
58 #define KC_R_LT KC_R
59#endif 26#endif
60 27
61#ifdef L_LL_S 28#ifdef USER_MOUSE_JIGGLE_ENABLE
62 #define KC_S_LT LT(L_LL_S, KC_S) 29# include "features/mouse_jiggle.h"
63#else
64 #define KC_S_LT KC_S
65#endif 30#endif
66 31
67#ifdef L_LL_E 32#ifdef USER_NUM_WORD_ENABLE
68 #define KC_E_LT LT(L_LL_E, KC_E) 33# include "features/num_word.h"
69#else
70 #define KC_E_LT KC_E
71#endif 34#endif
72 35
73#ifdef L_LL_I 36#ifdef USER_SECRETS_ENABLE
74 #define KC_I_LT LT(L_LL_I, KC_I) 37# include "features/secrets.h"
75#else
76 #define KC_I_LT KC_I
77#endif 38#endif
78 39
79// "Macro" functions 40#ifdef USER_SUPER_ALT_TAB_ENABLE
80enum userspace_custom_keycodes { 41# include "features/super_alt_tab.h"
81 RJ_MAKE = SAFE_RANGE, // QMK make command 42#endif
82 RJ_QMKV, // QMK version
83 RJ_EQ, // ==
84 RJ_NEQ, // !=
85 RJ_GEQ, // >=
86 RJ_LEQ, // <=
87 RJ_GEQR, // => ("greater than or equal - right")
88 RJ_DUND, // $_
89 RJ_SELS, // select * (used for PowerShell)
90 RJ_MUTE, // Discord mute (GUI+Shift+M)
91 RJ_DEAF, // Discord deafen (GUI+Shift+D)
92 RJ_DOVR // Toggle Discord overlay (GUI+Shift+O)
93};
94
95// Mouse keys
96#define M_UP KC_MS_UP
97#define M_DOWN KC_MS_DOWN
98#define M_LEFT KC_MS_LEFT
99#define M_RIGHT KC_MS_RIGHT
100#define M_LCLIK KC_MS_BTN1
101#define M_RCLIK KC_MS_BTN2
102#define M_MCLIK KC_MS_BTN3
103#define M_WHLUP KC_WH_U
104#define M_WHLDN KC_WH_D
105
106// Used in macro definitions
107#define TAP(code) register_code (code); unregister_code (code);
108
109// Tap Dance
110#ifdef TAP_DANCE_ENABLE
111#define TD_LAYER_TOGGLE 0
112extern void dance_layer(qk_tap_dance_state_t *state, void *user_data);
113#define TD_LAYR TD(TD_LAYER_TOGGLE)
114#endif // TAP_DANCE_ENABLE
diff --git a/users/replicaJunction/rj_keycodes.h b/users/replicaJunction/rj_keycodes.h
new file mode 100644
index 000000000..fde2698df
--- /dev/null
+++ b/users/replicaJunction/rj_keycodes.h
@@ -0,0 +1,63 @@
1/* Copyright 2021 Joshua T.
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18#include QMK_KEYBOARD_H
19
20// Custom keycodes and macros
21enum userspace_custom_keycodes {
22 QK_MAKE = SAFE_RANGE, // QMK make command
23 QK_FLSH, // QMK flash command
24 QK_VERS, // QMK version
25
26 // Programming macros
27 PRG_EQ, // ==
28 PRG_NE, // !=
29 PRG_GEQ, // >=
30 PRG_LEQ, // <=
31 PRG_ARR, // =>
32 PS_ITEM, // $_ (PowerShell - $PSItem variable)
33 FS_PIPE, // |> (F# pipe operator)
34 FS_ARR, // -> (F# lambda / pattern matching)
35 SHEBANG, // #!
36
37 // USER_CAPS_WORD_ENABLE
38 CAPWORD,
39
40#ifdef USER_NUM_WORD_ENABLE
41 NUMWORD,
42#endif
43
44 // USER_ENABLE_CUSTOM_SHIFT_CODES
45 // Custom characters that send different symbols than usual when shifted
46 KCC_COM, // , or !
47 KCC_DOT, // . or @
48 KCC_QUO, // ' or ~
49
50 // USER_MOUSE_JIGGLE_ENABLE
51 MS_JIGL,
52
53 // USER_ENABLE_SUPER_ALT_TAB
54 SALTTAB,
55
56 // USER_ENABLE_SECRETS
57 K_SECR1,
58 K_SECR2,
59 K_SECR3,
60 K_SECR4,
61
62 DYNAMIC_MACRO_RANGE
63};
diff --git a/users/replicaJunction/rj_layers.h b/users/replicaJunction/rj_layers.h
new file mode 100644
index 000000000..f6296af05
--- /dev/null
+++ b/users/replicaJunction/rj_layers.h
@@ -0,0 +1,40 @@
1/* Copyright 2021 Joshua T.
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18
19enum rj_layers {
20 L_BASE,
21
22#ifdef USER_INCLUDE_QWERTY
23 L_QWERTY,
24#endif
25
26#ifdef USER_INCLUDE_GAMING_LAYER
27 L_GAMING,
28#endif
29
30 L_NUMBERS,
31 L_SYMBOLS,
32 L_NAVIGATION,
33 L_FN,
34
35#ifdef USER_INCLUDE_MACRO_LAYER
36 L_MACROS,
37#endif
38
39 _LAYER_SAFE_RANGE
40};
diff --git a/users/replicaJunction/rules.mk b/users/replicaJunction/rules.mk
index 30a330195..addaa04d9 100644
--- a/users/replicaJunction/rules.mk
+++ b/users/replicaJunction/rules.mk
@@ -1 +1,33 @@
1SRC += replicaJunction.c 1SRC += replicaJunction.c
2
3# Only load these source files if the features are enabled. Keyboards can
4# enable or disable these features in their own rules.mk files.
5
6ifeq ($(strip $(USER_CAPS_WORD_ENABLE)), yes)
7 SRC += features/caps_word.c
8 OPT_DEFS += -DUSER_CAPS_WORD_ENABLE
9endif
10
11ifeq ($(strip $(USER_MOUSE_JIGGLE_ENABLE)), yes)
12 SRC += features/mouse_jiggle.c
13 OPT_DEFS += -DUSER_MOUSE_JIGGLE_ENABLE
14endif
15
16ifeq ($(strip $(USER_NUM_WORD_ENABLE)), yes)
17 SRC += features/num_word.c
18 OPT_DEFS += -DUSER_NUM_WORD_ENABLE
19endif
20
21ifeq ($(strip $(USER_SECRETS_ENABLE)), yes)
22 SRC += features/secrets.c
23 OPT_DEFS += -DUSER_SECRETS_ENABLE
24endif
25
26ifeq ($(strip $(USER_SUPER_ALT_TAB_ENABLE)), yes)
27 SRC += features/super_alt_tab.c
28 OPT_DEFS += -DUSER_SUPER_ALT_TAB_ENABLE
29endif
30
31# Define these last so any other logic can set up some defines first
32SRC += matrix_scan.c \
33 process_records.c