]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - quantum/keymap_common.c
Added Swiss-German keymap. (#335)
[qmk_firmware.git] / quantum / keymap_common.c
index 4b4bd62109b3243e7d62ff7bc7cff4bc4b1c3ab7..2aae13e67908dc0b8710e5f5bcae2ae6267aea7c 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>
@@ -247,7 +251,7 @@ static action_t keycode_to_action(uint16_t keycode)
             }
             eeconfig_update_keymap(keymap_config.raw);
             break;
-        case 0x5100 ... 0x5FFF: ;
+        case 0x5100 ... 0x56FF: ;
             // Layer movement shortcuts
             // See .h to see constraints/usage
             int type = (keycode >> 0x8) & 0xF;
@@ -268,13 +272,16 @@ 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
-        case 0x6000 ... 0x6FFF:
-            action.code =  ACTION_FUNCTION_OPT(keycode & 0xFF, (keycode & 0x0F00) >> 8);
-            break;
-    #endif
         case 0x7000 ... 0x7FFF:
             action.code = ACTION_MODS_TAP_KEY((keycode >> 0x8) & 0xF, keycode & 0xFF);
             break;