summaryrefslogtreecommitdiff
path: root/keyboards/mlego/m65/keymaps/default
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/mlego/m65/keymaps/default')
-rw-r--r--keyboards/mlego/m65/keymaps/default/config.h18
-rw-r--r--keyboards/mlego/m65/keymaps/default/keymap.c94
-rw-r--r--keyboards/mlego/m65/keymaps/default/rules.mk1
3 files changed, 17 insertions, 96 deletions
diff --git a/keyboards/mlego/m65/keymaps/default/config.h b/keyboards/mlego/m65/keymaps/default/config.h
index 637c0a8faf..dba9c658ae 100644
--- a/keyboards/mlego/m65/keymaps/default/config.h
+++ b/keyboards/mlego/m65/keymaps/default/config.h
@@ -1,19 +1,5 @@
-/*
-Copyright 2021-2022 Alin M Elena <alinm.elena@gmail.com>
-
-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/>.
-*/
+// Copyright 2020-2023 alin m elena (@alinelena)
+// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
diff --git a/keyboards/mlego/m65/keymaps/default/keymap.c b/keyboards/mlego/m65/keymaps/default/keymap.c
index 00e144e221..d7421f659c 100644
--- a/keyboards/mlego/m65/keymaps/default/keymap.c
+++ b/keyboards/mlego/m65/keymaps/default/keymap.c
@@ -1,19 +1,5 @@
-/*
-Copyright 2021-2022 Alin M Elena <alinm.elena@gmail.com>
-
-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/>.
-*/
+// Copyright 2020-2023 alin m elena (@alinelena)
+// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
@@ -51,69 +37,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
// clang-format on
-bool led_update_user(led_t led_state) {
- // Disable the default LED update code, so that lock LEDs could be reused to show layer status.
- return false;
-}
-
-void matrix_scan_user(void) {
-
- toggle_leds();
-
-}
-
-bool process_record_user(uint16_t keycode, keyrecord_t* record) {
- switch (keycode) {
- case (TT(_LWR)):
- if (!record->event.pressed && record->tap.count == TAPPING_TOGGLE) {
- // This runs before the TT() handler toggles the layer state, so the current layer state is the opposite of the final one after toggle.
- set_led_toggle(_LWR, !layer_state_is(_LWR));
- }
- return true;
- break;
- case (TT(_RSE)):
- if (record->event.pressed && record->tap.count == TAPPING_TOGGLE) {
- set_led_toggle(_RSE, !layer_state_is(_RSE));
- }
- return true;
- break;
- default:
- return true;
- }
-}
-
-layer_state_t layer_state_set_user(layer_state_t state) {
-
-#ifdef RGBLIGHT_ENABLE
-
- set_rgb_layers(state);
-
+#if defined(ENCODER_MAP_ENABLE)
+const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
+ [_QW] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)},
+#if defined(RGBLIGHT_ENABLE)
+ [_LWR] = {ENCODER_CCW_CW(RGB_HUD, RGB_HUI)},
+ [_RSE] = {ENCODER_CCW_CW(RGB_VAD, RGB_VAI)},
+ [_ADJ] = {ENCODER_CCW_CW(RGB_RMOD, RGB_MOD)},
+# else
+ [_LWR] = {ENCODER_CCW_CW(KC_MNXT, KC_MPRV)},
+ [_RSE] = {ENCODER_CCW_CW(KC_MFFD, KC_MRWD)},
+ [_ADJ] = {ENCODER_CCW_CW(KC_PGDN, KC_PGUP)},
#endif
-
- return update_tri_layer_state(state, _LWR, _RSE, _ADJ);
-}
-
-#ifdef RGBLIGHT_ENABLE
-
-layer_state_t default_layer_state_set_user(layer_state_t state) {
- set_default_rgb_layers(state);
- return state;
-}
-
-#endif
-
-void keyboard_post_init_user(void) {
-
-#ifdef RGBLIGHT_ENABLE
-
- // Enable the LED layers
- rgblight_layers = my_rgb();
-
-#endif
-
-#ifdef OLED_ENABLE
-
- init_timer();
-
+};
#endif
-}
diff --git a/keyboards/mlego/m65/keymaps/default/rules.mk b/keyboards/mlego/m65/keymaps/default/rules.mk
new file mode 100644
index 0000000000..ee32568148
--- /dev/null
+++ b/keyboards/mlego/m65/keymaps/default/rules.mk
@@ -0,0 +1 @@
+ENCODER_MAP_ENABLE = yes