summaryrefslogtreecommitdiff
path: root/keyboards/mlego/m65/keymaps/default/keymap.c
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2023-11-28 16:39:48 +1100
committerNick Brassel <nick@tzarc.org>2023-11-28 16:40:47 +1100
commit0115951de12bd4c798a43a380651c34552552e85 (patch)
tree62999011ae782d93aa6dc9c889615db2a840cafc /keyboards/mlego/m65/keymaps/default/keymap.c
parent0379d1f59e58cefa18cdb72ba1b77507d1108ae6 (diff)
parent4d99e0a23cff02f4c6e55e093b5de08a9be0df7c (diff)
`develop` -> `master`, 2023q4 edition
Diffstat (limited to 'keyboards/mlego/m65/keymaps/default/keymap.c')
-rw-r--r--keyboards/mlego/m65/keymaps/default/keymap.c94
1 files changed, 14 insertions, 80 deletions
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
-}