summaryrefslogtreecommitdiff
path: root/keyboards/mwstudio/mmk_3/keymaps
diff options
context:
space:
mode:
authorTW59420 <40019210+TW59420@users.noreply.github.com>2023-12-12 11:21:09 +0800
committerGitHub <noreply@github.com>2023-12-11 19:21:09 -0800
commitc4a2bea0e6aac51b8c0806f31614383e267eb1d7 (patch)
tree48144d24de5d532472e4d3b2d9d34d044a9f8708 /keyboards/mwstudio/mmk_3/keymaps
parentae6f6c3365452bfa27b451b9ca981d6a4c93c1c2 (diff)
[Keyboard] add mmk_3 (#22569)
Co-authored-by: jack <0x6a73@protonmail.com> Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Joel Challis <git@zvecr.com>
Diffstat (limited to 'keyboards/mwstudio/mmk_3/keymaps')
-rw-r--r--keyboards/mwstudio/mmk_3/keymaps/default/keymap.c26
-rw-r--r--keyboards/mwstudio/mmk_3/keymaps/via/keymap.c47
-rw-r--r--keyboards/mwstudio/mmk_3/keymaps/via/rules.mk2
3 files changed, 75 insertions, 0 deletions
diff --git a/keyboards/mwstudio/mmk_3/keymaps/default/keymap.c b/keyboards/mwstudio/mmk_3/keymaps/default/keymap.c
new file mode 100644
index 0000000000..b4cc8ae315
--- /dev/null
+++ b/keyboards/mwstudio/mmk_3/keymaps/default/keymap.c
@@ -0,0 +1,26 @@
+/* Copyright 2023 TW59420 <https://github.com/TW59420>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include QMK_KEYBOARD_H
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ [0] = LAYOUT(LT(3, KC_LCTL), LT(1, KC_C), LT(2, KC_V)),
+
+ [1] = LAYOUT(RGB_VAD, KC_TRNS, RGB_VAI),
+
+ [2] = LAYOUT(RGB_SAD, RGB_SAI, KC_TRNS),
+
+ [3] = LAYOUT(KC_TRNS, RGB_HUD, RGB_HUI)};
diff --git a/keyboards/mwstudio/mmk_3/keymaps/via/keymap.c b/keyboards/mwstudio/mmk_3/keymaps/via/keymap.c
new file mode 100644
index 0000000000..c48cc10e36
--- /dev/null
+++ b/keyboards/mwstudio/mmk_3/keymaps/via/keymap.c
@@ -0,0 +1,47 @@
+/* Copyright 2023 TW59420 <https://github.com/TW59420>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include QMK_KEYBOARD_H
+
+const rgblight_segment_t PROGMEM my_layer0_dfu[] = RGBLIGHT_LAYER_SEGMENTS({3, 2, HSV_WHITE});
+const rgblight_segment_t PROGMEM my_layer1_val[] = RGBLIGHT_LAYER_SEGMENTS({3, 2, HSV_BLUE});
+const rgblight_segment_t PROGMEM my_layer2_sat[] = RGBLIGHT_LAYER_SEGMENTS({3, 2, HSV_PURPLE});
+const rgblight_segment_t PROGMEM my_layer3_hue[] = RGBLIGHT_LAYER_SEGMENTS({3, 2, HSV_RED});
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ [0] = LAYOUT(LT(3, KC_LCTL), LT(1, KC_C), LT(2, KC_V)),
+
+ [1] = LAYOUT(RGB_VAD, KC_TRNS, RGB_VAI),
+
+ [2] = LAYOUT(RGB_SAD, RGB_SAI, KC_TRNS),
+
+ [3] = LAYOUT(KC_TRNS, RGB_HUD, RGB_HUI)};
+
+const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(my_layer0_dfu, my_layer1_val, my_layer2_sat, my_layer3_hue);
+
+void keyboard_post_init_user(void) {
+ // Enable the LED layers
+ rgblight_layers = my_rgb_layers;
+}
+
+layer_state_t layer_state_set_user(layer_state_t state) {
+ rgblight_set_layer_state(0, layer_state_cmp(state, 0));
+ rgblight_set_layer_state(1, layer_state_cmp(state, 1));
+ rgblight_set_layer_state(2, layer_state_cmp(state, 2));
+ rgblight_set_layer_state(3, layer_state_cmp(state, 3));
+ return state;
+}
diff --git a/keyboards/mwstudio/mmk_3/keymaps/via/rules.mk b/keyboards/mwstudio/mmk_3/keymaps/via/rules.mk
new file mode 100644
index 0000000000..36b7ba9cbc
--- /dev/null
+++ b/keyboards/mwstudio/mmk_3/keymaps/via/rules.mk
@@ -0,0 +1,2 @@
+VIA_ENABLE = yes
+LTO_ENABLE = yes