]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - quantum/quantum.c
Added readme.md for custom layout.
[qmk_firmware.git] / quantum / quantum.c
index 09daa4712700dfdf3e3693af792224d2a69af7b9..bc2da510f2f902149a9a1c93e217474b29d559c3 100644 (file)
@@ -15,6 +15,19 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
   return true;
 }
 
+void reset_keyboard(void) {
+  clear_keyboard();
+#ifdef AUDIO_ENABLE
+  stop_all_notes();
+  shutdown_user();
+#endif
+  wait_ms(250);
+#ifdef CATERINA_BOOTLOADER
+  *(uint16_t *)0x0800 = 0x7777; // these two are a-star-specific
+#endif
+  bootloader_jump();
+}
+
 // Shift / paren setup
 
 #ifndef LSPO_KEY
@@ -83,16 +96,7 @@ bool process_record_quantum(keyrecord_t *record) {
   switch(keycode) {
     case RESET:
       if (record->event.pressed) {
-        clear_keyboard();
-        #ifdef AUDIO_ENABLE
-          stop_all_notes();
-          shutdown_user();
-        #endif
-        wait_ms(250);
-        #ifdef CATERINA_BOOTLOADER
-            *(uint16_t *)0x0800 = 0x7777; // these two are a-star-specific
-        #endif
-        bootloader_jump();
+        reset_keyboard();
       }
          return false;
       break;
@@ -212,6 +216,12 @@ bool process_record_quantum(keyrecord_t *record) {
         register_mods(MOD_BIT(KC_LSFT));
       }
       else {
+        #ifdef DISABLE_SPACE_CADET_ROLLOVER
+          if (get_mods() & MOD_BIT(KC_RSFT)) {
+            shift_interrupted[0] = true;
+            shift_interrupted[1] = true;
+          }
+        #endif
         if (!shift_interrupted[0]) {
           register_code(LSPO_KEY);
           unregister_code(LSPO_KEY);
@@ -228,6 +238,12 @@ bool process_record_quantum(keyrecord_t *record) {
         register_mods(MOD_BIT(KC_RSFT));
       }
       else {
+        #ifdef DISABLE_SPACE_CADET_ROLLOVER
+          if (get_mods() & MOD_BIT(KC_LSFT)) {
+            shift_interrupted[0] = true;
+            shift_interrupted[1] = true;
+          }
+        #endif
         if (!shift_interrupted[1]) {
           register_code(RSPC_KEY);
           unregister_code(RSPC_KEY);