aboutsummaryrefslogtreecommitdiff
path: root/users/bocaj
diff options
context:
space:
mode:
authorJacob Jerrell <jacob.jerrell@gmail.com>2019-01-02 11:23:42 -0600
committerDrashna Jaelre <drashna@live.com>2019-01-02 09:23:42 -0800
commita7b1b146d12cce1858db59c1d99ce84fb37fc59e (patch)
tree14f91e601dcc7ac41871824d698a6143344497fd /users/bocaj
parent7b5fa4b13e332bab476b65565d63708b306d000a (diff)
downloadqmk_firmware-a7b1b146d12cce1858db59c1d99ce84fb37fc59e.tar.gz
qmk_firmware-a7b1b146d12cce1858db59c1d99ce84fb37fc59e.zip
Keymap: Bocaj Layout and Userspace Refactor (#4753)
* Bocaj Layout Revamp * Pull in Upstream (#1) * Various tweaks for some Input:Club build processes * change KEYMAP to LAYOUT for all new keyboards made using this script * Add support for rev3 of the Atom47 (#2672) * Added support for rev3 of the Atom47 * Updated Atom47 readme's * Fix redefine error on rev2 and add maartenwut's keymap * Fix redefine error on LEdiodes keymap * Add Nyquist keymap (#2692) * nyquist * danielhklein nyquist setup * shift left controls * remove readme * cleanup before pr * ready for pr * Adds Phantom TKL support (#2696) * Add an info.json to phantom keyboard * Add layouts - KEYMAP_WINKEYLESS - KEYMAP_7BIT - KEYMAP_ISO - KEYMAP_ISO_WINKEYLESS * Add key_counts * Add 2 missing F-Row keys * Add TKC1800 info.json Created an info.json for the tkc1800. * Clueboard 60 info.json - adds - LAYOUT_60_ansi - LAYOUT_60_iso - KEYMAP_AEK - KEYMAP - LAYOUT_60_ansi_split_bs_rshift * Add the Speedo keyboard * Fix KC60 info.json file (#2707) * change KEYMAP to LAYOUT in all the KC60 files * Redo the info.json file * Small fixes to TKC1800 - adjust F-row to use 0.25 spacing - split left shift - add key_count * Fix some Configurator Warnings regarding LAYOUT vs KEYMAP (#2708) * change diverge 3 KC_KEYMAP to LAYOUT * Change KEYMAP to LAYOUT for handwired arrow pad * change M10A to LAYOUT for m10-a * Change KC_KEYMAP to LAYOUT_kc and KEYMAP to LAYOUT for mf68 * change KC_KEYMAP to LAYOUT for nano * Refactor to LAYOUT * refactor to LAYOUT-ansi and LAYOUT_iso for s65 * LAYOUT conversions for lfkkeyboards * missed a few renames * mini1800 for lfkeyobards support of LAYOUT * Improve state/chord handling and clean up namespace Some values that can never, ever, change were held in local variables, rather than in PROGMEM. Fixed. Change "pressed" to a signed int so the test for < 0 makes sense, and to avoid possible weird failure modes in the case where a key release comes in when pressed is already zero. (Shouldn't happen, sure, but computers are weird.) A lot of things in process_steno had external linkage for no particular reason. They've been marked static. Stuff still builds. Distinguish between currently-held keys and keys that have been held, and expose these values through a nicely-named API so other code could, say, check on the current set of steno chording in order to make displays. Also in passing fix up the "state" value having external linkage so it could clash with other people's variable declarations. The API also provides hooks for key processing and steno chord events, so you can monitor those events without having to run in matrix_scan_user and recheck the values directly. Also document these. There is no path through processing a key that doesn't end with a return false, so the nested return foo() are gone and we just return false. * Pull information from config.h and rules.mk (#2711) * Pull information from config.h and rules.mk * Readd the kbd75 maintainer * Remove obsolete info.json entries (#2712) * Clean up some long-standing errors when populating the API (#2715) * More Configurator Warning Fixes (#2716) * mf68_ble did not have the correct .c and .h files * Fix JC65 KEYMAP to LAYOUT * Change KEYMAP to LAYOUT for s60_x * Convert KEYMAP to LAYOUT for lets_split boards * Convert KEYMAP to LAYOUT * more fixes to keymap for iris * convert KEYMAP to LAYOUT for levinson keyboard * change losinggeneration's KEYMAP to LAYOUT * convert KEYMAP to LAYOUT * convert KEYMAP to LAYOUT for nyquist * convert KEYMAP to LAYOUT * convert KEYMAP to LAYOUT for viterbi * convert KEYMAP to LAYOUT * convert KEYMAP and its subsidiries to the LAYOUT standard * convert KEYMAP and its subsidiries to the new LAYOUT standard * Normacos keymap for let's split keyboard (#2691) * Cheers let's split keymap * fixed typo on norman layer of cheers keymap for let's split * fixed right handed mappings for home row * cheers keymap for let's split redefinition * updated Cheers keymap for let's split * cheers keymap for let's split updated with some terminal macros * renamed cheers let's split keymap to a more appropriate normacos * updated normacos keymap doc / removed non functional keys * reset let's split rules to default values * added more spotlight search macros * normalized keymap comments * Moved numpad on lower layer * hhkb jp personal keymap (#2698) * Add JJ40 Cockpit personal keymap (#2713) * Add JJ40 Cockpit keymap * Fix lower layer symbols * Add readme for "major" keyboards to eliminate more QMK Configurator errors (#2718) * add readme to ktype keyboard * add readme to m10a * add readme to mini1800 * add readme to parent directory * Revert "Pull in Upstream (#1)" This reverts commit eeba0cec17ccb636e4225eed88aeae72b99f5e45. * Updates to Bocaj Files - Gave up on Tap Dance for ' -> ' + Added another 'Secret' + Add ' -> ' to the Swap Hands key + Add Swap Hands to the ' -> ' key + Made Hand Swapping a momentary toggle - Removed Auto Shift + Added Layer Toggle to KC_QUOTE for the _TOOLS layer - Disabled Tap Dance * Merge remote-tracking branch 'upstream/master' * Updates to Bocaj Added Game Layers, Removed Unused Macros * Removed 'secrets.h' * Updates to Bocaj Remove 'secrets'. Remove 'sendstring_workman.h' and set related layer back to qwerty due to macro compatibility issues * Total revisioning of keymap and layout structure * Missed readme.md file * Bocaj - Permissive Hold setting enabled * Switching from ErgoDox EZ centric configuration to the layout/user approach * Bocaj - Create Userspace and Ergodox layout * Update settings.json * Pushing local updates * Reverting .vscode/settings.json * Adds pretty_osx and _win wrappers * Utilize Windows and Mac Wrappers * Update layouts/community/ergodox/bocaj/keymap.c * Updates to Bocaj keymap.c - Extended pretty_osx and pretty_win wrappers to allow modification of the bottom rows and thumb clusters. - Fixed already wrapped layouts to align with the change - Wrapped _NUMS and _CLICKY layers with the _osx wrapper because I main with a Mac * Updates to Bocaj Small documentation updates, added KC_MAKE from Drashna's layout, added KC_LOCK back to the diablo layer. * Add LShift to _Adjust layer * Minor changes to bocaj Put wrappers in userspace and added RESET keycode to the Adjust layer * Updates to Bocaj config & keymap; Fixed problem with process_leader.c - Made lots of changes to the bocaj layout and userspace - Pulled in latest upstream/master - Attempted to compile with latest and found an unneccessary `break` in process_leader.c * Bocaj - Updates to Layout and Userspace * Adjust LEADER_TIMEOUT to 350 * Put KC_GRAVE on _ADJUST layer * Eliminate _LOWER layer and associated definitions * Adjusted layer indicating LEDs to match changes * Fixed Diablo leader sequence * Added build info leader sequence * Got rid of obsoleted IGNORE_MOD_TAP_INTERRUPT/PERMISSIVE_HOLD/PREVENT_STUCK_MODIFIERS (may add STRICT_LAYER_RELEASE in the future) * Remove type_traits Not sure what in my VSCode config always brings this one in * refactor stage 1 * Bocaj Refactor Phase II * Made LED_2 brighter if both CTRL & GUI are being held * Enabled unicode because I got it to work in Mac OS * Finalized Build Info leader combination after testing in Mac OS * Not sure why KC_D3_1 was set to ASDF if !TAP_DANCE_ENABLE. So I changed that back * Experienced issues with `EXTRAFLAGS += -flto` using Docker in MacOS. Not sure what it does, but I don't seem to be missing anything * Wrote obligatory readme.md files and mentioned Drashna too many times... I don't think I can actually take credit for much of anything here. * Updates to Bocaj Made LED changes, added LM_DFLT which is similar to the grave macro, enabled retro tapping, working on a unicode idea -- currently fails to build. * Bocaj Refactor Phase 3 Part 2 - Continuation of implementing unicode switching based on default layer - Slight adjustments to _DIABLO and base wrapper because LM_DFLT macro didn't function as I'd hoped * Slight adjustment to KC_MAKE
Diffstat (limited to 'users/bocaj')
-rw-r--r--users/bocaj/bocaj.c200
-rw-r--r--users/bocaj/bocaj.h190
-rw-r--r--users/bocaj/config.h5
-rw-r--r--users/bocaj/process_records.c149
-rw-r--r--users/bocaj/process_records.h52
-rw-r--r--users/bocaj/readme.md110
-rw-r--r--users/bocaj/rules.mk30
-rw-r--r--users/bocaj/send_unicode.c106
-rw-r--r--users/bocaj/send_unicode.h71
-rw-r--r--users/bocaj/tap_dances.c1
-rw-r--r--users/bocaj/tap_dances.h12
-rw-r--r--users/bocaj/wrappers.h37
12 files changed, 731 insertions, 232 deletions
diff --git a/users/bocaj/bocaj.c b/users/bocaj/bocaj.c
index 6df6e3bbf..689dbe7b4 100644
--- a/users/bocaj/bocaj.c
+++ b/users/bocaj/bocaj.c
@@ -1,14 +1,30 @@
1/*
2Copyright 2018 Jacob Jerrell <jacob.jerrell@gmail.com> @JacobJerrell
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
1#include "bocaj.h" 18#include "bocaj.h"
2#include "eeprom.h"
3#include "version.h"
4#include "tap_dances.h"
5 19
6static uint16_t copy_paste_timer;
7userspace_config_t userspace_config; 20userspace_config_t userspace_config;
21#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE))
22 #define BOCAJ_UNICODE_MODE UC_OSX
23#else
24 // set to 2 for UC_WIN, set to 4 for UC_WINC
25 #define BOCAJ_UNICODE_MODE 2
26#endif
8 27
9/* *** *** *** *** *
10 * Helper Functions *
11 * *** *** *** *** */
12void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); }; 28void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); };
13 29
14// Add reconfigurable functions here, for keymap customization 30// Add reconfigurable functions here, for keymap customization
@@ -36,10 +52,7 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
36} 52}
37 53
38__attribute__ ((weak)) 54__attribute__ ((weak))
39bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { 55void matrix_scan_secrets(void) {}
40 return true;
41}
42
43 56
44__attribute__ ((weak)) 57__attribute__ ((weak))
45uint32_t layer_state_set_keymap (uint32_t state) { 58uint32_t layer_state_set_keymap (uint32_t state) {
@@ -57,7 +70,14 @@ void led_set_keymap(uint8_t usb_led) {}
57// Call user matrix init, set default RGB colors and then 70// Call user matrix init, set default RGB colors and then
58// call the keymap's init function 71// call the keymap's init function
59void matrix_init_user(void) { 72void matrix_init_user(void) {
60 userspace_config.raw = eeprom_read_byte(EECONFIG_USERSPACE); 73 userspace_config.raw = eeconfig_read_user();
74
75 #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE))
76 set_unicode_input_mode(BOCAJ_UNICODE_MODE);
77 get_unicode_input_mode();
78 #endif //UNICODE_ENABLE
79
80
61 matrix_init_keymap(); 81 matrix_init_keymap();
62} 82}
63 83
@@ -78,6 +98,18 @@ void suspend_wakeup_init_user(void)
78 #endif 98 #endif
79} 99}
80 100
101void eeconfig_init_user(void) {
102 userspace_config.raw = 0;
103 eeconfig_update_user(userspace_config.raw);
104 #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE))
105 set_unicode_input_mode(BOCAJ_UNICODE_MODE);
106 get_unicode_input_mode();
107 #else
108 eeprom_update_byte(EECONFIG_UNICODEMODE, BOCAJ_UNICODE_MODE);
109 #endif
110}
111
112LEADER_EXTERNS();
81// No global matrix scan code, so just run keymap's matrix 113// No global matrix scan code, so just run keymap's matrix
82// scan function 114// scan function
83void matrix_scan_user(void) { 115void matrix_scan_user(void) {
@@ -86,6 +118,68 @@ void matrix_scan_user(void) {
86 has_ran_yet = true; 118 has_ran_yet = true;
87 startup_user(); 119 startup_user();
88 } 120 }
121 LEADER_DICTIONARY() {
122 leading = false;
123 leader_end();
124
125 // Mac Save (Leader -> s)
126 SEQ_ONE_KEY(KC_S) {
127 SEND_STRING(SS_LGUI("s"));
128 }
129
130 // Mac copy line down (Leader -> d, d)
131 SEQ_TWO_KEYS(KC_D, KC_D) {
132 register_code(KC_LSHIFT);
133 register_code(KC_HOME);
134 unregister_code(KC_HOME);
135 unregister_code(KC_LSHIFT);
136 SEND_STRING(SS_LGUI("c"));
137 tap(KC_END);
138 tap(KC_ENTER);
139 SEND_STRING(SS_LGUI("v"));
140 }
141
142 // Mac copy line up (Leader -> u, u)
143 SEQ_TWO_KEYS(KC_U, KC_U) {
144 register_code(KC_LSHIFT);
145 register_code(KC_HOME);
146 unregister_code(KC_HOME);
147 unregister_code(KC_LSHIFT);
148 SEND_STRING(SS_LGUI("c"));
149 tap(KC_UP);
150 tap(KC_END);
151 tap(KC_ENTER);
152 SEND_STRING(SS_LGUI("v"));
153 }
154
155 // Mac VS Debug
156 SEQ_ONE_KEY(KC_D) {
157 tap(KC_F5);
158 }
159
160 // Mac VS Stop Debug
161 SEQ_TWO_KEYS(KC_S, KC_D) {
162 register_code(KC_LSHIFT);
163 tap(KC_F5);
164 unregister_code(KC_LSHIFT);
165 }
166
167 // Start Diablo 3
168 SEQ_ONE_KEY(KC_3) {
169 SEND_STRING(SS_LCTRL(" "));
170 SEND_STRING("Diablo");
171 tap(KC_ENTER);
172 }
173
174 SEQ_ONE_KEY(KC_B) {
175 SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION " ");
176 tap(KC_ENTER);
177 SEND_STRING ("Built at: " QMK_BUILDDATE);
178 }
179#ifndef NO_SECRETS
180 matrix_scan_secrets();
181#endif // !NO_SECRETS
182 }
89 183
90#ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code. 184#ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code.
91 run_diablo_macro_check(); 185 run_diablo_macro_check();
@@ -93,85 +187,3 @@ void matrix_scan_user(void) {
93 187
94 matrix_scan_keymap(); 188 matrix_scan_keymap();
95} 189}
96
97bool process_record_user(uint16_t keycode, keyrecord_t *record) {
98 /* uint8_t default_layer = 0;
99 default_layer = eeconfig_read_default_layer(); */
100 switch (keycode) {
101 case JJ_COPY:
102 if (!record->event.pressed) {
103 SEND_STRING(SS_LGUI("c"));
104 }
105 return false;
106 break;
107 case JJ_PSTE:
108 if (!record->event.pressed) {
109 SEND_STRING(SS_LGUI("v"));
110 }
111 return false;
112 break;
113 case JJ_ARRW:
114 if (!record->event.pressed) {
115 SEND_STRING("->");
116 }
117 return false;
118 break; /*
119 case KC_SWRK:
120 if (!record->event.pressed) {
121 set_single_persistent_default_layer(_SWRKMN);
122 layer_move(default_layer);
123 //ergodox_blink_all_leds();
124 //ergodox_blink_all_leds();
125 }
126 return false;
127 break;
128 case KC_HWRK:
129 if (!record->event.pressed) {
130 set_single_persistent_default_layer(_HWRKMN);
131 layer_move(default_layer);
132 //ergodox_blink_all_leds();
133 //ergodox_blink_all_leds();
134 }
135 return false;
136 break;
137 case KC_EPRM:
138 if (!record->event.pressed) {
139 //ergodox_blink_all_leds();
140 eeconfig_init();
141 }
142 return false;
143 break;
144 case MC_LOCK:
145 if (!record->event.pressed) {
146 layer_move(default_layer);
147 SEND_STRING(SS_LCTRL(SS_LGUI("q")));
148 }
149 return false;
150 break; */
151 case KC_DCLR:
152#ifdef TAP_DANCE_ENABLE
153 if (record->event.pressed) {
154 uint8_t dtime;
155 for (dtime = 0; dtime < 4; dtime++) {
156 diablo_key_time[dtime] = diablo_times[0];
157 }
158 }
159#endif // !TAP_DANCE_ENABLE
160 return false;
161 break;
162 case KC_CCCV:
163 if (record->event.pressed) {
164 copy_paste_timer = timer_read();
165 } else {
166 if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy
167 SEND_STRING(SS_LGUI("c"));
168 } else {
169 SEND_STRING(SS_LGUI("v"));
170 }
171 }
172 return false;
173 break;
174 }
175 return process_record_keymap(keycode, record);
176}
177
diff --git a/users/bocaj/bocaj.h b/users/bocaj/bocaj.h
index 7b537397f..04991a015 100644
--- a/users/bocaj/bocaj.h
+++ b/users/bocaj/bocaj.h
@@ -1,141 +1,85 @@
1#ifndef USERSPACE 1/*
2#define USERSPACE 2Copyright 2018 Jacob Jerrell <jacob.jerrell@gmail.com> @JacobJerrell
3 3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#pragma once
4#include "quantum.h" 19#include "quantum.h"
20#include "version.h"
21#include "eeprom.h"
22#include "wrappers.h"
23#include "process_records.h"
24#ifdef TAP_DANCE_ENABLE
25 #include "tap_dances.h"
26#endif // TAP_DANCE_ENABLE
5 27
6/* *** *** *** *** *** * 28/* Layer Names */
7 * Define layer names *
8 * *** *** *** *** *** */
9enum userspace_layers { 29enum userspace_layers {
10 _HWRKMN = 0, 30 _WORKMAN = 0,
11 _SWRKMN, 31 _WINWORKMAN,
32 _QWERTY,
12 _LOWER, 33 _LOWER,
13 _ADJUST, 34 _ADJUST,
14 _NUMS, 35 _DIABLO,
15 _NMOD,
16 _DIABLO
17}; 36};
18 37
19#define EECONFIG_USERSPACE (uint8_t *)19 38#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE))
39 #define BOCAJ_UNICODE_MODE UC_OSX
40#else
41 // set to 2 for UC_WIN, set to 4 for UC_WINC
42 #define BOCAJ_UNICODE_MODE 2
43#endif
44
45/*
46define modifiers here, since MOD_* doesn't seem to work for these
47 */
48#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
49#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL))
50#define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
51#define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI))
52
53bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed);
54bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer);
55bool send_game_macro(const char *str, keyrecord_t *record, bool override);
56void matrix_init_keymap(void);
57void shutdown_keymap(void);
58void suspend_power_down_keymap(void);
59void suspend_wakeup_init_keymap(void);
60void matrix_scan_keymap(void);
61uint32_t layer_state_set_keymap (uint32_t state);
62uint32_t default_layer_state_set_keymap (uint32_t state);
63void led_set_keymap(uint8_t usb_led);
64void eeconfig_init_keymap(void);
65void tap(uint16_t keycode);
66
20typedef union { 67typedef union {
21 uint8_t raw; 68 uint8_t raw;
22} userspace_config_t; 69} userspace_config_t;
23 70
24/* *** *** *** *** *** *** * 71extern userspace_config_t userspace_config;
25 * Define Custom Keycodes *
26 * *** *** *** *** *** *** */
27enum userspace_custom_keycodes {
28 KC_EPRM = SAFE_RANGE, // can always be here
29 KC_SWRK,
30 KC_HWRK,
31 KC_VRSN,
32 JJ_COPY,
33 JJ_PSTE,
34 JJ_ARRW,
35 KC_CCCV,
36 MC_LOCK,
37 KC_DCLR,
38 NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes
39};
40
41// Space Cadet Hyper/Meh and [/]
42#define HYP_LBK ALL_T(KC_LBRACKET)
43#define MEH_RBK MEH_T(KC_RBRACKET)
44
45// Layout beauti-/simpli-fication
46#define KC_LWEN LT(_LOWER, KC_ENTER)
47#define KC_ADJS TT(_ADJUST)
48#define KC_NUMS TT(_NUMS)
49#define LM_SHFT LM(_NMOD, MOD_LSFT)
50#define XXXXXXX KC_NO
51#define _______ KC_TRNS
52
53void tap(uint16_t keycode);
54
55/* *** *** *** *** *** *** *
56 * Diablo 3 Macro Handling *
57 * *** *** *** *** *** *** */
58 72
59// If Tap Dancing is enabled, we manage that here. 73// If Tap Dancing is enabled, we manage that here.
60// If it is not, then we define the KC_D3_# codes gracefully 74// If it is not, then we define the KC_D3_# codes gracefully
61#ifdef TAP_DANCE_ENABLE 75#ifdef TAP_DANCE_ENABLE
62enum { 76 #define KC_D3_1 TD(TD_D3_1)
63 TD_D3_1 = 0, 77 #define KC_D3_2 TD(TD_D3_2)
64 TD_D3_2, 78 #define KC_D3_3 TD(TD_D3_3)
65 TD_D3_3, 79 #define KC_D3_4 TD(TD_D3_4)
66 TD_D3_4,
67};
68
69#define KC_D3_1 TD(TD_D3_1)
70#define KC_D3_2 TD(TD_D3_2)
71#define KC_D3_3 TD(TD_D3_3)
72#define KC_D3_4 TD(TD_D3_4)
73#else // !TAP_DANCE_ENABLE 80#else // !TAP_DANCE_ENABLE
74#define KC_D3_1 KC_1 81 #define KC_D3_1 KC_1
75#define KC_D3_2 KC_2 82 #define KC_D3_2 KC_2
76#define KC_D3_3 KC_3 83 #define KC_D3_3 KC_3
77#define KC_D3_4 KC_4 84 #define KC_D3_4 KC_4
78#endif // TAP_DANCE_ENABLE 85#endif // TAP_DANCE_ENABLE
79
80// Wrapper for handling of keymap 'blocks'
81// not 100% sure what this first part does. Credit to Drashna
82#if (!defined(LAYOUT) && defined(KEYMAP))
83#define LAYOUT KEYMAP
84#endif
85
86#define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__)
87/* Pretty Layout
88.---------------------------------------------. .---------------------------------------------.
89| 1 | 2 | 3 | 4 | 5 | 6 | 7 | ! 8 | 9 | 10 | 11 | 12 | 13 | 14 |
90!-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------!
91| 15 | 16 | 17 | 18 | 19 | 20 | 21 | ! 22 | 23 | 24 | 25 | 26 | 27 | 28 |
92!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------!
93| 29 | 30 | 31 | 32 | 33 | 34 |-------! !-------! 35 | 36 | 37 | 38 | 39 | 40 |
94!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------!
95| 41 | 42 | 43 | 44 | 45 | 46 | 47 | ! 48 | 49 | 50 | 51 | 52 | 53 | 54 |
96'-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------'
97 | 55 | 56 | 57 | 58 | 59 | .---------------. .---------------. ! 60 | 61 | 62 | 63 | 64 |
98 '------------------------------' | 65 | 66 | ! 67 | 68 | '------------------------------'
99 .-------+-------+-------! !-------+-------+-------.
100 ! ! | 69 | ! 70 | ! !
101 ! ! !-------! !-------! ! !
102 | 71 | 72 | 73 | ! 74 | 75 | 76 |
103 '-----------------------' '-----------------------'
104*/
105
106#define _______________________SWORKMAN_L1_______________________ KC_Q, KC_W, KC_E, KC_R, KC_T
107#define _______________________SWORKMAN_L2_______________________ KC_A, SFT_T(KC_S), GUI_T(KC_D), ALT_T(KC_F), KC_G
108#define _______________________SWORKMAN_L3_______________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B
109
110#define _______________________SWORKMAN_R1_______________________ KC_Y, KC_U, KC_I, KC_O, KC_P
111#define _______________________SWORKMAN_R2_______________________ KC_H, ALT_T(KC_J), GUI_T(KC_K), SFT_T(KC_L), KC_SCLN
112#define _______________________SWORKMAN_R3_______________________ KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH)
113
114// Hardware Driven Workman
115#define _______________________HWORKMAN_L1_______________________ KC_Q, KC_D, KC_R, KC_W, KC_B
116#define _______________________HWORKMAN_L2_______________________ KC_A, SFT_T(KC_S), GUI_T(KC_H), ALT_T(KC_T), KC_G
117#define _______________________HWORKMAN_L3_______________________ CTL_T(KC_Z), KC_X, KC_M, KC_C, KC_V
118
119#define _______________________HWORKMAN_R1_______________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN
120#define _______________________HWORKMAN_R2_______________________ KC_Y, ALT_T(KC_N), GUI_T(KC_E), SFT_T(KC_O), KC_I
121#define _______________________HWORKMAN_R3_______________________ KC_K, KC_L, KC_COMM, KC_DOT, CTL_T(KC_SLASH)
122
123#define ___________________ERGODOX_BOTTOM_LEFT___________________ TT(_DIABLO), KC_NUMS, TT(_LOWER), KC_UP, KC_LEFT
124#define ___________________ERGODOX_BOTTOM_RIGHT__________________ KC_RIGHT, KC_DOWN, XXXXXXX, XXXXXXX, TT(_ADJUST)
125
126#define _______________________NUMBER_LEFT_______________________ KC_1, KC_2, KC_3, KC_4, KC_5
127#define _______________________NUMBER_RIGHT______________________ KC_6, KC_7, KC_8, KC_9, KC_0
128
129#define _______________________SPECIAL_LEFT______________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC
130#define _______________________SPECIAL_RIGHT_____________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN
131
132#define _________________________________________________________ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
133#define XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX KC_NO, KC_NO, KC_NO, KC_NO, KC_NO
134
135// LEFT | RIGHT
136#define ______________________ERGODOX_THUMBS_____________________ KC_APP,KC_HOME, KC_PGUP,KC_ESC, \
137 KC_END, KC_PGDOWN, \
138 KC_SPACE,KC_BSPACE,JJ_COPY, JJ_PSTE,KC_TAB,KC_LWEN
139
140
141#endif // !USERSPACE
diff --git a/users/bocaj/config.h b/users/bocaj/config.h
index 0e726598c..1956ea6d9 100644
--- a/users/bocaj/config.h
+++ b/users/bocaj/config.h
@@ -10,12 +10,15 @@
10// actually sends Ctrl-x. That's bad.) 10// actually sends Ctrl-x. That's bad.)
11#define IGNORE_MOD_TAP_INTERRUPT 11#define IGNORE_MOD_TAP_INTERRUPT
12#undef PERMISSIVE_HOLD 12#undef PERMISSIVE_HOLD
13#define PREVENT_STUCK_MODIFIERS
13 14
14#ifdef TAPPING_TERM 15#ifdef TAPPING_TERM
15#undef TAPPING_TERM 16#undef TAPPING_TERM
16#endif // TAPPING_TERM 17#endif // TAPPING_TERM
17#define TAPPING_TERM 175 18#define TAPPING_TERM 175
18 19
20#define RETRO_TAPPING
21
19// Disable action_get_macro and fn_actions, since we don't use these 22// Disable action_get_macro and fn_actions, since we don't use these
20// and it saves on space in the firmware. 23// and it saves on space in the firmware.
21#ifndef NO_DEBUG 24#ifndef NO_DEBUG
@@ -27,6 +30,4 @@
27#define NO_ACTION_MACRO 30#define NO_ACTION_MACRO
28#define NO_ACTION_FUNCTION 31#define NO_ACTION_FUNCTION
29 32
30#define DISABLE_LEADER
31
32#define MACRO_TIMER 5 33#define MACRO_TIMER 5
diff --git a/users/bocaj/process_records.c b/users/bocaj/process_records.c
new file mode 100644
index 000000000..c36683f8b
--- /dev/null
+++ b/users/bocaj/process_records.c
@@ -0,0 +1,149 @@
1#include "bocaj.h"
2#include QMK_KEYBOARD_H
3
4uint16_t copy_paste_timer;
5uint16_t grave_layer_timer;
6uint16_t heal_layer_timer;
7
8__attribute__ ((weak))
9bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
10 return true;
11}
12
13// Defines actions tor my global custom keycodes. Defined in bocaj.h file
14// Then runs the _keymap's record handler if not processed here
15bool process_record_user(uint16_t keycode, keyrecord_t *record) {
16 switch (keycode) {
17 case KC_MWRK:
18 if (!record->event.pressed) {
19 set_single_persistent_default_layer(_WORKMAN);
20 #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE))
21 set_unicode_input_mode(0);
22 #endif
23 layer_move(0);
24 ergodox_blink_all_leds();
25 }
26 break;
27 case KC_WWRK:
28 if (!record->event.pressed) {
29 set_single_persistent_default_layer(_WINWORKMAN);
30 #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE))
31 set_unicode_input_mode(4);
32 #endif
33 layer_move(0);
34 ergodox_blink_all_leds();
35 }
36 break;
37 case KC_MQWR:
38 if (!record->event.pressed) {
39 set_single_persistent_default_layer(_QWERTY);
40 #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE))
41 set_unicode_input_mode(0);
42 #endif
43 layer_move(0);
44 ergodox_blink_all_leds();
45 }
46 break;
47 case MC_LOCK:
48 if (!record->event.pressed) {
49 layer_move(0);
50 SEND_STRING(SS_LCTRL(SS_LGUI("q")));
51 }
52 break;
53 case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader
54 if (!record->event.pressed) {
55 uint8_t temp_mod = get_mods();
56 uint8_t temp_osm = get_oneshot_mods();
57 clear_mods();
58 clear_oneshot_mods();
59 if (biton32(default_layer_state) == _WINWORKMAN) {
60 send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), 10);
61 } else {
62 send_string_with_delay_P(PSTR("util/docker_build.sh " QMK_KEYBOARD ":" QMK_KEYMAP), 10);
63 }
64 if (temp_mod & MODS_SHIFT_MASK) {
65 send_string_with_delay_P(PSTR(":teensy"), 10);
66 }
67 if (temp_mod & MODS_CTRL_MASK) {
68 send_string_with_delay_P(PSTR(" -j8 --output-sync"), 10);
69 }
70 send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10);
71 set_mods(temp_mod);
72 layer_move(0);
73 }
74 break;
75 case KC_DCLR: // reset all Diablo timers, disabling them
76#ifdef TAP_DANCE_ENABLE
77 if (record->event.pressed) {
78 uint8_t dtime;
79 for (dtime = 0; dtime < 4; dtime++) {
80 diablo_key_time[dtime] = diablo_times[0];
81 }
82 }
83#endif // TAP_DANCE_ENABLE
84 break;
85 case JJ_ARRW:
86 if (!record->event.pressed) {
87 SEND_STRING("->");
88 }
89 return false;
90 break;
91 case LM_GRAVE:
92 if (record->event.pressed) {
93 grave_layer_timer = timer_read();
94 } else {
95 if (timer_elapsed(grave_layer_timer) < TAPPING_TERM) {
96 uint8_t temp_mod = get_mods();
97 uint8_t one_shot = get_oneshot_mods();
98 clear_mods();
99 if (temp_mod & MODS_SHIFT_MASK || one_shot & MODS_SHIFT_MASK) {
100 register_code(KC_LSFT);
101 tap(KC_GRAVE);
102 unregister_code(KC_LSFT);
103 } else {
104 tap(KC_GRAVE);
105 }
106 set_mods(temp_mod);
107 } else {
108 layer_move(0);
109 }
110 }
111 return false;
112 break;
113 case KC_CCCV:
114 if (record->event.pressed) {
115 copy_paste_timer = timer_read();
116 } else {
117 if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy
118 SEND_STRING(SS_LGUI("c"));
119 } else {
120 SEND_STRING(SS_LGUI("v"));
121 }
122 }
123 return false;
124 break;
125#ifdef UNICODE_ENABLE
126 case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻
127 if (record->event.pressed) {
128 send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B");
129 }
130 break;
131 case UC_TABL: // ┬─┬ノ( º _ ºノ)
132 if (record->event.pressed) {
133 send_unicode_hex_string("252C 2500 252C 30CE 0028 0020 00BA 0020 005F 0020 00BA 30CE 0029");
134 }
135 break;
136 case UC_SHRG: // ¯\_(ツ)_/¯
137 if (record->event.pressed) {
138 send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF");
139 }
140 break;
141 case UC_DISA: // ಠ_ಠ
142 if (record->event.pressed) {
143 send_unicode_hex_string("0CA0 005F 0CA0");
144 }
145 break;
146#endif
147 }
148 return process_record_keymap(keycode, record);
149}
diff --git a/users/bocaj/process_records.h b/users/bocaj/process_records.h
new file mode 100644
index 000000000..248df13e1
--- /dev/null
+++ b/users/bocaj/process_records.h
@@ -0,0 +1,52 @@
1#pragma once
2#include "bocaj.h"
3
4#if defined(KEYMAP_SAFE_RANGE)
5 #define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE
6#else
7 #define PLACEHOLDER_SAFE_RANGE SAFE_RANGE
8#endif
9
10enum userspace_custom_keycodes {
11 KC_EPRM = PLACEHOLDER_SAFE_RANGE, // can always be here
12 KC_MWRK,
13 KC_WWRK,
14 KC_MQWR,
15 KC_VRSN,
16 LM_GRAVE, // Shift if held, layer change if tapped
17 JJ_COPY,
18 JJ_PSTE,
19 JJ_ARRW,
20 KC_CCCV,
21 MC_LOCK,
22 KC_DCLR,
23 KC_MAKE,
24 UC_FLIP, // (ಠ痊ಠ)┻━┻
25 UC_TABL, // ┬─┬ノ( º _ ºノ)
26 UC_SHRG, // ¯\_(ツ)_/¯
27 UC_DISA, // ಠ_ಠ
28 NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes
29};
30
31bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
32
33// One Shot
34#define OS_LSFT OSM(MOD_LSFT)
35
36// Space Cadet Hyper/Meh and [/]
37#define HYP_LBK ALL_T(KC_LBRACKET)
38#define MEH_RBK MEH_T(KC_RBRACKET)
39
40#define GUI_CTR(os, kc) MT( (os == 0) ? (MOD_LGUI) : (MOD_LCTL), kc )
41
42// Layout beauti-/simpli-fication
43#define KC_LWEN LT(_LOWER, KC_ENTER)
44#define KC_ADJS TT(_ADJUST)
45#define KC_NUMS TT(_LOWER)
46#define KC_GAME TT(_DIABLO)
47#define XXXXXXX KC_NO
48#define _______ KC_TRNS
49
50// Other Keycodes
51#define KC_RST RESET
52#define KC_BS KC_BSLASH
diff --git a/users/bocaj/readme.md b/users/bocaj/readme.md
index bab6d7337..669299cb0 100644
--- a/users/bocaj/readme.md
+++ b/users/bocaj/readme.md
@@ -1,14 +1,102 @@
1Copyright 2018 Jacob Jerrell jacob.jerrell@gmail.com @JacobJerrell 1# Overview
2 2
3This program is free software: you can redistribute it and/or modify 3My personal QMK userspace. First, I must say that the credit for a majority of the code found here belongs to Drashna and/or the people he derived his code from. My Ergodox layout is briefly described in its respective folder. As for explaining this userspace, you could honestly go to Drashna's userspace and read his well put together readme. Regardless, I am mostly writing this as an excercise for myself to better understand what is going on, and where applicable, describe things that I innovated on my own.
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.
7 4
8This program is distributed in the hope that it will be useful, 5## Bocaj.c
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 6
13You should have received a copy of the GNU General Public License 7### Unicode
14along with this program. If not, see <http://www.gnu.org/licenses/>. 8
9I've always had difficulty implementing unicode in QMK, all of this code is literally copy/pasted from Drashna's userspace and lies dormant here until I can take the time to figure it out.
10
11Update: Got it to work in Mac OS which is more important to me than Windows (probably pretty easy to figure out at this point). So I'm a happy table flipping person now!
12
13(ノಠ痊ಠ)ノ彡┻━┻
14
15┬─┬ノ( º _ ºノ)
16
17### Tap Macro
18
19Not sure why this doesn't exist in QMK already (maybe it does?)
20
21```c
22void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); };
23```
24
25### *_keymap functions
26
27We're running *_user functions in the userspace, that way we can add to or reconfigure at the keyboard level. Any *_user functions should call the equivalent *_keymap function at the end. If the *_keymap function isn't defined in the keymap, the `__attribute__ ((weak))` will prevent build problems.
28
29### Startup/Suspend/Shutdown Functions
30
31I have no idea what these do. Non-Ergodox keyboard functions?
32
33### Matrix Scan User
34
35Leader key defines, Diablo macro ancillary function, run matrix_scan_keymap.
36
37#### Leader Key
38
39I've always been interested in this feature, but I've had 0 experience with applications that have similar behavior. My implementation seeks to implement features that I feel VS2017 lacks
40
41## Secrets
42
43Hacked Drashna's secret macro implementation to work with the leader key instead.
44TODO: Finish documentation
45
46## Bocaj.h
47
48Layer defines, some macro ancillary defines, setup Diablo macros and failsafe
49
50## Process_Records.c/.h
51
52Again, taking ideas from Drashna to make maintenance simpler. A couple of things that I'm proud of here, but nothing really ground breaking.
53
54* Features
55 * Change default layer
56 * KC_MWRK, KC_WWRK, KC_MQWR
57 * MacOS Lock Screen Macro
58 * Make macro (Credit: Drashna)
59 * Need to reconfigure so it runs the docker command if one of the Mac OS layers are default because the AVR install fails on the corporate laptop
60 * Arrow macro (->) because I find myself telling people how to get to something quite frequently and typing this manually requires moving the right hand to the top-left of the ergodox and then to the bottom right, which feels unnatural.
61 * LM_GRAVE
62 * While combining _NUMS and _LOWER, I also needed a place to put F1-12 keys. This required me to relocate the grave key. The most comfortable place to put it was over a key that I frequently use to toggle the numpad. I do have other ways to get to/from this layer but my mind has been wired to use them for different workflows, so I would sit here frozen for a moment trying to tell my fingers where to go
63 * How it works
64 * A timer starts when pressed down
65 * If the timer at release was less than the TAPPING_TERM define
66 * Get mods
67 * If Shift was held or one-shot shift was active
68 * Send `~`
69 * Else
70 * Send `
71 * Else (timer at released was greater than the TAPPING_TERM define)
72 * Move to the default layer
73 * KC_CCCV
74 * Another neat idea I found in Drashna's userspace... highly underutilized in my layout but the inspiration for LM_GRAVE was obviously derived from this code
75 * Unicode stuff
76 * All I've ever wanted was a table-flip macro... I managed to get about half of it to work before I gave up and disabled it
77
78## Send_Unicode.c/.h
79
80I have some basic understanding of this, Drashna may already have it documented in his userspace. I'll put it in my own words when I get around to making it work and understanding it better.
81
82## Tap_Dances.c/h
83
84Again, building on Drashna's userspace organization to simplify maintenance of a heavily configured layout. This is all the stuff for the Diablo 3 macros that spam a given skill (1-4) every ~1 second
85
86## Wrappers.h
87
88Traditionally, you would put all of this into the \<username>.h file. But I liked the idea of separating it to simplify modification in the future.
89
90### GUI_CTR(os, kc)
91
92A notable mention in this file is the GUI_CTR(os, kc) custom keycode defined in process_records.h as:
93
94```c
95#define GUI_CTR(os, kc) MT( (os == 0) ? (MOD_LGUI) : (MOD_LCTL), kc )
96```
97
98I tried several things before coming to this one-liner conclusion. I believe it is quite elegant and it definitely solves the problem I had (separate wrappers for Windows/MacOS layers). But I would love to make this into something more intuitive, like a macro that detects which layer you're on and sends the applicable hotkey when held, or keycode when tapped. Ultimately, I was too tired of thinking about it to come up with a solution like that at this time.
99
100Anyhow, if you set `os == 1`, it sends the Windows CTRL hotkey when held. If you set `os == 0`, it sends the Mac OS GUI hotkey when held. If tapped, it sends the keycode.
101
102This is effectively a slightly more advanced `MOD_T(kc)` keycode.
diff --git a/users/bocaj/rules.mk b/users/bocaj/rules.mk
index 17d2772a7..9ed8c250a 100644
--- a/users/bocaj/rules.mk
+++ b/users/bocaj/rules.mk
@@ -1,5 +1,33 @@
1SRC += bocaj.c 1SRC += bocaj.c \
2 process_records.c
3
4ifneq ("$(wildcard $(USER_PATH)/secrets.c)","")
5 SRC += secrets.c
6endif
2 7
3ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) 8ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
4 SRC += tap_dances.c 9 SRC += tap_dances.c
5endif 10endif
11
12# Caused problems when building via docker on Mac OS
13# EXTRAFLAGS += -flto
14
15ifeq ($(strip $(NO_SECRETS)), yes)
16 OPT_DEFS += -DNO_SECRETS
17endif
18
19ifeq ($(strip $(MACROS_ENABLED)), yes)
20 OPT_DEFS += -DMACROS_ENABLED
21endif
22
23ifeq ($(strip $(UCIS_ENABLE)), yes)
24 SRC += send_unicode.c
25endif
26
27ifeq ($(strip $(UNICODEMAP_ENABLE)), yes)
28 SRC += send_unicode.c
29endif
30
31ifeq ($(strip $(UNICODE_ENABLE)), yes)
32 SRC += send_unicode.c
33endif
diff --git a/users/bocaj/send_unicode.c b/users/bocaj/send_unicode.c
new file mode 100644
index 000000000..b1290f631
--- /dev/null
+++ b/users/bocaj/send_unicode.c
@@ -0,0 +1,106 @@
1// Written by konstantin: vomindoraan
2#include "send_unicode.h"
3#include <ctype.h>
4#include <string.h>
5
6__attribute__((weak))
7void send_unicode_hex_string(const char* str) {
8 if (!str) { return; } // Safety net
9
10 while (*str) {
11 // Find the next code point (token) in the string
12 for (; *str == ' '; str++);
13 size_t n = strcspn(str, " "); // Length of the current token
14 char code_point[n+1];
15 strncpy(code_point, str, n);
16 code_point[n] = '\0'; // Make sure it's null-terminated
17
18 // Normalize the code point: make all hex digits lowercase
19 for (char *p = code_point; *p; p++) {
20 *p = tolower((unsigned char)*p);
21 }
22
23 // Send the code point as a Unicode input string
24 unicode_input_start();
25 send_string(code_point);
26 unicode_input_finish();
27
28 str += n; // Move to the first ' ' (or '\0') after the current token
29 }
30}
31
32// (ノಠ痊ಠ)ノ彡┻━┻
33// send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B");
34
35//Old code
36// (╯°□°)╯ ︵ ┻━┻
37 #if 0
38 register_code(KC_RSFT);
39 tap(KC_9);
40 unregister_code(KC_RSFT);
41 process_unicode((0x256F | QK_UNICODE), record); // Arm
42 process_unicode((0x00B0 | QK_UNICODE), record); // Eye
43 process_unicode((0x25A1 | QK_UNICODE), record); // Mouth
44 process_unicode((0x00B0 | QK_UNICODE), record); // Eye
45 register_code(KC_RSFT);
46 tap(KC_0);
47 unregister_code(KC_RSFT);
48 process_unicode((0x256F | QK_UNICODE), record); // Arm
49 tap(KC_SPC);
50 process_unicode((0x0361 | QK_UNICODE), record); // Flippy
51 tap(KC_SPC);
52 process_unicode((0x253B | QK_UNICODE), record); // Table
53 process_unicode((0x2501 | QK_UNICODE), record); // Table
54 process_unicode((0x253B | QK_UNICODE), record); // Table
55 #endif
56
57
58// If you need a good converter: https://r12a.github.io/app-conversion/
59uint8_t saved_mods;
60
61void unicode_input_start (void) {
62 // save current mods
63 saved_mods = get_mods(); // Save current mods
64 clear_mods(); // Unregister mods to start from a clean state
65
66 switch(get_unicode_input_mode()) {
67 case UC_OSX:
68 register_code(KC_LALT);
69 break;
70 case UC_LNX:
71 register_code(KC_LCTL);
72 register_code(KC_LSFT);
73 register_code(KC_U);
74 unregister_code(KC_U);
75 unregister_code(KC_LSFT);
76 unregister_code(KC_LCTL);
77 break;
78 case UC_WIN:
79 register_code(KC_LALT);
80 register_code(KC_PPLS);
81 unregister_code(KC_PPLS);
82 break;
83 case UC_WINC:
84 register_code(KC_RALT);
85 unregister_code(KC_RALT);
86 register_code(KC_U);
87 unregister_code(KC_U);
88 break;
89 }
90 wait_ms(UNICODE_TYPE_DELAY);
91}
92
93void unicode_input_finish (void) {
94 switch(get_unicode_input_mode()) {
95 case UC_OSX:
96 case UC_WIN:
97 unregister_code(KC_LALT);
98 break;
99 case UC_LNX:
100 register_code(KC_SPC);
101 unregister_code(KC_SPC);
102 break;
103 }
104
105 set_mods(saved_mods); // Reregister previously set mods
106}
diff --git a/users/bocaj/send_unicode.h b/users/bocaj/send_unicode.h
new file mode 100644
index 000000000..818b6e571
--- /dev/null
+++ b/users/bocaj/send_unicode.h
@@ -0,0 +1,71 @@
1#pragma once
2
3#include "quantum.h"
4
5void send_unicode_hex_string(const char* str);
6
7/* use X(n) to call the */
8#ifdef UNICODEMAP_ENABLE
9enum unicode_name {
10 THINK, // thinking face 🤔
11 GRIN, // grinning face 😊
12 SMRK, // smirk 😏
13 WEARY, // good shit 😩
14 UNAMU, // unamused 😒
15
16 SNEK, // snke 🐍
17 PENGUIN, // 🐧
18 DRAGON, // 🐉
19 MONKEY, // 🐒
20 CHICK, // 🐥
21 BOAR, // 🐗
22
23 OKOK, // 👌
24 EFFU, // 🖕
25 INUP, // 👆
26 THUP, // 👍
27 THDN, // 👎
28
29 BBB, // dat B 🅱
30 POO, // poop 💩
31 HUNDR, // 100 💯
32 EGGPL, // EGGPLANT 🍆
33 WATER, // wet 💦
34 TUMBLER, // 🥃
35
36 LIT, // fire 🔥
37 BANG, // ‽
38 IRONY, // ⸮
39 DEGREE // °
40};
41
42
43const uint32_t PROGMEM unicode_map[] = {
44 [THINK] = 0x1F914,
45 [GRIN] = 0x1F600,
46 [BBB] = 0x1F171,
47 [POO] = 0x1F4A9,
48 [HUNDR] = 0x1F4AF,
49 [SMRK] = 0x1F60F,
50 [WEARY] = 0x1F629,
51 [EGGPL] = 0x1F346,
52 [WATER] = 0x1F4A6,
53 [LIT] = 0x1F525,
54 [UNAMU] = 0x1F612,
55 [SNEK] = 0x1F40D,
56 [PENGUIN] = 0x1F427,
57 [BOAR] = 0x1F417,
58 [MONKEY] = 0x1F412,
59 [CHICK] = 0x1F425,
60 [DRAGON] = 0x1F409,
61 [OKOK] = 0x1F44C,
62 [EFFU] = 0x1F595,
63 [INUP] = 0x1F446,
64 [THDN] = 0x1F44E,
65 [THUP] = 0x1F44D,
66 [TUMBLER] = 0x1F943,
67 [BANG] = 0x0203D,
68 [IRONY] = 0x02E2E,
69 [DEGREE] = 0x000B0
70 };
71#endif // UNICODEMAP_ENABLE
diff --git a/users/bocaj/tap_dances.c b/users/bocaj/tap_dances.c
index 10767db45..a9628a345 100644
--- a/users/bocaj/tap_dances.c
+++ b/users/bocaj/tap_dances.c
@@ -1,4 +1,3 @@
1#include "bocaj.h"
2#include "tap_dances.h" 1#include "tap_dances.h"
3 2
4 3
diff --git a/users/bocaj/tap_dances.h b/users/bocaj/tap_dances.h
index 8935753f6..5b1277ec5 100644
--- a/users/bocaj/tap_dances.h
+++ b/users/bocaj/tap_dances.h
@@ -1,3 +1,6 @@
1#pragma once
2#include "bocaj.h"
3
1//define diablo macro timer variables 4//define diablo macro timer variables
2extern uint16_t diablo_timer[4]; 5extern uint16_t diablo_timer[4];
3extern uint8_t diablo_times[]; 6extern uint8_t diablo_times[];
@@ -5,3 +8,12 @@ extern uint8_t diablo_key_time[4];
5 8
6 9
7void run_diablo_macro_check(void); 10void run_diablo_macro_check(void);
11
12#ifdef TAP_DANCE_ENABLE
13enum {
14 TD_D3_1 = 0,
15 TD_D3_2,
16 TD_D3_3,
17 TD_D3_4
18};
19#endif // TAP_DANCE_ENABLE
diff --git a/users/bocaj/wrappers.h b/users/bocaj/wrappers.h
new file mode 100644
index 000000000..379edaad2
--- /dev/null
+++ b/users/bocaj/wrappers.h
@@ -0,0 +1,37 @@
1#pragma once
2#include "bocaj.h"
3
4#if (!defined(LAYOUT) && defined(KEYMAP))
5#define LAYOUT KEYMAP
6#endif
7
8#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__)
9#define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__)
10
11#define _________________QWERTY_L1__________________ KC_Q, KC_W, KC_E, KC_R, KC_T
12#define _________________QWERTY_L2__________________ KC_A, KC_S, GUI_CTR(0, KC_D), KC_F, KC_G
13#define _________________QWERTY_L3__________________ KC_Z, KC_X, KC_C, KC_V, KC_B
14
15#define _________________QWERTY_R1__________________ KC_Y, KC_U, KC_I, KC_O, KC_P
16#define _________________QWERTY_R2__________________ KC_H, KC_J, GUI_CTR(0, KC_K), KC_L, KC_SCLN
17#define _________________QWERTY_R3__________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH
18
19// Hardware Driven Workman
20#define _________________WORKMAN_L1_________________ KC_Q, KC_D, KC_R, KC_W, KC_B
21#define _________________WORKMAN_L2_________________ KC_A, KC_S, GUI_CTR(0, KC_H), KC_T, KC_G // GUI_CTR(0, kc) behaves as GUI_T(kc)
22#define ________________WWORKMAN_L2_________________ KC_A, KC_S, GUI_CTR(1, KC_H), KC_T, KC_G // GUI_CTR(1, kc) behaves as CTR_T(kc)
23#define _________________WORKMAN_L3_________________ KC_Z, KC_X, KC_M, KC_C, KC_V
24
25#define _________________WORKMAN_R1_________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN
26#define _________________WORKMAN_R2_________________ KC_Y, KC_N, GUI_CTR(0, KC_E), KC_O, KC_I // GUI_CTR(0, kc) behaves as GUI_T(kc)
27#define ________________WWORKMAN_R2_________________ KC_Y, KC_N, GUI_CTR(1, KC_E), KC_O, KC_I // GUI_CTR(1, kc) behaves as CTR_T(kc)
28#define _________________WORKMAN_R3_________________ KC_K, KC_L, KC_COMM, KC_DOT, KC_SLASH
29
30
31#define __________________NUMBER_LEFT_______________ KC_1, KC_2, KC_3, KC_4, KC_5
32#define __________________NUMBER_RIGHT______________ KC_6, KC_7, KC_8, KC_9, KC_0
33
34#define __________________FUNCTION_LEFT_____________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5
35#define __________________FUNCTION_RIGHT____________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10
36
37#define ____________________BLANK___________________ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS