2 Copyright 2018 Jacob Jerrell <jacob.jerrell@gmail.com> @JacobJerrell
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 userspace_config_t userspace_config;
21 #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE))
22 #define BOCAJ_UNICODE_MODE UC_OSX
24 // set to 2 for UC_WIN, set to 4 for UC_WINC
25 #define BOCAJ_UNICODE_MODE 2
28 void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); };
30 // Add reconfigurable functions here, for keymap customization
31 // This allows for a global, userspace functions, and continued
32 // customization of the keymap. Use _keymap instead of _user
33 // functions in the keymaps
34 __attribute__ ((weak))
35 void matrix_init_keymap(void) {}
37 __attribute__ ((weak))
38 void startup_keymap(void) {}
40 __attribute__ ((weak))
41 void suspend_power_down_keymap(void) {}
43 __attribute__ ((weak))
44 void suspend_wakeup_init_keymap(void) {}
46 __attribute__ ((weak))
47 void matrix_scan_keymap(void) {}
49 __attribute__ ((weak))
50 bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
54 __attribute__ ((weak))
55 void matrix_scan_secrets(void) {}
57 __attribute__ ((weak))
58 uint32_t layer_state_set_keymap (uint32_t state) {
62 __attribute__ ((weak))
63 uint32_t default_layer_state_set_keymap (uint32_t state) {
67 __attribute__ ((weak))
68 void led_set_keymap(uint8_t usb_led) {}
70 // Call user matrix init, set default RGB colors and then
71 // call the keymap's init function
72 void matrix_init_user(void) {
73 userspace_config.raw = eeconfig_read_user();
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
84 void startup_user (void) {
88 void suspend_power_down_user(void)
90 suspend_power_down_keymap();
93 void suspend_wakeup_init_user(void)
95 suspend_wakeup_init_keymap();
96 #ifdef KEYBOARD_ergodox_ez
101 void 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();
108 eeprom_update_byte(EECONFIG_UNICODEMODE, BOCAJ_UNICODE_MODE);
113 // No global matrix scan code, so just run keymap's matrix
115 void matrix_scan_user(void) {
116 static bool has_ran_yet;
121 LEADER_DICTIONARY() {
125 // Mac Save (Leader -> s)
127 SEND_STRING(SS_LGUI("s"));
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"));
139 SEND_STRING(SS_LGUI("v"));
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"));
152 SEND_STRING(SS_LGUI("v"));
161 SEQ_TWO_KEYS(KC_S, KC_D) {
162 register_code(KC_LSHIFT);
164 unregister_code(KC_LSHIFT);
169 SEND_STRING(SS_LCTRL(" "));
170 SEND_STRING("Diablo");
175 SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION " ");
177 SEND_STRING ("Built at: " QMK_BUILDDATE);
180 matrix_scan_secrets();
181 #endif // !NO_SECRETS
184 #ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code.
185 run_diablo_macro_check();
186 #endif // TAP_DANCE_ENABLE
188 matrix_scan_keymap();