]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - quantum/keymap_common.c
Adds next tab/prev tab back to symb layer and updates legend
[qmk_firmware.git] / quantum / keymap_common.c
index 43debf4ef62869d608627d09a42d003b0a386543..8f00f9cc32226ec1cff4acf986d64a168ae8ab2c 100644 (file)
@@ -24,10 +24,14 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "action_macro.h"
 #include "debug.h"
 #include "backlight.h"
-#include "keymap_midi.h"
 #include "bootloader.h"
 #include "eeconfig.h"
 
+#ifdef MIDI_ENABLE
+       #include "keymap_midi.h"
+#endif
+
+
 extern keymap_config_t keymap_config;
 
 #include <stdio.h>
@@ -245,7 +249,7 @@ static action_t keycode_to_action(uint16_t keycode)
                 keymap_config.swap_lalt_lgui = 0;
                 keymap_config.swap_ralt_rgui = 0;
             }
-            eeconfig_write_keymap(keymap_config.raw);
+            eeconfig_update_keymap(keymap_config.raw);
             break;
         case 0x5100 ... 0x5FFF: ;
             // Layer movement shortcuts
@@ -268,6 +272,14 @@ static action_t keycode_to_action(uint16_t keycode)
                 // Set default layer
                 int layer = keycode & 0xFF;
                 action.code = ACTION_LAYER_TOGGLE(layer);
+            } else if (type == 0x5) {
+                // OSL(layer) - One-shot layer
+                int layer = keycode & 0xFF;
+                action.code = ACTION_LAYER_ONESHOT(layer);
+            } else if (type == 0x6) {
+                // OSM(mod) - One-shot mod
+                int mod = keycode & 0xFF;
+                action.code = ACTION_MODS_ONESHOT(mod);
             }
             break;
     #ifdef MIDI_ENABLE