[Core] Add compile/make macro to core (#15959)
* [Core] Add KC_MAKE keycode to core fix linting fix testing error work around test idiocyncracies fix more lint something something stupid tests add doc * updates based on feedback * Add bad names * Fixup docs * semantics but cleaner Co-authored-by: precondition <[email protected]> * Hide oneshot checks behind preprocessors * Move no-compile option around * Fix formatting * make shift optional * Make opt in * fix formatting * update send string function name Co-authored-by: Joel Challis <[email protected]> Co-authored-by: precondition <[email protected]> Co-authored-by: Joel Challis <[email protected]>
This commit is contained in:
5 files changed
+36
-10
No files matched your search
@@ -357,6 +357,26 @@ bool process_record_quantum(keyrecord_t *record) {
|
||||
case ONESHOT_DISABLE:
|
||||
oneshot_disable();
|
||||
break;
|
||||
#endif
|
||||
#ifdef ENABLE_COMPILE_KEYCODE
|
||||
case QK_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader
|
||||
{
|
||||
# ifdef NO_ACTION_ONESHOT
|
||||
const uint8_t temp_mod = mod_config(get_mods());
|
||||
# else
|
||||
const uint8_t temp_mod = mod_config(get_mods() | get_oneshot_mods());
|
||||
clear_oneshot_mods();
|
||||
# endif
|
||||
clear_mods();
|
||||
|
||||
SEND_STRING_DELAY("qmk", TAP_CODE_DELAY);
|
||||
if (temp_mod & MOD_MASK_SHIFT) { // if shift is held, flash rather than compile
|
||||
SEND_STRING_DELAY(" flash ", TAP_CODE_DELAY);
|
||||
} else {
|
||||
SEND_STRING_DELAY(" compile ", TAP_CODE_DELAY);
|
||||
}
|
||||
SEND_STRING_DELAY("-kb " QMK_KEYBOARD " -km " QMK_KEYMAP SS_TAP(X_ENTER), TAP_CODE_DELAY);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user