- case KC_MAKE:
- if (!record->event.pressed) {
- SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP
-#if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU))
- ":dfu "
-#elif defined(BOOTLOADER_HALFKAY)
- ":teensy "
-#elif defined(BOOTLOADER_CATERINA)
- ":avrdude "
-#endif
- SS_TAP(X_ENTER));
- }
- return false;
- break;
+ case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader
+ if (!record->event.pressed) {
+ uint8_t temp_mod = get_mods();
+ uint8_t temp_osm = get_oneshot_mods();
+ clear_mods(); clear_oneshot_mods();
+ SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP);
+ #ifndef FLASH_BOOTLOADER
+ if ( (temp_mod | temp_osm) & MOD_MASK_SHIFT )
+ #endif
+ { //
+ #if defined(__arm__) // only run for ARM boards
+ SEND_STRING(":dfu-util");
+ #elif defined(BOOTLOADER_DFU) // only run for DFU boards
+ SEND_STRING(":dfu");
+ #elif defined(BOOTLOADER_HALFKAY) // only run for teensy boards
+ SEND_STRING(":teensy");
+ #elif defined(BOOTLOADER_CATERINA) // only run for Pro Micros
+ SEND_STRING(":avrdude");
+ #endif // bootloader options
+ }
+ if ( (temp_mod | temp_osm) & MOD_MASK_CTRL) {
+ SEND_STRING(" -j8 --output-sync");
+ }
+ SEND_STRING(SS_TAP(X_ENTER));
+ set_mods(temp_mod);
+ }
+ break;
+