Skip to content

Commit

Permalink
Updates to mlego m65 (qmk#20220)
Browse files Browse the repository at this point in the history
Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
  • Loading branch information
3 people authored and Lorenzo Castoldi committed Dec 27, 2023
1 parent 92ceea9 commit 5177a30
Show file tree
Hide file tree
Showing 37 changed files with 816 additions and 1,502 deletions.
21 changes: 0 additions & 21 deletions keyboards/mlego/m65/config.h

This file was deleted.

84 changes: 0 additions & 84 deletions keyboards/mlego/m65/info.json

This file was deleted.

18 changes: 2 additions & 16 deletions keyboards/mlego/m65/keymaps/default/config.h
Original file line number Diff line number Diff line change
@@ -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

Expand Down
94 changes: 14 additions & 80 deletions keyboards/mlego/m65/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
}
1 change: 1 addition & 0 deletions keyboards/mlego/m65/keymaps/default/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ENCODER_MAP_ENABLE = yes
20 changes: 0 additions & 20 deletions keyboards/mlego/m65/keymaps/dk/config.h

This file was deleted.

121 changes: 0 additions & 121 deletions keyboards/mlego/m65/keymaps/dk/keymap.c

This file was deleted.

13 changes: 0 additions & 13 deletions keyboards/mlego/m65/keymaps/dk/readme.md

This file was deleted.

Loading

0 comments on commit 5177a30

Please sign in to comment.