clear_keyboard();
tap(userspace_config.is_overwatch ? KC_BSPC : KC_ENTER);
wait_ms(50);
- send_string(str);
+ send_string_with_delay(str, MACRO_TIMER);
wait_ms(50);
tap(KC_ENTER);
}
void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); };
+bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed) {
+ static uint16_t this_timer;
+ if(pressed) {
+ this_timer= timer_read();
+ } else {
+ if (timer_elapsed(this_timer) < TAPPING_TERM){
+ register_code(code);
+ unregister_code(code);
+ } else {
+ register_code(mod_code);
+ register_code(code);
+ unregister_code(code);
+ unregister_code(mod_code);
+ }
+ }
+ return false;
+}
+
+bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer) {
+ if(pressed) {
+ this_timer= timer_read();
+ } else {
+ if (timer_elapsed(this_timer) < TAPPING_TERM){
+ register_code(code);
+ unregister_code(code);
+ } else {
+ register_code(mod_code);
+ register_code(code);
+ unregister_code(code);
+ unregister_code(mod_code);
+ }
+ }
+ return false;
+}
// Add reconfigurable functions here, for keymap customization
// This allows for a global, userspace functions, and continued
__attribute__ ((weak))
void matrix_init_keymap(void) {}
+__attribute__ ((weak))
+void startup_keymap(void) {}
+
+__attribute__ ((weak))
+void suspend_power_down_keymap(void) {}
+
+__attribute__ ((weak))
+void suspend_wakeup_init_keymap(void) {}
+
__attribute__ ((weak))
void matrix_scan_keymap(void) {}
return true;
}
+
__attribute__ ((weak))
uint32_t layer_state_set_keymap (uint32_t state) {
return state;
}
+__attribute__ ((weak))
+uint32_t default_layer_state_set_keymap (uint32_t state) {
+ return state;
+}
+
__attribute__ ((weak))
void led_set_keymap(uint8_t usb_led) {}
#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE))
set_unicode_input_mode(UC_WINC);
#endif //UNICODE_ENABLE
- matrix_init_rgb();
matrix_init_keymap();
}
+void startup_user (void) {
+ #ifdef RGBLIGHT_ENABLE
+ matrix_init_rgb();
+ #endif //RGBLIGHT_ENABLE
+ startup_keymap();
+}
+
+void suspend_power_down_user(void)
+{
+ suspend_power_down_keymap();
+}
+
+void suspend_wakeup_init_user(void)
+{
+ suspend_wakeup_init_keymap();
+ #ifdef KEYBOARD_ergodox_ez
+ wait_ms(10);
+ #endif
+}
+
// No global matrix scan code, so just run keymap's matrix
// scan function
void matrix_scan_user(void) {
+ static bool has_ran_yet;
+ if (!has_ran_yet) {
+ has_ran_yet = true;
+ startup_user();
+ }
#ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code.
run_diablo_macro_check();
case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader
if (!record->event.pressed) {
- SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP
+ send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP
#if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU))
":dfu"
#elif defined(BOOTLOADER_HALFKAY)
#elif defined(BOOTLOADER_CATERINA)
":avrdude"
#endif // bootloader options
- SS_TAP(X_ENTER));
+ SS_TAP(X_ENTER)), 10);
}
return false;
break;
break;
case VRSN: // Prints firmware version
if (record->event.pressed) {
- SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE);
+ send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), MACRO_TIMER);
}
return false;
break;
diablo_key_time[dtime] = diablo_times[0];
}
}
-#endif // TAP_DANCE_ENABLE#endif
+#endif // TAP_DANCE_ENABLE
return false; break;
#endif // UNICODE_ENABLE
}
- return process_record_keymap(keycode, record) && process_record_secrets(keycode, record) && process_record_user_rgb(keycode, record);
+ return process_record_keymap(keycode, record) &&
+#ifdef RGBLIGHT_ENABLE
+ process_record_user_rgb(keycode, record) &&
+#endif // RGBLIGHT_ENABLE
+ process_record_secrets(keycode, record);
}
}
+uint32_t default_layer_state_set_kb(uint32_t state) {
+ return default_layer_state_set_keymap (state);
+}
+
+
// Any custom LED code goes here.
// So far, I only have keyboard specific code,
// So nothing goes here.