From 0ae97850a2d1439bca59a3fd6740f750d9f13107 Mon Sep 17 00:00:00 2001 From: jonylee1986 <2532487686@qq.com> Date: Mon, 24 Apr 2023 16:09:16 +0800 Subject: [PATCH 01/37] Add keybord monsgeek m3. --- keyboards/monsgeek/m3/config.h | 119 +++ keyboards/monsgeek/m3/halconf.h | 23 + keyboards/monsgeek/m3/info.json | 125 +++ .../monsgeek/m3/keymaps/default/keymap.c | 79 ++ keyboards/monsgeek/m3/keymaps/via/keymap.c | 79 ++ keyboards/monsgeek/m3/keymaps/via/rules.mk | 2 + keyboards/monsgeek/m3/m3.c | 725 ++++++++++++++++++ keyboards/monsgeek/m3/mcuconf.h | 24 + keyboards/monsgeek/m3/rgb_matrix_kb.inc | 51 ++ keyboards/monsgeek/m3/rules.mk | 8 + 10 files changed, 1235 insertions(+) create mode 100644 keyboards/monsgeek/m3/config.h create mode 100644 keyboards/monsgeek/m3/halconf.h create mode 100644 keyboards/monsgeek/m3/info.json create mode 100644 keyboards/monsgeek/m3/keymaps/default/keymap.c create mode 100644 keyboards/monsgeek/m3/keymaps/via/keymap.c create mode 100644 keyboards/monsgeek/m3/keymaps/via/rules.mk create mode 100644 keyboards/monsgeek/m3/m3.c create mode 100644 keyboards/monsgeek/m3/mcuconf.h create mode 100644 keyboards/monsgeek/m3/rgb_matrix_kb.inc create mode 100644 keyboards/monsgeek/m3/rules.mk diff --git a/keyboards/monsgeek/m3/config.h b/keyboards/monsgeek/m3/config.h new file mode 100644 index 000000000000..ef9931698a8f --- /dev/null +++ b/keyboards/monsgeek/m3/config.h @@ -0,0 +1,119 @@ +/* Copyright (C) 2022 jonylee@hfd + * + * 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 . + */ + +#pragma once + +/* Use 5 dynamic keymap layers */ +#define DYNAMIC_KEYMAP_LAYER_COUNT 6 + +#define RGB_TRIGGER_ON_KEYDOWN +/* Force NKRO on boot up regardless of the setting saved in the EEPROM (uncomment to enable it) */ + #define FORCE_NKRO + +/* LED Indicators */ +#define LED_CAPS_LOCK_PIN A15 +// #define LED_NUM_LOCK_PIN C10 +// #define LED_SCROLL_LOCK_PIN C11 +#define LED_MAC_OS_PIN C10 +#define LED_WIN_LOCK_PIN C11 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* SPI Config for spi flash*/ +#define SPI_DRIVER SPIDQ +#define SPI_SCK_PIN B3 +#define SPI_MOSI_PIN B5 +#define SPI_MISO_PIN B4 +#define SPI_MOSI_PAL_MODE 5 + +#define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN C12 +#define WEAR_LEVELING_BACKING_SIZE (8 * 1024) + +/* I2C Config for LED Driver */ +#define DRIVER_COUNT 2 +#define DRIVER_ADDR_1 0b1110100 +#define DRIVER_ADDR_2 0b1110111 +#define I2C1_SDA_PIN B7 +#define I2C1_SCL_PIN B6 +#define I2C1_SCL_PAL_MODE 4 +#define I2C1_OPMODE OPMODE_I2C +#define I2C1_CLOCK_SPEED 400000 /* 400000 */ + +#define RGB_MATRIX_LED_COUNT 87 + +#define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended +#define RGB_MATRIX_CENTER {112,32} + +#define RGB_MATRIX_FRAMEBUFFER_EFFECTS +#define RGB_MATRIX_KEYPRESSES +#define RGB_MATRIX_KEYRELEASES + +// RGB Matrix Animation modes. Explicitly enabled +// For full list of effects, see: +// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects +// #define ENABLE_RGB_MATRIX_ALPHAS_MODS +// #define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN +// #define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_SOLID_COLOR // Static single hue, no speed support +#define ENABLE_RGB_MATRIX_BREATHING +// #define ENABLE_RGB_MATRIX_BAND_SAT +// #define ENABLE_RGB_MATRIX_BAND_VAL +// #define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +// #define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +// #define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT +// #define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL +#define ENABLE_RGB_MATRIX_CYCLE_ALL +#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN +#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL +#define ENABLE_RGB_MATRIX_DUAL_BEACON +#define ENABLE_RGB_MATRIX_RAINBOW_BEACON +// #define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS +#define ENABLE_RGB_MATRIX_RAINDROPS +// #define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +// #define ENABLE_RGB_MATRIX_HUE_BREATHING +// #define ENABLE_RGB_MATRIX_HUE_PENDULUM +// #define ENABLE_RGB_MATRIX_HUE_WAVE +// #define ENABLE_RGB_MATRIX_PIXEL_RAIN +// #define ENABLE_RGB_MATRIX_PIXEL_FLOW +// #define ENABLE_RGB_MATRIX_PIXEL_FRACTAL +// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined +#define ENABLE_RGB_MATRIX_TYPING_HEATMAP +//#define ENABLE_RGB_MATRIX_DIGITAL_RAIN +// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE +//#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +//#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +//#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +//#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +//#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +//#define ENABLE_RGB_MATRIX_SPLASH +#define ENABLE_RGB_MATRIX_MULTISPLASH +//#define ENABLE_RGB_MATRIX_SOLID_SPLASH +//#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH + +#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 160 /* The maximum brightness level */ + + diff --git a/keyboards/monsgeek/m3/halconf.h b/keyboards/monsgeek/m3/halconf.h new file mode 100644 index 000000000000..2f64e65393a5 --- /dev/null +++ b/keyboards/monsgeek/m3/halconf.h @@ -0,0 +1,23 @@ +/* Copyright (C) 2022 jonylee@hfd + * + * 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 . + */ +#pragma once + +#define HAL_USE_I2C TRUE +#define HAL_USE_SPI TRUE +#define SPI_USE_WAIT TRUE +#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD + +#include_next diff --git a/keyboards/monsgeek/m3/info.json b/keyboards/monsgeek/m3/info.json new file mode 100644 index 000000000000..febaa12f732c --- /dev/null +++ b/keyboards/monsgeek/m3/info.json @@ -0,0 +1,125 @@ +{ + "keyboard_name": "MonsGeek Keyboard", + "manufacturer": "MonsGeek", + "maintainer": "jonylee@hfd", + "usb": { + "vid": "0xFFFE", + "pid": "0x0009", + "device_version": "1.0.5" + }, + "processor": "WB32FQ95", + "bootloader": "wb32-dfu", + "features": { + "bootmagic": true, + "mousekey": false, + "extrakey": true, + "console": false, + "command": false, + "nkro": true, + "encoder": false, + "rgb_matrix": true + }, + "matrix_pins": { + "cols": ["C1","C2","C3","A0","A1","A2","A3","A4","A5","A6","A7","C4","C5","B0","B1","B2","B10"], + "rows": ["B15", "C6", "C7", "C8", "C9", "A8"] + }, + "diode_direction": "ROW2COL", + "layouts": { + "LAYOUT": { + "layout": [ + { "label": "Esc", "matrix": [0, 0], "x": 0, "y": 0 }, + { "label": "F1", "matrix": [0, 1], "x": 2, "y": 0 }, + { "label": "F2", "matrix": [0, 2], "x": 3, "y": 0 }, + { "label": "F3", "matrix": [0, 3], "x": 4, "y": 0 }, + { "label": "F4", "matrix": [0, 4], "x": 5, "y": 0 }, + { "label": "F5", "matrix": [0, 5], "x": 6.5, "y": 0 }, + { "label": "F6", "matrix": [0, 6], "x": 7.5, "y": 0 }, + { "label": "F7", "matrix": [0, 7], "x": 8.5, "y": 0 }, + { "label": "F8", "matrix": [0, 8], "x": 9.5, "y": 0 }, + { "label": "F9", "matrix": [0, 9], "x": 11, "y": 0 }, + { "label": "F10", "matrix": [0, 10], "x": 12, "y": 0 }, + { "label": "F11", "matrix": [0, 11], "x": 13, "y": 0 }, + { "label": "F12", "matrix": [0, 12], "x": 14, "y": 0 }, + { "label": "PrtSc", "matrix": [0, 14], "x": 15.25, "y": 0 }, + { "label": "ScrLk", "matrix": [0, 15], "x": 16.25, "y": 0 }, + { "label": "Pause", "matrix": [0, 16], "x": 17.25, "y": 0 }, + + { "label": "~", "matrix": [1, 0], "x": 0, "y": 1.25 }, + { "label": "!", "matrix": [1, 1], "x": 1, "y": 1.25 }, + { "label": "@", "matrix": [1, 2], "x": 2, "y": 1.25 }, + { "label": "#", "matrix": [1, 3], "x": 3, "y": 1.25 }, + { "label": "$", "matrix": [1, 4], "x": 4, "y": 1.25 }, + { "label": "%", "matrix": [1, 5], "x": 5, "y": 1.25 }, + { "label": "^", "matrix": [1, 6], "x": 6, "y": 1.25 }, + { "label": "&", "matrix": [1, 7], "x": 7, "y": 1.25 }, + { "label": "*", "matrix": [1, 8], "x": 8, "y": 1.25 }, + { "label": "(", "matrix": [1, 9], "x": 9, "y": 1.25 }, + { "label": ")", "matrix": [1, 10], "x": 10, "y": 1.25 }, + { "label": "_", "matrix": [1, 11], "x": 11, "y": 1.25 }, + { "label": "+", "matrix": [1, 12], "x": 12, "y": 1.25 }, + { "label": "Backspace", "matrix": [1, 13], "x": 13, "y": 1.25, "w": 2 }, + { "label": "Ins", "matrix": [1, 14], "x": 15.25, "y": 1.25 }, + { "label": "Home", "matrix": [1, 15], "x": 16.25, "y": 1.25 }, + { "label": "PgUp", "matrix": [1, 16], "x": 17.25, "y": 1.25 }, + + { "label": "Tab", "matrix": [2, 0], "x": 0, "y": 2.25, "w": 1.5 }, + { "label": "Q", "matrix": [2, 1], "x": 1.5, "y": 2.25 }, + { "label": "W", "matrix": [2, 2], "x": 2.5, "y": 2.25 }, + { "label": "E", "matrix": [2, 3], "x": 3.5, "y": 2.25 }, + { "label": "R", "matrix": [2, 4], "x": 4.5, "y": 2.25 }, + { "label": "T", "matrix": [2, 5], "x": 5.5, "y": 2.25 }, + { "label": "Y", "matrix": [2, 6], "x": 6.5, "y": 2.25 }, + { "label": "U", "matrix": [2, 7], "x": 7.5, "y": 2.25 }, + { "label": "I", "matrix": [2, 8], "x": 8.5, "y": 2.25 }, + { "label": "O", "matrix": [2, 9], "x": 9.5, "y": 2.25 }, + { "label": "P", "matrix": [2, 10], "x": 10.5, "y": 2.25 }, + { "label": "{", "matrix": [2, 11], "x": 11.5, "y": 2.25 }, + { "label": "}", "matrix": [2, 12], "x": 12.5, "y": 2.25 }, + { "label": "|", "matrix": [2, 13], "x": 13.5, "y": 2.25, "w": 1.5 }, + { "label": "Del", "matrix": [2, 14], "x": 15.25, "y": 2.25 }, + { "label": "End", "matrix": [2, 15], "x": 16.25, "y": 2.25 }, + { "label": "PgDn", "matrix": [2, 16], "x": 17.25, "y": 2.25 }, + + { "label": "Caps Lock", "matrix": [3, 0], "x": 0, "y": 3.25, "w": 1.75 }, + { "label": "A", "matrix": [3, 1], "x": 1.75, "y": 3.25 }, + { "label": "S", "matrix": [3, 2], "x": 2.75, "y": 3.25 }, + { "label": "D", "matrix": [3, 3], "x": 3.75, "y": 3.25 }, + { "label": "F", "matrix": [3, 4], "x": 4.75, "y": 3.25 }, + { "label": "G", "matrix": [3, 5], "x": 5.75, "y": 3.25 }, + { "label": "H", "matrix": [3, 6], "x": 6.75, "y": 3.25 }, + { "label": "J", "matrix": [3, 7], "x": 7.75, "y": 3.25 }, + { "label": "K", "matrix": [3, 8], "x": 8.75, "y": 3.25 }, + { "label": "L", "matrix": [3, 9], "x": 9.75, "y": 3.25 }, + { "label": ":", "matrix": [3, 10], "x": 10.75, "y": 3.25 }, + { "label": "'", "matrix": [3, 11], "x": 11.75, "y": 3.25 }, + { "label": "Enter", "matrix": [3, 13], "x": 12.75, "y": 3.25, "w": 2.25 }, + + { "label": "Shift", "matrix": [4, 0], "x": 0, "y": 4.25, "w": 2.25 }, + { "label": "Z", "matrix": [4, 1], "x": 2.25, "y": 4.25 }, + { "label": "X", "matrix": [4, 2], "x": 3.25, "y": 4.25 }, + { "label": "C", "matrix": [4, 3], "x": 4.25, "y": 4.25 }, + { "label": "V", "matrix": [4, 4], "x": 5.25, "y": 4.25 }, + { "label": "B", "matrix": [4, 5], "x": 6.25, "y": 4.25 }, + { "label": "N", "matrix": [4, 6], "x": 7.25, "y": 4.25 }, + { "label": "M", "matrix": [4, 7], "x": 8.25, "y": 4.25 }, + { "label": "<", "matrix": [4, 8], "x": 9.25, "y": 4.25 }, + { "label": ">", "matrix": [4, 9], "x": 10.25, "y": 4.25 }, + { "label": "?", "matrix": [4, 10], "x": 11.25, "y": 4.25 }, + { "label": "Shift", "matrix": [4, 13], "x": 12.25, "y": 4.25, "w": 2.75 }, + { "label": "Up", "matrix": [4, 15], "x": 16.25, "y": 4.25 }, + + { "label": "Ctrl", "matrix": [5, 0], "x": 0, "y": 5.25, "w": 1.25 }, + { "label": "Win", "matrix": [5, 1], "x": 1.25, "y": 5.25, "w": 1.25 }, + { "label": "Alt", "matrix": [5, 2], "x": 2.5, "y": 5.25, "w": 1.25 }, + { "label": "Space", "matrix": [5, 5], "x": 3.75, "y": 5.25, "w": 6.25 }, + { "label": "Alt", "matrix": [5, 9], "x": 10, "y": 5.25, "w": 1.25 }, + { "label": "Win", "matrix": [5, 10], "x": 11.25, "y": 5.25, "w": 1.25 }, + { "label": "Fn", "matrix": [5, 11], "x": 12.5, "y": 5.25, "w": 1.25 }, + { "label": "Ctrl", "matrix": [5, 13], "x": 13.75, "y": 5.25, "w": 1.25 }, + { "label": "Left", "matrix": [5, 14], "x": 15.25, "y": 5.25 }, + { "label": "Down", "matrix": [5, 15], "x": 16.25, "y": 5.25 }, + { "label": "Right", "matrix": [5, 16], "x": 17.25, "y": 5.25 } + ] + } + } +} diff --git a/keyboards/monsgeek/m3/keymaps/default/keymap.c b/keyboards/monsgeek/m3/keymaps/default/keymap.c new file mode 100644 index 000000000000..23e1d69f3f04 --- /dev/null +++ b/keyboards/monsgeek/m3/keymaps/default/keymap.c @@ -0,0 +1,79 @@ +/* Copyright (C) 2022 jonylee@hfd + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +enum __layers { + WIN_B, + WIN_W, + WIN_FN, + MAC_B, + MAC_W, + MAC_FN +}; + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [WIN_B] = LAYOUT( /* Base */ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(WIN_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_W] = LAYOUT( /* Base */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_W, + _______, _______, _______, _______, _______, _______, MO(WIN_FN), _______, KC_A, KC_S, KC_D), + + + [WIN_FN] = LAYOUT( /* FN */ + _______, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_MSEL, KC_MPLY, KC_MPRV, KC_MNXT, _______,_______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, _______, _______, _______, + _______, _______,TG(WIN_W),_______, _______, _______, _______, _______, _______, DF(MAC_B),_______,_______, _______, RGB_MOD, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, _______, _______, RGB_HUI, + _______, _______, _______, KC_CALC, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_VAI, + _______, GU_TOGG, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_VAD, RGB_SAI), + + [MAC_B] = LAYOUT( /* Base */ + KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, KC_F5, KC_F6, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_SCRL, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, MO(MAC_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [MAC_W] = LAYOUT( /* Base */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_W, + _______, _______, _______, _______, _______, _______, MO(MAC_FN), _______, KC_A, KC_S, KC_D), + [MAC_FN] = LAYOUT( /* FN */ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, _______, _______, _______, + _______, _______,TG(MAC_W),_______, _______, _______, _______, _______, _______, DF(WIN_B),_______,_______, _______, RGB_MOD, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, _______, _______, RGB_HUI, + _______, _______, _______, KC_CALC, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_VAI, + _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_VAD, RGB_SAI) +}; +// clang-format on diff --git a/keyboards/monsgeek/m3/keymaps/via/keymap.c b/keyboards/monsgeek/m3/keymaps/via/keymap.c new file mode 100644 index 000000000000..23e1d69f3f04 --- /dev/null +++ b/keyboards/monsgeek/m3/keymaps/via/keymap.c @@ -0,0 +1,79 @@ +/* Copyright (C) 2022 jonylee@hfd + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +enum __layers { + WIN_B, + WIN_W, + WIN_FN, + MAC_B, + MAC_W, + MAC_FN +}; + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [WIN_B] = LAYOUT( /* Base */ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(WIN_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_W] = LAYOUT( /* Base */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_W, + _______, _______, _______, _______, _______, _______, MO(WIN_FN), _______, KC_A, KC_S, KC_D), + + + [WIN_FN] = LAYOUT( /* FN */ + _______, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_MSEL, KC_MPLY, KC_MPRV, KC_MNXT, _______,_______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, _______, _______, _______, + _______, _______,TG(WIN_W),_______, _______, _______, _______, _______, _______, DF(MAC_B),_______,_______, _______, RGB_MOD, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, _______, _______, RGB_HUI, + _______, _______, _______, KC_CALC, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_VAI, + _______, GU_TOGG, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_VAD, RGB_SAI), + + [MAC_B] = LAYOUT( /* Base */ + KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, KC_F5, KC_F6, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_SCRL, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, MO(MAC_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [MAC_W] = LAYOUT( /* Base */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_W, + _______, _______, _______, _______, _______, _______, MO(MAC_FN), _______, KC_A, KC_S, KC_D), + [MAC_FN] = LAYOUT( /* FN */ + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, _______, _______, _______, + _______, _______,TG(MAC_W),_______, _______, _______, _______, _______, _______, DF(WIN_B),_______,_______, _______, RGB_MOD, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, _______, _______, RGB_HUI, + _______, _______, _______, KC_CALC, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_VAI, + _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_VAD, RGB_SAI) +}; +// clang-format on diff --git a/keyboards/monsgeek/m3/keymaps/via/rules.mk b/keyboards/monsgeek/m3/keymaps/via/rules.mk new file mode 100644 index 000000000000..edf9bd87ead3 --- /dev/null +++ b/keyboards/monsgeek/m3/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +ENCODER_MAP_ENABLE = no \ No newline at end of file diff --git a/keyboards/monsgeek/m3/m3.c b/keyboards/monsgeek/m3/m3.c new file mode 100644 index 000000000000..47f40de694a1 --- /dev/null +++ b/keyboards/monsgeek/m3/m3.c @@ -0,0 +1,725 @@ +/* Copyright (C) 2022 jonylee@hfd + * + * 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 . + */ + +#include "quantum.h" + +static uint16_t map_current_time = 0; +static bool pwron_flag = false; + +// clang-format off +#ifdef RGB_MATRIX_ENABLE +const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + /*row0*/ + {1, A_1, B_1, C_1}, + {1, A_2, B_2, C_2}, + {1, A_3, B_3, C_3}, + {1, A_4, B_4, C_4}, + {1, A_5, B_5, C_5}, + {1, A_6, B_6, C_6}, + {1, A_7, B_7, C_7}, + {1, A_8, B_8, C_8}, + {1, A_9, B_9, C_9}, + {1, A_10, B_10, C_10}, + {1, A_11, B_11, C_11}, + {1, A_12, B_12, C_12}, + {1, A_13, B_13, C_13}, + {1, A_14, B_14, C_14}, + {1, A_15, B_15, C_15}, + {1, A_16, B_16, C_16}, + + /*row1*/ + {0, A_1, B_1, C_1}, + {0, A_2, B_2, C_2}, + {0, A_3, B_3, C_3}, + {0, A_4, B_4, C_4}, + {0, A_5, B_5, C_5}, + {0, A_6, B_6, C_6}, + {0, A_7, B_7, C_7}, + {0, A_8, B_8, C_8}, + {0, A_9, B_9, C_9}, + {0, A_10, B_10, C_10}, + {0, A_11, B_11, C_11}, + {0, A_12, B_12, C_12}, + {0, A_13, B_13, C_13}, + {0, A_14, B_14, C_14}, + {1, D_1, E_1, F_1}, + {1, D_2, E_2, F_2}, + {1, D_3, E_3, F_3}, + + /*row2*/ + {0, D_1, E_1, F_1}, + {0, D_2, E_2, F_2}, + {0, D_3, E_3, F_3}, + {0, D_4, E_4, F_4}, + {0, D_5, E_5, F_5}, + {0, D_6, E_6, F_6}, + {0, D_7, E_7, F_7}, + {0, D_8, E_8, F_8}, + {0, D_9, E_9, F_9}, + {0, D_10, E_10, F_10}, + {0, D_11, E_11, F_11}, + {0, D_12, E_12, F_12}, + {0, D_13, E_13, F_13}, + {0, D_14, E_14, F_14}, + {1, G_1, H_1, I_1}, + {1, G_2, H_2, I_2}, + {1, G_3, H_3, I_3}, + + /*row3*/ + {0, G_1, H_1, I_1}, + {0, G_2, H_2, I_2}, + {0, G_3, H_3, I_3}, + {0, G_4, H_4, I_4}, + {0, G_5, H_5, I_5}, + {0, G_6, H_6, I_6}, + {0, G_7, H_7, I_7}, + {0, G_8, H_8, I_8}, + {0, G_9, H_9, I_9}, + {0, G_10, H_10, I_10}, + {0, G_11, H_11, I_11}, + {0, G_12, H_12, I_12}, + {0, G_13, H_13, I_13}, + + /*row4*/ + {0, J_1, K_1, L_1}, + {0, J_2, K_2, L_2}, + {0, J_3, K_3, L_3}, + {0, J_4, K_4, L_4}, + {0, J_5, K_5, L_5}, + {0, J_6, K_6, L_6}, + {0, J_7, K_7, L_7}, + {0, J_8, K_8, L_8}, + {0, J_9, K_9, L_9}, + {0, J_10, K_10, L_10}, + {0, J_11, K_11, L_11}, + {0, J_12, K_12, L_12}, + {1, J_4, K_4, L_4}, + + /*row5*/ + {0, J_13, K_13, L_13}, + {0, J_14, K_14, L_14}, + {0, J_15, K_15, L_15}, + {0, J_16, K_16, L_16}, + {0, G_14, H_14, I_14}, + {0, G_15, H_15, I_15}, + {0, G_16, H_16, I_16}, + {0, D_15, E_15, F_15}, + {1, J_1, K_1, L_1}, + {1, J_2, K_2, L_2}, + {1, J_3, K_3, L_3}, +}; + +led_config_t g_led_config = { + { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, NO_LED, 13, 14, 15}, + { 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32}, + { 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49}, + { 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, NO_LED, 62, NO_LED, NO_LED, NO_LED}, + { 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, NO_LED, NO_LED, 74, NO_LED, 75, NO_LED}, + { 76, 77, 78, NO_LED, NO_LED, 79, NO_LED, NO_LED, NO_LED, 80, 81, 82, NO_LED, 83, 84, 85, 86}, + }, + { + //ROW0 + {0, 0 }, //0 + + {24, 0 }, //1 + {38, 0 }, //2 + {52, 0 }, //3 + {66, 0 }, //4 + + {82, 0 }, //5 + {96, 0 }, //6 + {110, 0 }, //7 + {124, 0 }, //8 + + {140, 0 }, //9 + {154, 0 }, //10 + {168, 0 }, //11 + {182, 0 }, //12 + {196, 0 }, //13 + {210, 0 }, //14 + {224, 0 }, //15 + + // ROW1 + {0, 12}, // 16 + {13, 12}, // 17 + {26, 12}, // 18 + {39, 12}, // 19 + {52, 12}, // 20 + {65, 12}, // 21 + {79, 12}, // 22 + {92, 12}, // 23 + {105, 12}, // 24 + {118, 12}, // 25 + {131, 12}, // 26 + {144, 12}, // 27 + {158, 12}, // 28 + {171, 12}, // 29 + {184, 12}, // 30 + {197, 12}, // 31 + {210, 12}, // 32 + + //ROW2 + {0, 26 }, //33 + {14, 26 }, //34 + {28, 26 }, //35 + {42, 26 }, //36 + {56, 26 }, //37 + {70, 26 }, //38 + {84, 26 }, //39 + {98, 26 }, //40 + {112, 26 }, //41 + {126, 26 }, //42 + {140, 26 }, //43 + {154, 26 }, //44 + {168, 26 }, //45 + {182, 26 }, //46 + {196, 26 }, //47 + {210, 26 }, //48 + {224, 26 }, //49 + + + //ROW3 + {0, 38 }, //50 + {14, 38 }, //51 + {28, 38 }, //52 + {42, 38 }, //53 + {56, 38 }, //54 + {70, 38 }, //55 + {84, 38 }, //56 + {98, 38 }, //57 + {112, 38 }, //58 + {126, 38 }, //59 + {140, 38 }, //60 + {154, 38 }, //61 + + {182, 38 }, //62 + + + + //ROW4 + {0, 51 }, //63 + {14, 51 }, //64 + {28, 51 }, //65 + {42, 51 }, //66 + {56, 51 }, //67 + {70, 51 }, //68 + {84, 51 }, //69 + {98, 51 }, //70 + {112, 51 }, //71 + {126, 51 }, //72 + {140, 51 }, //73 + + + {182, 51 }, //74 + + {210, 51 }, //75 + + + + //ROW5 + {0, 64 }, //76 + {14, 64 }, //77 + {28, 64 }, //78 + + {70, 64 }, //79 + + {126, 64 }, //80 + {140, 64 }, //81 + {154, 64 }, //82 + + {182, 64 }, //83 + {196, 64 }, //84 + {210, 64 }, //85 + {224, 64 }, //86 + + + }, + { + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + } +}; + +// clang-format on +bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) { + if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) { + return false; + } + if (pwron_flag == false) { + map_current_time = timer_read(); + if (map_current_time < 3000) { + rgb_matrix_set_color_all(150, 150, 150); + } + if (map_current_time >= 3000) { + pwron_flag = true; + if (!rgb_matrix_get_flags()) { + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_set_color_all(0, 0, 0); + } + } + } + return true; +} + +#endif // RGB_MATRIX_ENABLE + +void led_test(uint8_t color); +void clear_eeprom(void); + +enum __layers { WIN_B, WIN_W, WIN_FN, MAC_B, MAC_W, MAC_FN }; +enum colors { WHITE, RED, GREEN, BLUE }; +enum colors led_color_status = WHITE; + +// clang-format on +typedef union { + uint32_t raw; + struct { + bool MacMode_flag : 1; + bool _WASD_layer_flag : 1; + }; +} user_config_t; + +user_config_t user_config; + +static bool fn_make_flag = false; +static bool Rwin_make_flag = false; +static bool Lwin_make_flag = false; +static bool Lkey_flag = false; +static bool reset_glint_flag = false; +static bool while_test_flag = false; +static bool alarm_flag = false; +static uint16_t current_time = 0; +static uint8_t glint_cnt = 0; +static uint16_t scancode = 0; +static uint8_t alarm_cnt = 0; +static uint8_t RGB_HSV_level; +HSV hsv; + +void keyboard_post_init_user(void) { + user_config.raw = eeconfig_read_user(); // Read status from EEPROM + if (user_config.MacMode_flag) layer_on(MAC_B); + if (user_config._WASD_layer_flag) { + user_config.MacMode_flag ? layer_on(MAC_W) : layer_on(WIN_W); + } +} + +void led_init_ports(void) { + // set our LED pings as output + setPinOutput(LED_CAPS_LOCK_PIN); // LED1 Num Lock + writePinLow(LED_CAPS_LOCK_PIN); + setPinOutput(LED_MAC_OS_PIN); // LDE2 MAC\WIN + writePinLow(LED_MAC_OS_PIN); + setPinOutput(LED_WIN_LOCK_PIN); // LED3 Win Lock + writePinLow(LED_WIN_LOCK_PIN); +} + +bool led_update_kb(led_t led_state) { + bool res = led_update_user(led_state); + if (res) { + writePin(LED_CAPS_LOCK_PIN, led_state.caps_lock); + writePin(LED_MAC_OS_PIN, user_config.MacMode_flag); + writePin(LED_WIN_LOCK_PIN, keymap_config.no_gui); + } + return res; +} + +bool process_record_kb(uint16_t keycode, keyrecord_t* record) { + if (!process_record_user(keycode, record)) { + return false; + } + switch (keycode) { + case MO(WIN_FN): + case MO(MAC_FN): + fn_make_flag = record->event.pressed; + return true; + case KC_RGUI: + if (user_config.MacMode_flag) { + return true; + } + Rwin_make_flag = false; + if (record->event.pressed) { + if (Lwin_make_flag) { + Lkey_flag = true; + current_time = timer_read(); + scancode = KC_LGUI; + return false; + } else { + Rwin_make_flag = true; + } + } else { + Lkey_flag = 0; + } + return true; + case KC_LGUI: + if (user_config.MacMode_flag) { + return true; + } + Lwin_make_flag = false; + if (record->event.pressed) { + if (Rwin_make_flag) { + Lkey_flag = true; + current_time = timer_read(); + scancode = KC_LGUI; + return false; + } else { + Lwin_make_flag = true; + } + } else { + Lkey_flag = 0; + } + return true; + case KC_RALT: + if (!user_config.MacMode_flag) { + return true; + } + Rwin_make_flag = false; + if (record->event.pressed) { + if (Lwin_make_flag) { + Lkey_flag = true; + current_time = timer_read(); + scancode = KC_LGUI; + return false; + } else { + Rwin_make_flag = true; + } + } else { + Lkey_flag = 0; + } + return true; + case KC_LALT: + if (!user_config.MacMode_flag) { + return true; + } + Lwin_make_flag = false; + if (record->event.pressed) { + if (Rwin_make_flag) { + Lkey_flag = true; + current_time = timer_read(); + scancode = KC_LGUI; + return false; + } else { + Lwin_make_flag = true; + } + } else { + Lkey_flag = 0; + } + return true; + case KC_LCTL: + if (fn_make_flag && record->event.pressed) { + if (while_test_flag) { + while_test_flag = false; + rgb_matrix_init(); + } else { + Lkey_flag = true; + current_time = timer_read(); + scancode = KC_LCTL; + } + return false; + } else { + Lkey_flag = 0; + } + return true; + case DF(WIN_B): + if ((fn_make_flag && record->event.pressed) && (alarm_flag == 0)) { + alarm_flag = true; + rgb_matrix_toggle_noeeprom(); + current_time = timer_read(); + + set_single_persistent_default_layer(WIN_B); + layer_state_set(1 << WIN_B); + user_config.MacMode_flag = false; + user_config._WASD_layer_flag = false; + eeconfig_update_user(user_config.raw); + } + return false; + case DF(MAC_B): + if ((fn_make_flag && record->event.pressed) && (alarm_flag == 0)) { + alarm_flag = true; + rgb_matrix_toggle_noeeprom(); + current_time = timer_read(); + + set_single_persistent_default_layer(MAC_B); + layer_state_set(1 << MAC_B); + keymap_config.no_gui = 0; + eeconfig_update_keymap(keymap_config.raw); + user_config.MacMode_flag = true; + user_config._WASD_layer_flag = false; + eeconfig_update_user(user_config.raw); + } + return false; + case TG(WIN_W): + if (record->event.pressed) { + alarm_flag = true; + rgb_matrix_toggle_noeeprom(); + current_time = timer_read(); + user_config._WASD_layer_flag = !layer_state_is(WIN_W); + eeconfig_update_user(user_config.raw); + } + return true; + case TG(MAC_W): + if (record->event.pressed) { + alarm_flag = true; + rgb_matrix_toggle_noeeprom(); + current_time = timer_read(); + user_config._WASD_layer_flag = !layer_state_is(MAC_W); + eeconfig_update_user(user_config.raw); + } + return true; + case GU_TOGG: + if ((fn_make_flag && record->event.pressed) && (alarm_flag == 0)) { + alarm_flag = true; + rgb_matrix_toggle_noeeprom(); + current_time = timer_read(); + writePin(C11, !keymap_config.no_gui); + } + return true; + case RGB_VAI: + if ((RGB_HSV_level = (uint8_t)rgb_matrix_get_val() / (RGB_MATRIX_MAXIMUM_BRIGHTNESS / 4)) < 4) { + if (!record->event.pressed) { + RGB_HSV_level++; + rgb_matrix_config.hsv.v = (uint8_t)(RGB_MATRIX_MAXIMUM_BRIGHTNESS / 4) * RGB_HSV_level; + rgb_matrix_sethsv(rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v); + } else { + if (!alarm_flag) { + alarm_cnt = 2; + } + } + } + return false; + case RGB_VAD: + if ((RGB_HSV_level = (uint8_t)rgb_matrix_get_val() / (RGB_MATRIX_MAXIMUM_BRIGHTNESS / 4)) > 0) { + if (!record->event.pressed) { + RGB_HSV_level--; + rgb_matrix_config.hsv.v = (uint8_t)(RGB_MATRIX_MAXIMUM_BRIGHTNESS / 4) * RGB_HSV_level; + rgb_matrix_sethsv(rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v); + } else { + if (!alarm_flag) { + alarm_cnt = 2; + } + } + } + return false; + case RGB_SAI: + if ((RGB_HSV_level = (uint8_t)rgb_matrix_get_sat() / (UINT8_MAX / 4)) < 4) { + if (!record->event.pressed) { + RGB_HSV_level++; + rgb_matrix_config.hsv.s = (uint8_t)(UINT8_MAX / 4) * RGB_HSV_level; + rgb_matrix_sethsv(rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v); + } else { + if (!alarm_flag) { + alarm_cnt = 2; + } + } + } + + return false; + case RGB_SAD: + if ((RGB_HSV_level = (uint8_t)rgb_matrix_get_sat() / (UINT8_MAX / 4)) > 0) { + if (!record->event.pressed) { + RGB_HSV_level--; + rgb_matrix_config.hsv.s = (uint8_t)(UINT8_MAX / 4) * RGB_HSV_level; + rgb_matrix_sethsv(rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v); + } else { + if (!alarm_flag) { + alarm_cnt = 2; + } + } + } + return false; + case RGB_HUI: + if ((fn_make_flag && record->event.pressed) && (alarm_flag == 0)) { + alarm_cnt = 2; + RGB_HSV_level = (uint8_t)rgb_matrix_get_hue() / (UINT8_MAX / 6); + RGB_HSV_level++; + RGB_HSV_level %= 7; + rgb_matrix_config.hsv.h = (uint8_t)(UINT8_MAX / 6) * RGB_HSV_level; + rgb_matrix_sethsv(rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v); + } + return false; + case RGB_SPI: + if ((fn_make_flag && record->event.pressed) && (alarm_flag == 0)) { + if ((RGB_HSV_level = (uint8_t)rgb_matrix_get_speed() / (UINT8_MAX / 4)) < 4) { + alarm_cnt = 2; + RGB_HSV_level++; + rgb_matrix_set_speed((uint8_t)(UINT8_MAX / 4) * RGB_HSV_level); + } + } + return false; + case RGB_SPD: + if ((fn_make_flag && record->event.pressed) && (alarm_flag == 0)) { + if ((RGB_HSV_level = (uint8_t)rgb_matrix_get_speed() / (UINT8_MAX / 4)) > 0) { + alarm_cnt = 2; + RGB_HSV_level--; + rgb_matrix_set_speed((uint8_t)(UINT8_MAX / 4) * RGB_HSV_level); + } + } + return false; + + case RGB_TOG: + if (record->event.pressed) { + switch (rgb_matrix_get_flags()) { + case LED_FLAG_ALL: { + rgb_matrix_set_flags(LED_FLAG_NONE); + rgb_matrix_set_color_all(0, 0, 0); + } break; + default: { + rgb_matrix_set_flags(LED_FLAG_ALL); + } break; + } + } + if (!rgb_matrix_is_enabled()) { + rgb_matrix_set_flags(LED_FLAG_ALL); + rgb_matrix_enable(); + } + return false; + default: + return true; + } +} + +void housekeeping_task_kb(void) { + if (Lkey_flag) { + if (scancode == KC_LGUI) { + if (timer_elapsed(current_time) >= 3000) { + Lkey_flag = false; + clear_eeprom(); + + current_time = timer_read(); + reset_glint_flag = true; + glint_cnt = 0; + rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_COLOR); + rgb_matrix_sethsv_noeeprom(HSV_OFF); + } + } else if (scancode == KC_LCTL) { + if (timer_elapsed(current_time) >= 3000) { + Lkey_flag = false; + clear_eeprom(); + + while_test_flag = true; + glint_cnt = 0; + rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_COLOR); + rgb_matrix_sethsv_noeeprom(HSV_WHITE); + } + } + } else if (reset_glint_flag) { + if ((timer_elapsed(current_time)) >= 300) { + current_time = timer_read(); + if (((glint_cnt++) & 0x01) == 0) { + rgb_matrix_sethsv_noeeprom(HSV_WHITE); + } else { + rgb_matrix_sethsv_noeeprom(HSV_OFF); + } + if (glint_cnt >= 3) { + glint_cnt = 0; + reset_glint_flag = false; + rgb_matrix_init(); + } + } + + } else if (while_test_flag) { + if ((timer_elapsed(current_time)) >= 1000) { + current_time = timer_read(); + if ((glint_cnt % 4) == 0) { + rgb_matrix_sethsv_noeeprom(HSV_RED); + } else if ((glint_cnt % 4) == 1) { + rgb_matrix_sethsv_noeeprom(HSV_GREEN); + } else if ((glint_cnt % 4) == 2) { + rgb_matrix_sethsv_noeeprom(HSV_BLUE); + } else if ((glint_cnt % 4) == 3) { + rgb_matrix_sethsv_noeeprom(HSV_WHITE); + } + glint_cnt++; + if (glint_cnt >= 30) { + glint_cnt = 0; + while_test_flag = false; + rgb_matrix_init(); + } + } + } else if (alarm_cnt != 0) { + alarm_cnt--; + if (alarm_cnt == 0) { + alarm_flag = true; + rgb_matrix_toggle_noeeprom(); + current_time = timer_read(); + } + } else if (alarm_flag) { + if ((timer_elapsed(current_time)) >= 50) { + rgb_matrix_toggle_noeeprom(); + alarm_flag = 0; + } + } +} + +void led_test(uint8_t color) { + rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_COLOR); + + switch (color) { + case WHITE: + rgb_matrix_sethsv_noeeprom(HSV_WHITE); + break; + + case RED: + rgb_matrix_sethsv_noeeprom(HSV_RED); + break; + + case GREEN: + rgb_matrix_sethsv_noeeprom(HSV_GREEN); + break; + + case BLUE: + rgb_matrix_sethsv_noeeprom(HSV_BLUE); + break; + } +} + +void clear_eeprom(void) { + eeconfig_init(); + if (layer_state_is(MAC_B)) { + set_single_persistent_default_layer(MAC_B); + // layer_state_set(1<. + */ +#pragma once + +#include_next + +#undef WB32_SPI_USE_QSPI +#define WB32_SPI_USE_QSPI TRUE + +#undef WB32_I2C_USE_I2C1 +#define WB32_I2C_USE_I2C1 TRUE diff --git a/keyboards/monsgeek/m3/rgb_matrix_kb.inc b/keyboards/monsgeek/m3/rgb_matrix_kb.inc new file mode 100644 index 000000000000..56e2bd31cbbd --- /dev/null +++ b/keyboards/monsgeek/m3/rgb_matrix_kb.inc @@ -0,0 +1,51 @@ +// !!! DO NOT ADD #pragma once !!! // + +// Step 1. +// Declare custom effects using the RGB_MATRIX_EFFECT macro +// (note the lack of semicolon after the macro!) + +RGB_MATRIX_EFFECT(turn_off_rgb) +RGB_MATRIX_EFFECT(kb_reset_rgb) + +// Step 2. +// Define effects inside the `RGB_MATRIX_CUSTOM_EFFECT_IMPLS` ifdef block + +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +// e.g: A simple effect, self-contained within a single method +static bool turn_off_rgb(effect_params_t *params) { + RGB_MATRIX_USE_LIMITS(led_min, led_max); + for (uint8_t i = led_min; i < led_max; i++) { + rgb_matrix_set_color(i, 0x00, 0x00, 0x00); + } + return rgb_matrix_check_finished_leds(led_max); +} + +// e.g: A more complex effect, relying on external methods and state, with +// dedicated init and run methods +static uint8_t some_global_state; +static void kb_reset_rgb_init(effect_params_t* params) { + some_global_state = 0; +} +static bool kb_reset_rgb_run(effect_params_t* params) { + RGB_MATRIX_USE_LIMITS(led_min, led_max); + some_global_state++; + if(some_global_state&0x01){ + for (uint8_t i = led_min; i < led_max; i++) + rgb_matrix_set_color(i, 0, 0, 0); + } + else{ + for (uint8_t i = led_min; i < led_max; i++) + rgb_matrix_set_color(i, 0xc0, 0xc0, 0xc0); + } + if(some_global_state>=7) + rgb_matrix_init(); + return rgb_matrix_check_finished_leds(led_max); +} + +static bool kb_reset_rgb(effect_params_t* params) { + if (params->init) kb_reset_rgb_init(params); + return kb_reset_rgb_run(params); +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS diff --git a/keyboards/monsgeek/m3/rules.mk b/keyboards/monsgeek/m3/rules.mk new file mode 100644 index 000000000000..e79b58b5c262 --- /dev/null +++ b/keyboards/monsgeek/m3/rules.mk @@ -0,0 +1,8 @@ +# Build Options +# change yes to no to disable +# +RGB_MATRIX_DRIVER = IS31FL3733 +EEPROM_DRIVER = wear_leveling +WEAR_LEVELING_DRIVER = spi_flash +#RGB_MATRIX_CUSTOM_KB = yes #Add turnoff LED + From b6c48cd72a0d4f243c9170155056c18d465b7f8a Mon Sep 17 00:00:00 2001 From: jonylee1986 <2532487686@qq.com> Date: Mon, 24 Apr 2023 16:11:42 +0800 Subject: [PATCH 02/37] Add keybord monsgeek m3. --- keyboards/monsgeek/m3/m3.c | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/keyboards/monsgeek/m3/m3.c b/keyboards/monsgeek/m3/m3.c index 47f40de694a1..0fcab0772702 100644 --- a/keyboards/monsgeek/m3/m3.c +++ b/keyboards/monsgeek/m3/m3.c @@ -140,17 +140,14 @@ led_config_t g_led_config = { { //ROW0 {0, 0 }, //0 - {24, 0 }, //1 {38, 0 }, //2 {52, 0 }, //3 {66, 0 }, //4 - {82, 0 }, //5 {96, 0 }, //6 {110, 0 }, //7 {124, 0 }, //8 - {140, 0 }, //9 {154, 0 }, //10 {168, 0 }, //11 @@ -158,7 +155,6 @@ led_config_t g_led_config = { {196, 0 }, //13 {210, 0 }, //14 {224, 0 }, //15 - // ROW1 {0, 12}, // 16 {13, 12}, // 17 @@ -177,7 +173,6 @@ led_config_t g_led_config = { {184, 12}, // 30 {197, 12}, // 31 {210, 12}, // 32 - //ROW2 {0, 26 }, //33 {14, 26 }, //34 @@ -196,8 +191,6 @@ led_config_t g_led_config = { {196, 26 }, //47 {210, 26 }, //48 {224, 26 }, //49 - - //ROW3 {0, 38 }, //50 {14, 38 }, //51 @@ -211,11 +204,7 @@ led_config_t g_led_config = { {126, 38 }, //59 {140, 38 }, //60 {154, 38 }, //61 - {182, 38 }, //62 - - - //ROW4 {0, 51 }, //63 {14, 51 }, //64 @@ -228,31 +217,20 @@ led_config_t g_led_config = { {112, 51 }, //71 {126, 51 }, //72 {140, 51 }, //73 - - {182, 51 }, //74 - {210, 51 }, //75 - - - //ROW5 {0, 64 }, //76 {14, 64 }, //77 {28, 64 }, //78 - {70, 64 }, //79 - {126, 64 }, //80 {140, 64 }, //81 {154, 64 }, //82 - {182, 64 }, //83 {196, 64 }, //84 {210, 64 }, //85 {224, 64 }, //86 - - }, { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, From eb757a38978c1b5cff3eedfd78959b0f1801308f Mon Sep 17 00:00:00 2001 From: jonylee1986 <2532487686@qq.com> Date: Mon, 24 Apr 2023 16:13:36 +0800 Subject: [PATCH 03/37] Add keybord monsgeek m3. --- keyboards/monsgeek/m3/keymaps/via/rules.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/keyboards/monsgeek/m3/keymaps/via/rules.mk b/keyboards/monsgeek/m3/keymaps/via/rules.mk index edf9bd87ead3..036bd6d1c3ec 100644 --- a/keyboards/monsgeek/m3/keymaps/via/rules.mk +++ b/keyboards/monsgeek/m3/keymaps/via/rules.mk @@ -1,2 +1 @@ -VIA_ENABLE = yes -ENCODER_MAP_ENABLE = no \ No newline at end of file +VIA_ENABLE = yes \ No newline at end of file From ce9ab14625c41bb6a454113d599df220d65114a0 Mon Sep 17 00:00:00 2001 From: jonylee1986 <2532487686@qq.com> Date: Mon, 24 Apr 2023 16:14:48 +0800 Subject: [PATCH 04/37] updata rules.mk --- keyboards/monsgeek/m3/keymaps/via/rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/monsgeek/m3/keymaps/via/rules.mk b/keyboards/monsgeek/m3/keymaps/via/rules.mk index 036bd6d1c3ec..1e5b99807cb7 100644 --- a/keyboards/monsgeek/m3/keymaps/via/rules.mk +++ b/keyboards/monsgeek/m3/keymaps/via/rules.mk @@ -1 +1 @@ -VIA_ENABLE = yes \ No newline at end of file +VIA_ENABLE = yes From 66b6179a4d5850fa29e823698f93300b44def9af Mon Sep 17 00:00:00 2001 From: jonylee1986 <2532487686@qq.com> Date: Mon, 24 Apr 2023 16:27:54 +0800 Subject: [PATCH 05/37] add readme.md --- keyboards/monsgeek/m3/config.h | 34 +++------------------------------ keyboards/monsgeek/m3/readme.md | 19 ++++++++++++++++++ 2 files changed, 22 insertions(+), 31 deletions(-) create mode 100644 keyboards/monsgeek/m3/readme.md diff --git a/keyboards/monsgeek/m3/config.h b/keyboards/monsgeek/m3/config.h index ef9931698a8f..1a6589a0092f 100644 --- a/keyboards/monsgeek/m3/config.h +++ b/keyboards/monsgeek/m3/config.h @@ -16,12 +16,11 @@ #pragma once -/* Use 5 dynamic keymap layers */ +/* Use 6 dynamic keymap layers */ #define DYNAMIC_KEYMAP_LAYER_COUNT 6 -#define RGB_TRIGGER_ON_KEYDOWN /* Force NKRO on boot up regardless of the setting saved in the EEPROM (uncomment to enable it) */ - #define FORCE_NKRO +#define FORCE_NKRO /* LED Indicators */ #define LED_CAPS_LOCK_PIN A15 @@ -57,9 +56,9 @@ #define RGB_MATRIX_LED_COUNT 87 +#define RGB_TRIGGER_ON_KEYDOWN #define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended #define RGB_MATRIX_CENTER {112,32} - #define RGB_MATRIX_FRAMEBUFFER_EFFECTS #define RGB_MATRIX_KEYPRESSES #define RGB_MATRIX_KEYRELEASES @@ -67,17 +66,8 @@ // RGB Matrix Animation modes. Explicitly enabled // For full list of effects, see: // https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects -// #define ENABLE_RGB_MATRIX_ALPHAS_MODS -// #define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN -// #define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT #define ENABLE_RGB_MATRIX_SOLID_COLOR // Static single hue, no speed support #define ENABLE_RGB_MATRIX_BREATHING -// #define ENABLE_RGB_MATRIX_BAND_SAT -// #define ENABLE_RGB_MATRIX_BAND_VAL -// #define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT -// #define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL -// #define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT -// #define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL #define ENABLE_RGB_MATRIX_CYCLE_ALL #define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT #define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN @@ -88,31 +78,13 @@ #define ENABLE_RGB_MATRIX_CYCLE_SPIRAL #define ENABLE_RGB_MATRIX_DUAL_BEACON #define ENABLE_RGB_MATRIX_RAINBOW_BEACON -// #define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS #define ENABLE_RGB_MATRIX_RAINDROPS -// #define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS -// #define ENABLE_RGB_MATRIX_HUE_BREATHING -// #define ENABLE_RGB_MATRIX_HUE_PENDULUM -// #define ENABLE_RGB_MATRIX_HUE_WAVE -// #define ENABLE_RGB_MATRIX_PIXEL_RAIN -// #define ENABLE_RGB_MATRIX_PIXEL_FLOW -// #define ENABLE_RGB_MATRIX_PIXEL_FRACTAL // enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined #define ENABLE_RGB_MATRIX_TYPING_HEATMAP -//#define ENABLE_RGB_MATRIX_DIGITAL_RAIN -// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE #define ENABLE_RGB_MATRIX_SOLID_REACTIVE -//#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE -//#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE -//#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS -//#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS -//#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS -//#define ENABLE_RGB_MATRIX_SPLASH #define ENABLE_RGB_MATRIX_MULTISPLASH -//#define ENABLE_RGB_MATRIX_SOLID_SPLASH -//#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 160 /* The maximum brightness level */ diff --git a/keyboards/monsgeek/m3/readme.md b/keyboards/monsgeek/m3/readme.md new file mode 100644 index 000000000000..96adc0ad01d5 --- /dev/null +++ b/keyboards/monsgeek/m3/readme.md @@ -0,0 +1,19 @@ +# m3 + +A customizable 80% encoder keyboard. + +* Keyboard Maintainer: [jonylee@hfd](https://github.com/jonylee1986) +* Hardware Supported: m3 +* Hardware Availability: [monsgeek](https://www.monsgeek.com/) + +Make example for this keyboard (after setting up your build environment): + + make monsgeek/m3:default + +Flashing example for this keyboard: + + make monsgeek/m3:default:flash + +**Reset Key**: Hold down the key located at *K000*, which programmed as *Esc* while plugging in the keyboard. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). From 913375b816f881398c58ae574dfcfa738edcdacd Mon Sep 17 00:00:00 2001 From: jonylee1986 <2532487686@qq.com> Date: Tue, 25 Apr 2023 10:46:47 +0800 Subject: [PATCH 06/37] delete monsgeek\m3\rgb_matrix_kb.inc --- keyboards/monsgeek/m3/config.h | 3 -- keyboards/monsgeek/m3/rgb_matrix_kb.inc | 51 ------------------------- 2 files changed, 54 deletions(-) delete mode 100644 keyboards/monsgeek/m3/rgb_matrix_kb.inc diff --git a/keyboards/monsgeek/m3/config.h b/keyboards/monsgeek/m3/config.h index 1a6589a0092f..408f24f4162a 100644 --- a/keyboards/monsgeek/m3/config.h +++ b/keyboards/monsgeek/m3/config.h @@ -48,9 +48,6 @@ #define DRIVER_COUNT 2 #define DRIVER_ADDR_1 0b1110100 #define DRIVER_ADDR_2 0b1110111 -#define I2C1_SDA_PIN B7 -#define I2C1_SCL_PIN B6 -#define I2C1_SCL_PAL_MODE 4 #define I2C1_OPMODE OPMODE_I2C #define I2C1_CLOCK_SPEED 400000 /* 400000 */ diff --git a/keyboards/monsgeek/m3/rgb_matrix_kb.inc b/keyboards/monsgeek/m3/rgb_matrix_kb.inc deleted file mode 100644 index 56e2bd31cbbd..000000000000 --- a/keyboards/monsgeek/m3/rgb_matrix_kb.inc +++ /dev/null @@ -1,51 +0,0 @@ -// !!! DO NOT ADD #pragma once !!! // - -// Step 1. -// Declare custom effects using the RGB_MATRIX_EFFECT macro -// (note the lack of semicolon after the macro!) - -RGB_MATRIX_EFFECT(turn_off_rgb) -RGB_MATRIX_EFFECT(kb_reset_rgb) - -// Step 2. -// Define effects inside the `RGB_MATRIX_CUSTOM_EFFECT_IMPLS` ifdef block - -#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS - -// e.g: A simple effect, self-contained within a single method -static bool turn_off_rgb(effect_params_t *params) { - RGB_MATRIX_USE_LIMITS(led_min, led_max); - for (uint8_t i = led_min; i < led_max; i++) { - rgb_matrix_set_color(i, 0x00, 0x00, 0x00); - } - return rgb_matrix_check_finished_leds(led_max); -} - -// e.g: A more complex effect, relying on external methods and state, with -// dedicated init and run methods -static uint8_t some_global_state; -static void kb_reset_rgb_init(effect_params_t* params) { - some_global_state = 0; -} -static bool kb_reset_rgb_run(effect_params_t* params) { - RGB_MATRIX_USE_LIMITS(led_min, led_max); - some_global_state++; - if(some_global_state&0x01){ - for (uint8_t i = led_min; i < led_max; i++) - rgb_matrix_set_color(i, 0, 0, 0); - } - else{ - for (uint8_t i = led_min; i < led_max; i++) - rgb_matrix_set_color(i, 0xc0, 0xc0, 0xc0); - } - if(some_global_state>=7) - rgb_matrix_init(); - return rgb_matrix_check_finished_leds(led_max); -} - -static bool kb_reset_rgb(effect_params_t* params) { - if (params->init) kb_reset_rgb_init(params); - return kb_reset_rgb_run(params); -} - -#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS From a32f13b0926f6d280a8b72ec474d29f3eb0cec1e Mon Sep 17 00:00:00 2001 From: jonylee1986 <2532487686@qq.com> Date: Tue, 25 Apr 2023 11:27:30 +0800 Subject: [PATCH 07/37] add DISABLE_M3_KEYCODES --- keyboards/monsgeek/m3/config.h | 2 +- keyboards/monsgeek/m3/m3.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/keyboards/monsgeek/m3/config.h b/keyboards/monsgeek/m3/config.h index 408f24f4162a..718065619b94 100644 --- a/keyboards/monsgeek/m3/config.h +++ b/keyboards/monsgeek/m3/config.h @@ -85,4 +85,4 @@ #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 160 /* The maximum brightness level */ - +//#define DISABLE_M3_KEYCODES /*if you need to change or restore the default QMK button function, please open it*/ diff --git a/keyboards/monsgeek/m3/m3.c b/keyboards/monsgeek/m3/m3.c index 0fcab0772702..a7b7f8b77d0c 100644 --- a/keyboards/monsgeek/m3/m3.c +++ b/keyboards/monsgeek/m3/m3.c @@ -330,6 +330,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { return false; } switch (keycode) { +#ifndef DISABLE_M3_KEYCODES case MO(WIN_FN): case MO(MAC_FN): fn_make_flag = record->event.pressed; @@ -574,6 +575,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { rgb_matrix_enable(); } return false; +#endif//DISABLE_M3_KEYCODES default: return true; } From 969f4fc8101134974e527e48ac5cd1f21be0c337 Mon Sep 17 00:00:00 2001 From: jonylee1986 <2532487686@qq.com> Date: Wed, 26 Apr 2023 15:09:48 +0800 Subject: [PATCH 08/37] user_config --> kb_config --- keyboards/monsgeek/m3/m3.c | 48 +++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/keyboards/monsgeek/m3/m3.c b/keyboards/monsgeek/m3/m3.c index a7b7f8b77d0c..8abafe716208 100644 --- a/keyboards/monsgeek/m3/m3.c +++ b/keyboards/monsgeek/m3/m3.c @@ -279,9 +279,9 @@ typedef union { bool MacMode_flag : 1; bool _WASD_layer_flag : 1; }; -} user_config_t; +} kb_config_t; -user_config_t user_config; +kb_config_t kb_config; static bool fn_make_flag = false; static bool Rwin_make_flag = false; @@ -297,11 +297,11 @@ static uint8_t alarm_cnt = 0; static uint8_t RGB_HSV_level; HSV hsv; -void keyboard_post_init_user(void) { - user_config.raw = eeconfig_read_user(); // Read status from EEPROM - if (user_config.MacMode_flag) layer_on(MAC_B); - if (user_config._WASD_layer_flag) { - user_config.MacMode_flag ? layer_on(MAC_W) : layer_on(WIN_W); +void keyboard_post_init_kb(void) { + kb_config.raw = eeconfig_read_kb(); // Read status from EEPROM + if (kb_config.MacMode_flag) layer_on(MAC_B); + if (kb_config._WASD_layer_flag) { + kb_config.MacMode_flag ? layer_on(MAC_W) : layer_on(WIN_W); } } @@ -319,7 +319,7 @@ bool led_update_kb(led_t led_state) { bool res = led_update_user(led_state); if (res) { writePin(LED_CAPS_LOCK_PIN, led_state.caps_lock); - writePin(LED_MAC_OS_PIN, user_config.MacMode_flag); + writePin(LED_MAC_OS_PIN, kb_config.MacMode_flag); writePin(LED_WIN_LOCK_PIN, keymap_config.no_gui); } return res; @@ -336,7 +336,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { fn_make_flag = record->event.pressed; return true; case KC_RGUI: - if (user_config.MacMode_flag) { + if (kb_config.MacMode_flag) { return true; } Rwin_make_flag = false; @@ -354,7 +354,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { } return true; case KC_LGUI: - if (user_config.MacMode_flag) { + if (kb_config.MacMode_flag) { return true; } Lwin_make_flag = false; @@ -372,7 +372,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { } return true; case KC_RALT: - if (!user_config.MacMode_flag) { + if (!kb_config.MacMode_flag) { return true; } Rwin_make_flag = false; @@ -390,7 +390,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { } return true; case KC_LALT: - if (!user_config.MacMode_flag) { + if (!kb_config.MacMode_flag) { return true; } Lwin_make_flag = false; @@ -430,9 +430,9 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { set_single_persistent_default_layer(WIN_B); layer_state_set(1 << WIN_B); - user_config.MacMode_flag = false; - user_config._WASD_layer_flag = false; - eeconfig_update_user(user_config.raw); + kb_config.MacMode_flag = false; + kb_config._WASD_layer_flag = false; + eeconfig_update_kb(kb_config.raw); } return false; case DF(MAC_B): @@ -445,9 +445,9 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { layer_state_set(1 << MAC_B); keymap_config.no_gui = 0; eeconfig_update_keymap(keymap_config.raw); - user_config.MacMode_flag = true; - user_config._WASD_layer_flag = false; - eeconfig_update_user(user_config.raw); + kb_config.MacMode_flag = true; + kb_config._WASD_layer_flag = false; + eeconfig_update_kb(kb_config.raw); } return false; case TG(WIN_W): @@ -455,8 +455,8 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { alarm_flag = true; rgb_matrix_toggle_noeeprom(); current_time = timer_read(); - user_config._WASD_layer_flag = !layer_state_is(WIN_W); - eeconfig_update_user(user_config.raw); + kb_config._WASD_layer_flag = !layer_state_is(WIN_W); + eeconfig_update_kb(kb_config.raw); } return true; case TG(MAC_W): @@ -464,8 +464,8 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { alarm_flag = true; rgb_matrix_toggle_noeeprom(); current_time = timer_read(); - user_config._WASD_layer_flag = !layer_state_is(MAC_W); - eeconfig_update_user(user_config.raw); + kb_config._WASD_layer_flag = !layer_state_is(MAC_W); + eeconfig_update_kb(kb_config.raw); } return true; case GU_TOGG: @@ -687,8 +687,8 @@ void clear_eeprom(void) { } layer_off(WIN_W); layer_off(MAC_W); - user_config._WASD_layer_flag = false; - eeconfig_update_user(user_config.raw); + kb_config._WASD_layer_flag = false; + eeconfig_update_kb(kb_config.raw); keymap_config.no_gui = false; writePin(LED_WIN_LOCK_PIN, keymap_config.no_gui); eeconfig_update_keymap(keymap_config.raw); From 33becd34564ad6ba75c155b8616524ba0e49fade Mon Sep 17 00:00:00 2001 From: jonylee1986 <2532487686@qq.com> Date: Thu, 25 May 2023 15:29:52 +0800 Subject: [PATCH 09/37] Move code to info.json,and removed redundant features --- keyboards/monsgeek/m3/config.h | 33 +- keyboards/monsgeek/m3/halconf.h | 2 +- keyboards/monsgeek/m3/info.json | 125 ++++- .../monsgeek/m3/keymaps/default/keymap.c | 2 +- keyboards/monsgeek/m3/keymaps/via/keymap.c | 2 +- keyboards/monsgeek/m3/m3.c | 486 +----------------- keyboards/monsgeek/m3/mcuconf.h | 2 +- keyboards/monsgeek/m3/rules.mk | 2 - 8 files changed, 135 insertions(+), 519 deletions(-) diff --git a/keyboards/monsgeek/m3/config.h b/keyboards/monsgeek/m3/config.h index 718065619b94..05f07aece534 100644 --- a/keyboards/monsgeek/m3/config.h +++ b/keyboards/monsgeek/m3/config.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 jonylee@hfd +/* Copyright (C) 2023 jonylee@hfd * * 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 @@ -19,13 +19,7 @@ /* Use 6 dynamic keymap layers */ #define DYNAMIC_KEYMAP_LAYER_COUNT 6 -/* Force NKRO on boot up regardless of the setting saved in the EEPROM (uncomment to enable it) */ -#define FORCE_NKRO - /* LED Indicators */ -#define LED_CAPS_LOCK_PIN A15 -// #define LED_NUM_LOCK_PIN C10 -// #define LED_SCROLL_LOCK_PIN C11 #define LED_MAC_OS_PIN C10 #define LED_WIN_LOCK_PIN C11 @@ -55,34 +49,9 @@ #define RGB_TRIGGER_ON_KEYDOWN #define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended -#define RGB_MATRIX_CENTER {112,32} #define RGB_MATRIX_FRAMEBUFFER_EFFECTS #define RGB_MATRIX_KEYPRESSES #define RGB_MATRIX_KEYRELEASES -// RGB Matrix Animation modes. Explicitly enabled -// For full list of effects, see: -// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects -#define ENABLE_RGB_MATRIX_SOLID_COLOR // Static single hue, no speed support -#define ENABLE_RGB_MATRIX_BREATHING -#define ENABLE_RGB_MATRIX_CYCLE_ALL -#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT -#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN -#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON -#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN -#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL -#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL -#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL -#define ENABLE_RGB_MATRIX_DUAL_BEACON -#define ENABLE_RGB_MATRIX_RAINBOW_BEACON -#define ENABLE_RGB_MATRIX_RAINDROPS -// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined -#define ENABLE_RGB_MATRIX_TYPING_HEATMAP -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE -#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS -#define ENABLE_RGB_MATRIX_MULTISPLASH -#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 160 /* The maximum brightness level */ -//#define DISABLE_M3_KEYCODES /*if you need to change or restore the default QMK button function, please open it*/ diff --git a/keyboards/monsgeek/m3/halconf.h b/keyboards/monsgeek/m3/halconf.h index 2f64e65393a5..55bfe5c97794 100644 --- a/keyboards/monsgeek/m3/halconf.h +++ b/keyboards/monsgeek/m3/halconf.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 jonylee@hfd +/* Copyright (C) 2023 jonylee@hfd * * 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 diff --git a/keyboards/monsgeek/m3/info.json b/keyboards/monsgeek/m3/info.json index febaa12f732c..37bb4a583d1d 100644 --- a/keyboards/monsgeek/m3/info.json +++ b/keyboards/monsgeek/m3/info.json @@ -5,7 +5,9 @@ "usb": { "vid": "0xFFFE", "pid": "0x0009", - "device_version": "1.0.5" + "device_version": "1.0.5", + "suspend_wakeup_delay": 400, + "force_nkro": true }, "processor": "WB32FQ95", "bootloader": "wb32-dfu", @@ -24,6 +26,127 @@ "rows": ["B15", "C6", "C7", "C8", "C9", "A8"] }, "diode_direction": "ROW2COL", + "indicators": { + "caps_lock": "A15" + }, + "rgb_matrix": { + "driver": "IS31FL3733", + "max_brightness": 160, + "animations": { + "breathing": true, + "cycle_all": true, + "cycle_left_right": true, + "cycle_up_down": true, + "rainbow_moving_chevron": true, + "cycle_out_in": true, + "cycle_out_in_dual": true, + "cycle_pinwheel": true, + "cycle_spiral": true, + "dual_beacon": true, + "rainbow_beacon": true, + "raindrops": true, + "typing_heatmap": true, + "solid_reactive_simple": true, + "solid_reactive": true, + "solid_reactive_cross": true, + "multisplash": true + }, + "layout":[ + { "flags": 4, "matrix": [0, 0], "x": 0, "y": 0}, + { "flags": 4, "matrix": [0, 1], "x": 24, "y": 0}, + { "flags": 4, "matrix": [0, 2], "x": 38, "y": 0}, + { "flags": 4, "matrix": [0, 3], "x": 52, "y": 0}, + { "flags": 4, "matrix": [0, 4], "x": 66, "y": 0}, + { "flags": 4, "matrix": [0, 5], "x": 82, "y": 0}, + { "flags": 4, "matrix": [0, 6], "x": 96, "y": 0}, + { "flags": 4, "matrix": [0, 7], "x":110, "y": 0}, + { "flags": 4, "matrix": [0, 8], "x":124, "y": 0}, + { "flags": 4, "matrix": [0, 9], "x":140, "y": 0}, + { "flags": 4, "matrix": [0, 10], "x":154, "y": 0}, + { "flags": 4, "matrix": [0, 11], "x":168, "y": 0}, + { "flags": 4, "matrix": [0, 12], "x":182, "y": 0}, + { "flags": 4, "matrix": [0, 14], "x":196, "y": 0}, + { "flags": 4, "matrix": [0, 15], "x":210, "y": 0}, + { "flags": 4, "matrix": [0, 16], "x":224, "y": 0}, + + { "flags": 4, "matrix": [1, 0], "x": 0, "y": 12}, + { "flags": 4, "matrix": [1, 1], "x": 13, "y": 12}, + { "flags": 4, "matrix": [1, 2], "x": 26, "y": 12}, + { "flags": 4, "matrix": [1, 3], "x": 39, "y": 12}, + { "flags": 4, "matrix": [1, 4], "x": 52, "y": 12}, + { "flags": 4, "matrix": [1, 5], "x": 65, "y": 12}, + { "flags": 4, "matrix": [1, 6], "x": 79, "y": 12}, + { "flags": 4, "matrix": [1, 7], "x": 92, "y": 12}, + { "flags": 4, "matrix": [1, 8], "x":105, "y": 12}, + { "flags": 4, "matrix": [1, 9], "x":118, "y": 12}, + { "flags": 4, "matrix": [1, 10], "x":131, "y": 12}, + { "flags": 4, "matrix": [1, 11], "x":144, "y": 12}, + { "flags": 4, "matrix": [1, 12], "x":158, "y": 12}, + { "flags": 4, "matrix": [1, 13], "x":171, "y": 12}, + { "flags": 4, "matrix": [1, 14], "x":184, "y": 12}, + { "flags": 4, "matrix": [1, 15], "x":197, "y": 12}, + { "flags": 4, "matrix": [1, 16], "x":210, "y": 12}, + + { "flags": 4, "matrix": [2, 0], "x": 0, "y": 26}, + { "flags": 4, "matrix": [2, 1], "x": 14, "y": 26}, + { "flags": 4, "matrix": [2, 2], "x": 28, "y": 26}, + { "flags": 4, "matrix": [2, 3], "x": 42, "y": 26}, + { "flags": 4, "matrix": [2, 4], "x": 56, "y": 26}, + { "flags": 4, "matrix": [2, 5], "x": 70, "y": 26}, + { "flags": 4, "matrix": [2, 6], "x": 84, "y": 26}, + { "flags": 4, "matrix": [2, 7], "x": 98, "y": 26}, + { "flags": 4, "matrix": [2, 8], "x":112, "y": 26}, + { "flags": 4, "matrix": [2, 9], "x":126, "y": 26}, + { "flags": 4, "matrix": [2, 10], "x":140, "y": 26}, + { "flags": 4, "matrix": [2, 11], "x":154, "y": 26}, + { "flags": 4, "matrix": [2, 12], "x":168, "y": 26}, + { "flags": 4, "matrix": [2, 13], "x":182, "y": 26}, + { "flags": 4, "matrix": [2, 14], "x":196, "y": 26}, + { "flags": 4, "matrix": [2, 15], "x":210, "y": 26}, + { "flags": 4, "matrix": [2, 16], "x":224, "y": 26}, + + { "flags": 4, "matrix": [3, 0], "x": 0, "y": 38}, + { "flags": 4, "matrix": [3, 1], "x": 14, "y": 38}, + { "flags": 4, "matrix": [3, 2], "x": 28, "y": 38}, + { "flags": 4, "matrix": [3, 3], "x": 42, "y": 38}, + { "flags": 4, "matrix": [3, 4], "x": 56, "y": 38}, + { "flags": 4, "matrix": [3, 5], "x": 70, "y": 38}, + { "flags": 4, "matrix": [3, 6], "x": 84, "y": 38}, + { "flags": 4, "matrix": [3, 7], "x": 98, "y": 38}, + { "flags": 4, "matrix": [3, 8], "x":112, "y": 38}, + { "flags": 4, "matrix": [3, 9], "x":126, "y": 38}, + { "flags": 4, "matrix": [3, 10], "x":140, "y": 38}, + { "flags": 4, "matrix": [3, 11], "x":154, "y": 38}, + { "flags": 4, "matrix": [3, 13], "x":182, "y": 38}, + + { "flags": 4, "matrix": [4, 0], "x": 0, "y": 51}, + { "flags": 4, "matrix": [4, 1], "x": 14, "y": 51}, + { "flags": 4, "matrix": [4, 2], "x": 28, "y": 51}, + { "flags": 4, "matrix": [4, 3], "x": 42, "y": 51}, + { "flags": 4, "matrix": [4, 4], "x": 56, "y": 51}, + { "flags": 4, "matrix": [4, 5], "x": 70, "y": 51}, + { "flags": 4, "matrix": [4, 6], "x": 84, "y": 51}, + { "flags": 4, "matrix": [4, 7], "x": 98, "y": 51}, + { "flags": 4, "matrix": [4, 8], "x":112, "y": 51}, + { "flags": 4, "matrix": [4, 9], "x":126, "y": 51}, + { "flags": 4, "matrix": [4, 10], "x":140, "y": 51}, + { "flags": 4, "matrix": [4, 13], "x":154, "y": 51}, + { "flags": 4, "matrix": [4, 15], "x":182, "y": 51}, + + { "flags": 4, "matrix": [5, 0], "x": 0, "y": 64}, + { "flags": 4, "matrix": [5, 1], "x": 14, "y": 64}, + { "flags": 4, "matrix": [5, 2], "x": 28, "y": 64}, + { "flags": 4, "matrix": [5, 5], "x": 70, "y": 64}, + { "flags": 4, "matrix": [5, 9], "x":126, "y": 64}, + { "flags": 4, "matrix": [5, 10], "x":140, "y": 64}, + { "flags": 4, "matrix": [5, 11], "x":154, "y": 64}, + { "flags": 4, "matrix": [5, 13], "x":182, "y": 64}, + { "flags": 4, "matrix": [5, 14], "x":196, "y": 64}, + { "flags": 4, "matrix": [5, 15], "x":210, "y": 64}, + { "flags": 4, "matrix": [5, 16], "x":224, "y": 64} + + ] + }, "layouts": { "LAYOUT": { "layout": [ diff --git a/keyboards/monsgeek/m3/keymaps/default/keymap.c b/keyboards/monsgeek/m3/keymaps/default/keymap.c index 23e1d69f3f04..88bfbc8e1fdc 100644 --- a/keyboards/monsgeek/m3/keymaps/default/keymap.c +++ b/keyboards/monsgeek/m3/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 jonylee@hfd +/* Copyright (C) 2023 jonylee@hfd * * 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 diff --git a/keyboards/monsgeek/m3/keymaps/via/keymap.c b/keyboards/monsgeek/m3/keymaps/via/keymap.c index 23e1d69f3f04..88bfbc8e1fdc 100644 --- a/keyboards/monsgeek/m3/keymaps/via/keymap.c +++ b/keyboards/monsgeek/m3/keymaps/via/keymap.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 jonylee@hfd +/* Copyright (C) 2023 jonylee@hfd * * 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 diff --git a/keyboards/monsgeek/m3/m3.c b/keyboards/monsgeek/m3/m3.c index 8abafe716208..fbaa0c9d13de 100644 --- a/keyboards/monsgeek/m3/m3.c +++ b/keyboards/monsgeek/m3/m3.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 jonylee@hfd +/* Copyright (C) 2023 jonylee@hfd * * 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 @@ -15,10 +15,6 @@ */ #include "quantum.h" - -static uint16_t map_current_time = 0; -static bool pwron_flag = false; - // clang-format off #ifdef RGB_MATRIX_ENABLE const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { @@ -127,150 +123,9 @@ const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { {1, J_2, K_2, L_2}, {1, J_3, K_3, L_3}, }; - -led_config_t g_led_config = { - { - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, NO_LED, 13, 14, 15}, - { 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32}, - { 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49}, - { 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, NO_LED, 62, NO_LED, NO_LED, NO_LED}, - { 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, NO_LED, NO_LED, 74, NO_LED, 75, NO_LED}, - { 76, 77, 78, NO_LED, NO_LED, 79, NO_LED, NO_LED, NO_LED, 80, 81, 82, NO_LED, 83, 84, 85, 86}, - }, - { - //ROW0 - {0, 0 }, //0 - {24, 0 }, //1 - {38, 0 }, //2 - {52, 0 }, //3 - {66, 0 }, //4 - {82, 0 }, //5 - {96, 0 }, //6 - {110, 0 }, //7 - {124, 0 }, //8 - {140, 0 }, //9 - {154, 0 }, //10 - {168, 0 }, //11 - {182, 0 }, //12 - {196, 0 }, //13 - {210, 0 }, //14 - {224, 0 }, //15 - // ROW1 - {0, 12}, // 16 - {13, 12}, // 17 - {26, 12}, // 18 - {39, 12}, // 19 - {52, 12}, // 20 - {65, 12}, // 21 - {79, 12}, // 22 - {92, 12}, // 23 - {105, 12}, // 24 - {118, 12}, // 25 - {131, 12}, // 26 - {144, 12}, // 27 - {158, 12}, // 28 - {171, 12}, // 29 - {184, 12}, // 30 - {197, 12}, // 31 - {210, 12}, // 32 - //ROW2 - {0, 26 }, //33 - {14, 26 }, //34 - {28, 26 }, //35 - {42, 26 }, //36 - {56, 26 }, //37 - {70, 26 }, //38 - {84, 26 }, //39 - {98, 26 }, //40 - {112, 26 }, //41 - {126, 26 }, //42 - {140, 26 }, //43 - {154, 26 }, //44 - {168, 26 }, //45 - {182, 26 }, //46 - {196, 26 }, //47 - {210, 26 }, //48 - {224, 26 }, //49 - //ROW3 - {0, 38 }, //50 - {14, 38 }, //51 - {28, 38 }, //52 - {42, 38 }, //53 - {56, 38 }, //54 - {70, 38 }, //55 - {84, 38 }, //56 - {98, 38 }, //57 - {112, 38 }, //58 - {126, 38 }, //59 - {140, 38 }, //60 - {154, 38 }, //61 - {182, 38 }, //62 - //ROW4 - {0, 51 }, //63 - {14, 51 }, //64 - {28, 51 }, //65 - {42, 51 }, //66 - {56, 51 }, //67 - {70, 51 }, //68 - {84, 51 }, //69 - {98, 51 }, //70 - {112, 51 }, //71 - {126, 51 }, //72 - {140, 51 }, //73 - {182, 51 }, //74 - {210, 51 }, //75 - //ROW5 - {0, 64 }, //76 - {14, 64 }, //77 - {28, 64 }, //78 - {70, 64 }, //79 - {126, 64 }, //80 - {140, 64 }, //81 - {154, 64 }, //82 - {182, 64 }, //83 - {196, 64 }, //84 - {210, 64 }, //85 - {224, 64 }, //86 - }, - { - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - } -}; - -// clang-format on -bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) { - if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) { - return false; - } - if (pwron_flag == false) { - map_current_time = timer_read(); - if (map_current_time < 3000) { - rgb_matrix_set_color_all(150, 150, 150); - } - if (map_current_time >= 3000) { - pwron_flag = true; - if (!rgb_matrix_get_flags()) { - rgb_matrix_set_flags(LED_FLAG_NONE); - rgb_matrix_set_color_all(0, 0, 0); - } - } - } - return true; -} - #endif // RGB_MATRIX_ENABLE -void led_test(uint8_t color); -void clear_eeprom(void); - enum __layers { WIN_B, WIN_W, WIN_FN, MAC_B, MAC_W, MAC_FN }; -enum colors { WHITE, RED, GREEN, BLUE }; -enum colors led_color_status = WHITE; // clang-format on typedef union { @@ -283,20 +138,6 @@ typedef union { kb_config_t kb_config; -static bool fn_make_flag = false; -static bool Rwin_make_flag = false; -static bool Lwin_make_flag = false; -static bool Lkey_flag = false; -static bool reset_glint_flag = false; -static bool while_test_flag = false; -static bool alarm_flag = false; -static uint16_t current_time = 0; -static uint8_t glint_cnt = 0; -static uint16_t scancode = 0; -static uint8_t alarm_cnt = 0; -static uint8_t RGB_HSV_level; -HSV hsv; - void keyboard_post_init_kb(void) { kb_config.raw = eeconfig_read_kb(); // Read status from EEPROM if (kb_config.MacMode_flag) layer_on(MAC_B); @@ -330,104 +171,8 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { return false; } switch (keycode) { -#ifndef DISABLE_M3_KEYCODES - case MO(WIN_FN): - case MO(MAC_FN): - fn_make_flag = record->event.pressed; - return true; - case KC_RGUI: - if (kb_config.MacMode_flag) { - return true; - } - Rwin_make_flag = false; - if (record->event.pressed) { - if (Lwin_make_flag) { - Lkey_flag = true; - current_time = timer_read(); - scancode = KC_LGUI; - return false; - } else { - Rwin_make_flag = true; - } - } else { - Lkey_flag = 0; - } - return true; - case KC_LGUI: - if (kb_config.MacMode_flag) { - return true; - } - Lwin_make_flag = false; - if (record->event.pressed) { - if (Rwin_make_flag) { - Lkey_flag = true; - current_time = timer_read(); - scancode = KC_LGUI; - return false; - } else { - Lwin_make_flag = true; - } - } else { - Lkey_flag = 0; - } - return true; - case KC_RALT: - if (!kb_config.MacMode_flag) { - return true; - } - Rwin_make_flag = false; - if (record->event.pressed) { - if (Lwin_make_flag) { - Lkey_flag = true; - current_time = timer_read(); - scancode = KC_LGUI; - return false; - } else { - Rwin_make_flag = true; - } - } else { - Lkey_flag = 0; - } - return true; - case KC_LALT: - if (!kb_config.MacMode_flag) { - return true; - } - Lwin_make_flag = false; - if (record->event.pressed) { - if (Rwin_make_flag) { - Lkey_flag = true; - current_time = timer_read(); - scancode = KC_LGUI; - return false; - } else { - Lwin_make_flag = true; - } - } else { - Lkey_flag = 0; - } - return true; - case KC_LCTL: - if (fn_make_flag && record->event.pressed) { - if (while_test_flag) { - while_test_flag = false; - rgb_matrix_init(); - } else { - Lkey_flag = true; - current_time = timer_read(); - scancode = KC_LCTL; - } - return false; - } else { - Lkey_flag = 0; - } - return true; case DF(WIN_B): - if ((fn_make_flag && record->event.pressed) && (alarm_flag == 0)) { - alarm_flag = true; - rgb_matrix_toggle_noeeprom(); - current_time = timer_read(); - + if (record->event.pressed) { set_single_persistent_default_layer(WIN_B); layer_state_set(1 << WIN_B); kb_config.MacMode_flag = false; @@ -436,11 +181,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { } return false; case DF(MAC_B): - if ((fn_make_flag && record->event.pressed) && (alarm_flag == 0)) { - alarm_flag = true; - rgb_matrix_toggle_noeeprom(); - current_time = timer_read(); - + if (record->event.pressed) { set_single_persistent_default_layer(MAC_B); layer_state_set(1 << MAC_B); keymap_config.no_gui = 0; @@ -452,112 +193,21 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { return false; case TG(WIN_W): if (record->event.pressed) { - alarm_flag = true; - rgb_matrix_toggle_noeeprom(); - current_time = timer_read(); kb_config._WASD_layer_flag = !layer_state_is(WIN_W); eeconfig_update_kb(kb_config.raw); } return true; case TG(MAC_W): if (record->event.pressed) { - alarm_flag = true; - rgb_matrix_toggle_noeeprom(); - current_time = timer_read(); kb_config._WASD_layer_flag = !layer_state_is(MAC_W); eeconfig_update_kb(kb_config.raw); } return true; case GU_TOGG: - if ((fn_make_flag && record->event.pressed) && (alarm_flag == 0)) { - alarm_flag = true; - rgb_matrix_toggle_noeeprom(); - current_time = timer_read(); - writePin(C11, !keymap_config.no_gui); + if (record->event.pressed) { + writePin(LED_WIN_LOCK_PIN, !keymap_config.no_gui); } return true; - case RGB_VAI: - if ((RGB_HSV_level = (uint8_t)rgb_matrix_get_val() / (RGB_MATRIX_MAXIMUM_BRIGHTNESS / 4)) < 4) { - if (!record->event.pressed) { - RGB_HSV_level++; - rgb_matrix_config.hsv.v = (uint8_t)(RGB_MATRIX_MAXIMUM_BRIGHTNESS / 4) * RGB_HSV_level; - rgb_matrix_sethsv(rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v); - } else { - if (!alarm_flag) { - alarm_cnt = 2; - } - } - } - return false; - case RGB_VAD: - if ((RGB_HSV_level = (uint8_t)rgb_matrix_get_val() / (RGB_MATRIX_MAXIMUM_BRIGHTNESS / 4)) > 0) { - if (!record->event.pressed) { - RGB_HSV_level--; - rgb_matrix_config.hsv.v = (uint8_t)(RGB_MATRIX_MAXIMUM_BRIGHTNESS / 4) * RGB_HSV_level; - rgb_matrix_sethsv(rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v); - } else { - if (!alarm_flag) { - alarm_cnt = 2; - } - } - } - return false; - case RGB_SAI: - if ((RGB_HSV_level = (uint8_t)rgb_matrix_get_sat() / (UINT8_MAX / 4)) < 4) { - if (!record->event.pressed) { - RGB_HSV_level++; - rgb_matrix_config.hsv.s = (uint8_t)(UINT8_MAX / 4) * RGB_HSV_level; - rgb_matrix_sethsv(rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v); - } else { - if (!alarm_flag) { - alarm_cnt = 2; - } - } - } - - return false; - case RGB_SAD: - if ((RGB_HSV_level = (uint8_t)rgb_matrix_get_sat() / (UINT8_MAX / 4)) > 0) { - if (!record->event.pressed) { - RGB_HSV_level--; - rgb_matrix_config.hsv.s = (uint8_t)(UINT8_MAX / 4) * RGB_HSV_level; - rgb_matrix_sethsv(rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v); - } else { - if (!alarm_flag) { - alarm_cnt = 2; - } - } - } - return false; - case RGB_HUI: - if ((fn_make_flag && record->event.pressed) && (alarm_flag == 0)) { - alarm_cnt = 2; - RGB_HSV_level = (uint8_t)rgb_matrix_get_hue() / (UINT8_MAX / 6); - RGB_HSV_level++; - RGB_HSV_level %= 7; - rgb_matrix_config.hsv.h = (uint8_t)(UINT8_MAX / 6) * RGB_HSV_level; - rgb_matrix_sethsv(rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v); - } - return false; - case RGB_SPI: - if ((fn_make_flag && record->event.pressed) && (alarm_flag == 0)) { - if ((RGB_HSV_level = (uint8_t)rgb_matrix_get_speed() / (UINT8_MAX / 4)) < 4) { - alarm_cnt = 2; - RGB_HSV_level++; - rgb_matrix_set_speed((uint8_t)(UINT8_MAX / 4) * RGB_HSV_level); - } - } - return false; - case RGB_SPD: - if ((fn_make_flag && record->event.pressed) && (alarm_flag == 0)) { - if ((RGB_HSV_level = (uint8_t)rgb_matrix_get_speed() / (UINT8_MAX / 4)) > 0) { - alarm_cnt = 2; - RGB_HSV_level--; - rgb_matrix_set_speed((uint8_t)(UINT8_MAX / 4) * RGB_HSV_level); - } - } - return false; - case RGB_TOG: if (record->event.pressed) { switch (rgb_matrix_get_flags()) { @@ -575,131 +225,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { rgb_matrix_enable(); } return false; -#endif//DISABLE_M3_KEYCODES default: return true; } -} - -void housekeeping_task_kb(void) { - if (Lkey_flag) { - if (scancode == KC_LGUI) { - if (timer_elapsed(current_time) >= 3000) { - Lkey_flag = false; - clear_eeprom(); - - current_time = timer_read(); - reset_glint_flag = true; - glint_cnt = 0; - rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_COLOR); - rgb_matrix_sethsv_noeeprom(HSV_OFF); - } - } else if (scancode == KC_LCTL) { - if (timer_elapsed(current_time) >= 3000) { - Lkey_flag = false; - clear_eeprom(); - - while_test_flag = true; - glint_cnt = 0; - rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_COLOR); - rgb_matrix_sethsv_noeeprom(HSV_WHITE); - } - } - } else if (reset_glint_flag) { - if ((timer_elapsed(current_time)) >= 300) { - current_time = timer_read(); - if (((glint_cnt++) & 0x01) == 0) { - rgb_matrix_sethsv_noeeprom(HSV_WHITE); - } else { - rgb_matrix_sethsv_noeeprom(HSV_OFF); - } - if (glint_cnt >= 3) { - glint_cnt = 0; - reset_glint_flag = false; - rgb_matrix_init(); - } - } - - } else if (while_test_flag) { - if ((timer_elapsed(current_time)) >= 1000) { - current_time = timer_read(); - if ((glint_cnt % 4) == 0) { - rgb_matrix_sethsv_noeeprom(HSV_RED); - } else if ((glint_cnt % 4) == 1) { - rgb_matrix_sethsv_noeeprom(HSV_GREEN); - } else if ((glint_cnt % 4) == 2) { - rgb_matrix_sethsv_noeeprom(HSV_BLUE); - } else if ((glint_cnt % 4) == 3) { - rgb_matrix_sethsv_noeeprom(HSV_WHITE); - } - glint_cnt++; - if (glint_cnt >= 30) { - glint_cnt = 0; - while_test_flag = false; - rgb_matrix_init(); - } - } - } else if (alarm_cnt != 0) { - alarm_cnt--; - if (alarm_cnt == 0) { - alarm_flag = true; - rgb_matrix_toggle_noeeprom(); - current_time = timer_read(); - } - } else if (alarm_flag) { - if ((timer_elapsed(current_time)) >= 50) { - rgb_matrix_toggle_noeeprom(); - alarm_flag = 0; - } - } -} - -void led_test(uint8_t color) { - rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_COLOR); - - switch (color) { - case WHITE: - rgb_matrix_sethsv_noeeprom(HSV_WHITE); - break; - - case RED: - rgb_matrix_sethsv_noeeprom(HSV_RED); - break; - - case GREEN: - rgb_matrix_sethsv_noeeprom(HSV_GREEN); - break; - - case BLUE: - rgb_matrix_sethsv_noeeprom(HSV_BLUE); - break; - } -} - -void clear_eeprom(void) { - eeconfig_init(); - if (layer_state_is(MAC_B)) { - set_single_persistent_default_layer(MAC_B); - // layer_state_set(1< Date: Wed, 31 May 2023 20:13:12 +0800 Subject: [PATCH 10/37] Update keyboards/monsgeek/m3/info.json Co-authored-by: Ryan --- keyboards/monsgeek/m3/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/monsgeek/m3/info.json b/keyboards/monsgeek/m3/info.json index 37bb4a583d1d..18183754db2b 100644 --- a/keyboards/monsgeek/m3/info.json +++ b/keyboards/monsgeek/m3/info.json @@ -22,7 +22,7 @@ "rgb_matrix": true }, "matrix_pins": { - "cols": ["C1","C2","C3","A0","A1","A2","A3","A4","A5","A6","A7","C4","C5","B0","B1","B2","B10"], + "cols": ["C1", "C2", "C3", "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "C4", "C5", "B0", "B1", "B2", "B10"], "rows": ["B15", "C6", "C7", "C8", "C9", "A8"] }, "diode_direction": "ROW2COL", From a8dd4bb93ba5ad2f8fc574f055ccc3f6d882de18 Mon Sep 17 00:00:00 2001 From: Joy Lee Date: Wed, 31 May 2023 20:13:19 +0800 Subject: [PATCH 11/37] Update keyboards/monsgeek/m3/info.json Co-authored-by: Ryan --- keyboards/monsgeek/m3/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/monsgeek/m3/info.json b/keyboards/monsgeek/m3/info.json index 18183754db2b..01a87c2da720 100644 --- a/keyboards/monsgeek/m3/info.json +++ b/keyboards/monsgeek/m3/info.json @@ -1,5 +1,5 @@ { - "keyboard_name": "MonsGeek Keyboard", + "keyboard_name": "M3", "manufacturer": "MonsGeek", "maintainer": "jonylee@hfd", "usb": { From 7854dbe2de41246b45758dbbdf0b61f8c01018ea Mon Sep 17 00:00:00 2001 From: "jonylee@hfd" <108282809+jonylee1986@users.noreply.github.com> Date: Fri, 9 Jun 2023 09:37:11 +0800 Subject: [PATCH 12/37] Update readme.md --- keyboards/monsgeek/m3/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/monsgeek/m3/readme.md b/keyboards/monsgeek/m3/readme.md index 96adc0ad01d5..330c9d8efa75 100644 --- a/keyboards/monsgeek/m3/readme.md +++ b/keyboards/monsgeek/m3/readme.md @@ -1,6 +1,6 @@ # m3 -A customizable 80% encoder keyboard. +A customizable 80% keyboard. * Keyboard Maintainer: [jonylee@hfd](https://github.com/jonylee1986) * Hardware Supported: m3 From 8622274ff13f872e1ed753aa9594865919493b0d Mon Sep 17 00:00:00 2001 From: "jonylee@hfd" <108282809+jonylee1986@users.noreply.github.com> Date: Fri, 18 Aug 2023 09:18:01 +0800 Subject: [PATCH 13/37] Update keyboards/monsgeek/m3/config.h Co-authored-by: Duncan Sutherland --- keyboards/monsgeek/m3/config.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/keyboards/monsgeek/m3/config.h b/keyboards/monsgeek/m3/config.h index 05f07aece534..ecafeb806bc1 100644 --- a/keyboards/monsgeek/m3/config.h +++ b/keyboards/monsgeek/m3/config.h @@ -16,9 +16,6 @@ #pragma once -/* Use 6 dynamic keymap layers */ -#define DYNAMIC_KEYMAP_LAYER_COUNT 6 - /* LED Indicators */ #define LED_MAC_OS_PIN C10 #define LED_WIN_LOCK_PIN C11 From 804e2f89a359e1ad3e07a9877f8b0509af634a2b Mon Sep 17 00:00:00 2001 From: "jonylee@hfd" <108282809+jonylee1986@users.noreply.github.com> Date: Fri, 18 Aug 2023 09:18:06 +0800 Subject: [PATCH 14/37] Update keyboards/monsgeek/m3/info.json Co-authored-by: Duncan Sutherland --- keyboards/monsgeek/m3/info.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/keyboards/monsgeek/m3/info.json b/keyboards/monsgeek/m3/info.json index 01a87c2da720..6a37d979dd6e 100644 --- a/keyboards/monsgeek/m3/info.json +++ b/keyboards/monsgeek/m3/info.json @@ -21,6 +21,9 @@ "encoder": false, "rgb_matrix": true }, + "dynamic_keymap": { + "layer_count": 6 + }, "matrix_pins": { "cols": ["C1", "C2", "C3", "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "C4", "C5", "B0", "B1", "B2", "B10"], "rows": ["B15", "C6", "C7", "C8", "C9", "A8"] From f36399b2868bb16f83cee3ed838417d08826fdc3 Mon Sep 17 00:00:00 2001 From: "jonylee@hfd" <108282809+jonylee1986@users.noreply.github.com> Date: Fri, 18 Aug 2023 09:18:14 +0800 Subject: [PATCH 15/37] Update keyboards/monsgeek/m3/info.json Co-authored-by: Duncan Sutherland --- keyboards/monsgeek/m3/info.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/keyboards/monsgeek/m3/info.json b/keyboards/monsgeek/m3/info.json index 6a37d979dd6e..44cd0f2f4a2c 100644 --- a/keyboards/monsgeek/m3/info.json +++ b/keyboards/monsgeek/m3/info.json @@ -150,8 +150,9 @@ ] }, + "community_layouts": ["tkl_ansi"], "layouts": { - "LAYOUT": { + "LAYOUT_tkl_ansi": { "layout": [ { "label": "Esc", "matrix": [0, 0], "x": 0, "y": 0 }, { "label": "F1", "matrix": [0, 1], "x": 2, "y": 0 }, From 4d3c59a9ae9e4686e766b6ae9e6d514db508c741 Mon Sep 17 00:00:00 2001 From: "jonylee@hfd" <108282809+jonylee1986@users.noreply.github.com> Date: Fri, 18 Aug 2023 09:18:27 +0800 Subject: [PATCH 16/37] Update keyboards/monsgeek/m3/keymaps/default/keymap.c Co-authored-by: Duncan Sutherland --- keyboards/monsgeek/m3/keymaps/default/keymap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/monsgeek/m3/keymaps/default/keymap.c b/keyboards/monsgeek/m3/keymaps/default/keymap.c index 88bfbc8e1fdc..7122c4694bf9 100644 --- a/keyboards/monsgeek/m3/keymaps/default/keymap.c +++ b/keyboards/monsgeek/m3/keymaps/default/keymap.c @@ -28,7 +28,7 @@ enum __layers { // clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [WIN_B] = LAYOUT( /* Base */ + [WIN_B] = LAYOUT_tkl_ansi( /* Base */ KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, @@ -36,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(WIN_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - [WIN_W] = LAYOUT( /* Base */ + [WIN_W] = LAYOUT_tkl_ansi( /* Base */ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -45,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, MO(WIN_FN), _______, KC_A, KC_S, KC_D), - [WIN_FN] = LAYOUT( /* FN */ + [WIN_FN] = LAYOUT_tkl_ansi( /* FN */ _______, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_MSEL, KC_MPLY, KC_MPRV, KC_MNXT, _______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______,TG(WIN_W),_______, _______, _______, _______, _______, _______, DF(MAC_B),_______,_______, _______, RGB_MOD, _______, _______, _______, @@ -53,7 +53,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, KC_CALC, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_VAI, _______, GU_TOGG, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_VAD, RGB_SAI), - [MAC_B] = LAYOUT( /* Base */ + [MAC_B] = LAYOUT_tkl_ansi( /* Base */ KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, KC_F5, KC_F6, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_SCRL, KC_PAUS, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, @@ -61,14 +61,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, MO(MAC_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - [MAC_W] = LAYOUT( /* Base */ + [MAC_W] = LAYOUT_tkl_ansi( /* Base */ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_W, _______, _______, _______, _______, _______, _______, MO(MAC_FN), _______, KC_A, KC_S, KC_D), - [MAC_FN] = LAYOUT( /* FN */ + [MAC_FN] = LAYOUT_tkl_ansi( /* FN */ KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______,TG(MAC_W),_______, _______, _______, _______, _______, _______, DF(WIN_B),_______,_______, _______, RGB_MOD, _______, _______, _______, From fa123fc08d26e522a5e98652f68bcd745be1f49a Mon Sep 17 00:00:00 2001 From: "jonylee@hfd" <108282809+jonylee1986@users.noreply.github.com> Date: Fri, 18 Aug 2023 09:18:48 +0800 Subject: [PATCH 17/37] Update keyboards/monsgeek/m3/keymaps/via/keymap.c Co-authored-by: Duncan Sutherland --- keyboards/monsgeek/m3/keymaps/via/keymap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/monsgeek/m3/keymaps/via/keymap.c b/keyboards/monsgeek/m3/keymaps/via/keymap.c index 88bfbc8e1fdc..7122c4694bf9 100644 --- a/keyboards/monsgeek/m3/keymaps/via/keymap.c +++ b/keyboards/monsgeek/m3/keymaps/via/keymap.c @@ -28,7 +28,7 @@ enum __layers { // clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [WIN_B] = LAYOUT( /* Base */ + [WIN_B] = LAYOUT_tkl_ansi( /* Base */ KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, @@ -36,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(WIN_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - [WIN_W] = LAYOUT( /* Base */ + [WIN_W] = LAYOUT_tkl_ansi( /* Base */ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -45,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, MO(WIN_FN), _______, KC_A, KC_S, KC_D), - [WIN_FN] = LAYOUT( /* FN */ + [WIN_FN] = LAYOUT_tkl_ansi( /* FN */ _______, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_MSEL, KC_MPLY, KC_MPRV, KC_MNXT, _______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______,TG(WIN_W),_______, _______, _______, _______, _______, _______, DF(MAC_B),_______,_______, _______, RGB_MOD, _______, _______, _______, @@ -53,7 +53,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, KC_CALC, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_VAI, _______, GU_TOGG, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_VAD, RGB_SAI), - [MAC_B] = LAYOUT( /* Base */ + [MAC_B] = LAYOUT_tkl_ansi( /* Base */ KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, KC_F5, KC_F6, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_SCRL, KC_PAUS, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, @@ -61,14 +61,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, MO(MAC_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - [MAC_W] = LAYOUT( /* Base */ + [MAC_W] = LAYOUT_tkl_ansi( /* Base */ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_W, _______, _______, _______, _______, _______, _______, MO(MAC_FN), _______, KC_A, KC_S, KC_D), - [MAC_FN] = LAYOUT( /* FN */ + [MAC_FN] = LAYOUT_tkl_ansi( /* FN */ KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______,TG(MAC_W),_______, _______, _______, _______, _______, _______, DF(WIN_B),_______,_______, _______, RGB_MOD, _______, _______, _______, From f59f78a93f1acc4b2dc522a6c7ad047e6826cbd4 Mon Sep 17 00:00:00 2001 From: "jonylee@hfd" <108282809+jonylee1986@users.noreply.github.com> Date: Fri, 18 Aug 2023 09:18:55 +0800 Subject: [PATCH 18/37] Update keyboards/monsgeek/m3/readme.md Co-authored-by: Duncan Sutherland --- keyboards/monsgeek/m3/readme.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/keyboards/monsgeek/m3/readme.md b/keyboards/monsgeek/m3/readme.md index 330c9d8efa75..a3f9b6a4570a 100644 --- a/keyboards/monsgeek/m3/readme.md +++ b/keyboards/monsgeek/m3/readme.md @@ -14,6 +14,11 @@ Flashing example for this keyboard: make monsgeek/m3:default:flash -**Reset Key**: Hold down the key located at *K000*, which programmed as *Esc* while plugging in the keyboard. - See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). + +## Bootloader + +Enter the bootloader in 2 ways: + +* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available From 432f0aaec37ca2a0a3c43df8123367e8eebab31a Mon Sep 17 00:00:00 2001 From: "jonylee@hfd" <108282809+jonylee1986@users.noreply.github.com> Date: Fri, 18 Aug 2023 09:57:27 +0800 Subject: [PATCH 19/37] Update m3.c --- keyboards/monsgeek/m3/m3.c | 48 +++++++------------------------------- 1 file changed, 9 insertions(+), 39 deletions(-) diff --git a/keyboards/monsgeek/m3/m3.c b/keyboards/monsgeek/m3/m3.c index fbaa0c9d13de..13dbd358d8be 100644 --- a/keyboards/monsgeek/m3/m3.c +++ b/keyboards/monsgeek/m3/m3.c @@ -125,26 +125,16 @@ const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { }; #endif // RGB_MATRIX_ENABLE -enum __layers { WIN_B, WIN_W, WIN_FN, MAC_B, MAC_W, MAC_FN }; - // clang-format on -typedef union { - uint32_t raw; - struct { - bool MacMode_flag : 1; - bool _WASD_layer_flag : 1; - }; -} kb_config_t; - -kb_config_t kb_config; +enum __layers { + WIN_B, + WIN_W, + WIN_FN, + MAC_B, + MAC_W, + MAC_FN, +}; -void keyboard_post_init_kb(void) { - kb_config.raw = eeconfig_read_kb(); // Read status from EEPROM - if (kb_config.MacMode_flag) layer_on(MAC_B); - if (kb_config._WASD_layer_flag) { - kb_config.MacMode_flag ? layer_on(MAC_W) : layer_on(WIN_W); - } -} void led_init_ports(void) { // set our LED pings as output @@ -174,35 +164,15 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { case DF(WIN_B): if (record->event.pressed) { set_single_persistent_default_layer(WIN_B); - layer_state_set(1 << WIN_B); - kb_config.MacMode_flag = false; - kb_config._WASD_layer_flag = false; - eeconfig_update_kb(kb_config.raw); } return false; case DF(MAC_B): if (record->event.pressed) { set_single_persistent_default_layer(MAC_B); - layer_state_set(1 << MAC_B); keymap_config.no_gui = 0; eeconfig_update_keymap(keymap_config.raw); - kb_config.MacMode_flag = true; - kb_config._WASD_layer_flag = false; - eeconfig_update_kb(kb_config.raw); } return false; - case TG(WIN_W): - if (record->event.pressed) { - kb_config._WASD_layer_flag = !layer_state_is(WIN_W); - eeconfig_update_kb(kb_config.raw); - } - return true; - case TG(MAC_W): - if (record->event.pressed) { - kb_config._WASD_layer_flag = !layer_state_is(MAC_W); - eeconfig_update_kb(kb_config.raw); - } - return true; case GU_TOGG: if (record->event.pressed) { writePin(LED_WIN_LOCK_PIN, !keymap_config.no_gui); @@ -228,4 +198,4 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) { default: return true; } -} \ No newline at end of file +} From 693cea4c441061a65e42ecf683896cf693094aff Mon Sep 17 00:00:00 2001 From: "jonylee@hfd" <108282809+jonylee1986@users.noreply.github.com> Date: Fri, 18 Aug 2023 10:08:39 +0800 Subject: [PATCH 20/37] Update m3.c --- keyboards/monsgeek/m3/m3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/monsgeek/m3/m3.c b/keyboards/monsgeek/m3/m3.c index 13dbd358d8be..e7401ee6f511 100644 --- a/keyboards/monsgeek/m3/m3.c +++ b/keyboards/monsgeek/m3/m3.c @@ -150,7 +150,7 @@ bool led_update_kb(led_t led_state) { bool res = led_update_user(led_state); if (res) { writePin(LED_CAPS_LOCK_PIN, led_state.caps_lock); - writePin(LED_MAC_OS_PIN, kb_config.MacMode_flag); + writePin(LED_MAC_OS_PIN, (get_highest_layer(default_layer_state) == 3)); writePin(LED_WIN_LOCK_PIN, keymap_config.no_gui); } return res; From 846cdc0700900f79417741bd6d49405f44657140 Mon Sep 17 00:00:00 2001 From: "jonylee@hfd" <108282809+jonylee1986@users.noreply.github.com> Date: Fri, 18 Aug 2023 10:46:25 +0800 Subject: [PATCH 21/37] Update info.json --- keyboards/monsgeek/m3/info.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/keyboards/monsgeek/m3/info.json b/keyboards/monsgeek/m3/info.json index 44cd0f2f4a2c..8387f5b7fead 100644 --- a/keyboards/monsgeek/m3/info.json +++ b/keyboards/monsgeek/m3/info.json @@ -147,12 +147,10 @@ { "flags": 4, "matrix": [5, 14], "x":196, "y": 64}, { "flags": 4, "matrix": [5, 15], "x":210, "y": 64}, { "flags": 4, "matrix": [5, 16], "x":224, "y": 64} - ] }, - "community_layouts": ["tkl_ansi"], "layouts": { - "LAYOUT_tkl_ansi": { + "LAYOUT": { "layout": [ { "label": "Esc", "matrix": [0, 0], "x": 0, "y": 0 }, { "label": "F1", "matrix": [0, 1], "x": 2, "y": 0 }, From ead9b7db0ff213763727a702f796bb997ec79521 Mon Sep 17 00:00:00 2001 From: "jonylee@hfd" <108282809+jonylee1986@users.noreply.github.com> Date: Fri, 18 Aug 2023 10:46:52 +0800 Subject: [PATCH 22/37] Update keymap.c --- keyboards/monsgeek/m3/keymaps/default/keymap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/monsgeek/m3/keymaps/default/keymap.c b/keyboards/monsgeek/m3/keymaps/default/keymap.c index 7122c4694bf9..88bfbc8e1fdc 100644 --- a/keyboards/monsgeek/m3/keymaps/default/keymap.c +++ b/keyboards/monsgeek/m3/keymaps/default/keymap.c @@ -28,7 +28,7 @@ enum __layers { // clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [WIN_B] = LAYOUT_tkl_ansi( /* Base */ + [WIN_B] = LAYOUT( /* Base */ KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, @@ -36,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(WIN_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - [WIN_W] = LAYOUT_tkl_ansi( /* Base */ + [WIN_W] = LAYOUT( /* Base */ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -45,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, MO(WIN_FN), _______, KC_A, KC_S, KC_D), - [WIN_FN] = LAYOUT_tkl_ansi( /* FN */ + [WIN_FN] = LAYOUT( /* FN */ _______, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_MSEL, KC_MPLY, KC_MPRV, KC_MNXT, _______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______,TG(WIN_W),_______, _______, _______, _______, _______, _______, DF(MAC_B),_______,_______, _______, RGB_MOD, _______, _______, _______, @@ -53,7 +53,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, KC_CALC, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_VAI, _______, GU_TOGG, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_VAD, RGB_SAI), - [MAC_B] = LAYOUT_tkl_ansi( /* Base */ + [MAC_B] = LAYOUT( /* Base */ KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, KC_F5, KC_F6, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_SCRL, KC_PAUS, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, @@ -61,14 +61,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, MO(MAC_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - [MAC_W] = LAYOUT_tkl_ansi( /* Base */ + [MAC_W] = LAYOUT( /* Base */ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_W, _______, _______, _______, _______, _______, _______, MO(MAC_FN), _______, KC_A, KC_S, KC_D), - [MAC_FN] = LAYOUT_tkl_ansi( /* FN */ + [MAC_FN] = LAYOUT( /* FN */ KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______,TG(MAC_W),_______, _______, _______, _______, _______, _______, DF(WIN_B),_______,_______, _______, RGB_MOD, _______, _______, _______, From 73ecb2644c4b2d8c73d266a9b745cc08e151eb3c Mon Sep 17 00:00:00 2001 From: "jonylee@hfd" <108282809+jonylee1986@users.noreply.github.com> Date: Fri, 18 Aug 2023 10:47:16 +0800 Subject: [PATCH 23/37] Update keymap.c --- keyboards/monsgeek/m3/keymaps/via/keymap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/monsgeek/m3/keymaps/via/keymap.c b/keyboards/monsgeek/m3/keymaps/via/keymap.c index 7122c4694bf9..88bfbc8e1fdc 100644 --- a/keyboards/monsgeek/m3/keymaps/via/keymap.c +++ b/keyboards/monsgeek/m3/keymaps/via/keymap.c @@ -28,7 +28,7 @@ enum __layers { // clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [WIN_B] = LAYOUT_tkl_ansi( /* Base */ + [WIN_B] = LAYOUT( /* Base */ KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, @@ -36,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(WIN_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - [WIN_W] = LAYOUT_tkl_ansi( /* Base */ + [WIN_W] = LAYOUT( /* Base */ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -45,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, MO(WIN_FN), _______, KC_A, KC_S, KC_D), - [WIN_FN] = LAYOUT_tkl_ansi( /* FN */ + [WIN_FN] = LAYOUT( /* FN */ _______, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_MSEL, KC_MPLY, KC_MPRV, KC_MNXT, _______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______,TG(WIN_W),_______, _______, _______, _______, _______, _______, DF(MAC_B),_______,_______, _______, RGB_MOD, _______, _______, _______, @@ -53,7 +53,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, KC_CALC, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_VAI, _______, GU_TOGG, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_VAD, RGB_SAI), - [MAC_B] = LAYOUT_tkl_ansi( /* Base */ + [MAC_B] = LAYOUT( /* Base */ KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, KC_F5, KC_F6, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_SCRL, KC_PAUS, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, @@ -61,14 +61,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, MO(MAC_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - [MAC_W] = LAYOUT_tkl_ansi( /* Base */ + [MAC_W] = LAYOUT( /* Base */ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_W, _______, _______, _______, _______, _______, _______, MO(MAC_FN), _______, KC_A, KC_S, KC_D), - [MAC_FN] = LAYOUT_tkl_ansi( /* FN */ + [MAC_FN] = LAYOUT( /* FN */ KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______,TG(MAC_W),_______, _______, _______, _______, _______, _______, DF(WIN_B),_______,_______, _______, RGB_MOD, _______, _______, _______, From 2dbdaa4dd1b5e812e5f21517307730d1d24c70f2 Mon Sep 17 00:00:00 2001 From: "jonylee@hfd" <108282809+jonylee1986@users.noreply.github.com> Date: Fri, 18 Aug 2023 11:31:22 +0800 Subject: [PATCH 24/37] Update config.h --- keyboards/monsgeek/m3/config.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/keyboards/monsgeek/m3/config.h b/keyboards/monsgeek/m3/config.h index ecafeb806bc1..85eb5b8e99e7 100644 --- a/keyboards/monsgeek/m3/config.h +++ b/keyboards/monsgeek/m3/config.h @@ -48,7 +48,3 @@ #define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended #define RGB_MATRIX_FRAMEBUFFER_EFFECTS #define RGB_MATRIX_KEYPRESSES -#define RGB_MATRIX_KEYRELEASES - - - From 49ea7976a3c232c16d683c8f79e546c1fbc8e3e4 Mon Sep 17 00:00:00 2001 From: "jonylee@hfd" <108282809+jonylee1986@users.noreply.github.com> Date: Fri, 18 Aug 2023 16:19:43 +0800 Subject: [PATCH 25/37] Update keyboards/monsgeek/m3/readme.md Co-authored-by: Duncan Sutherland --- keyboards/monsgeek/m3/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/monsgeek/m3/readme.md b/keyboards/monsgeek/m3/readme.md index a3f9b6a4570a..32e9112276b3 100644 --- a/keyboards/monsgeek/m3/readme.md +++ b/keyboards/monsgeek/m3/readme.md @@ -1,9 +1,9 @@ -# m3 +# MonsGeek M3 A customizable 80% keyboard. * Keyboard Maintainer: [jonylee@hfd](https://github.com/jonylee1986) -* Hardware Supported: m3 +* Hardware Supported: MonsGeek M3 PCB * Hardware Availability: [monsgeek](https://www.monsgeek.com/) Make example for this keyboard (after setting up your build environment): From 3d6b6c6e43955e88e19383b456c09565afc1fde6 Mon Sep 17 00:00:00 2001 From: "jonylee@hfd" <108282809+jonylee1986@users.noreply.github.com> Date: Fri, 18 Aug 2023 16:19:59 +0800 Subject: [PATCH 26/37] Update keyboards/monsgeek/m3/rules.mk Co-authored-by: Duncan Sutherland --- keyboards/monsgeek/m3/rules.mk | 4 ---- 1 file changed, 4 deletions(-) diff --git a/keyboards/monsgeek/m3/rules.mk b/keyboards/monsgeek/m3/rules.mk index b753f0682e56..24d5f6f52ecc 100644 --- a/keyboards/monsgeek/m3/rules.mk +++ b/keyboards/monsgeek/m3/rules.mk @@ -1,6 +1,2 @@ -# Build Options -# change yes to no to disable -# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = spi_flash - From 012206e3aea0ed466b3fb5a106459cc0bb7c7355 Mon Sep 17 00:00:00 2001 From: "jonylee@hfd" <108282809+jonylee1986@users.noreply.github.com> Date: Mon, 21 Aug 2023 09:23:22 +0800 Subject: [PATCH 27/37] Update keyboards/monsgeek/m3/info.json Co-authored-by: Duncan Sutherland --- keyboards/monsgeek/m3/info.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/keyboards/monsgeek/m3/info.json b/keyboards/monsgeek/m3/info.json index 8387f5b7fead..7a8371880c76 100644 --- a/keyboards/monsgeek/m3/info.json +++ b/keyboards/monsgeek/m3/info.json @@ -149,8 +149,9 @@ { "flags": 4, "matrix": [5, 16], "x":224, "y": 64} ] }, + "community_layouts": ["tkl_ansi"], "layouts": { - "LAYOUT": { + "LAYOUT_tkl_ansi": { "layout": [ { "label": "Esc", "matrix": [0, 0], "x": 0, "y": 0 }, { "label": "F1", "matrix": [0, 1], "x": 2, "y": 0 }, From abfc256aeceb3fcf1487c8e002aa5e5acb8c15fe Mon Sep 17 00:00:00 2001 From: "jonylee@hfd" <108282809+jonylee1986@users.noreply.github.com> Date: Mon, 21 Aug 2023 09:23:33 +0800 Subject: [PATCH 28/37] Update keyboards/monsgeek/m3/keymaps/default/keymap.c Co-authored-by: Duncan Sutherland --- keyboards/monsgeek/m3/keymaps/default/keymap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/monsgeek/m3/keymaps/default/keymap.c b/keyboards/monsgeek/m3/keymaps/default/keymap.c index 88bfbc8e1fdc..7122c4694bf9 100644 --- a/keyboards/monsgeek/m3/keymaps/default/keymap.c +++ b/keyboards/monsgeek/m3/keymaps/default/keymap.c @@ -28,7 +28,7 @@ enum __layers { // clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [WIN_B] = LAYOUT( /* Base */ + [WIN_B] = LAYOUT_tkl_ansi( /* Base */ KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, @@ -36,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(WIN_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - [WIN_W] = LAYOUT( /* Base */ + [WIN_W] = LAYOUT_tkl_ansi( /* Base */ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -45,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, MO(WIN_FN), _______, KC_A, KC_S, KC_D), - [WIN_FN] = LAYOUT( /* FN */ + [WIN_FN] = LAYOUT_tkl_ansi( /* FN */ _______, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_MSEL, KC_MPLY, KC_MPRV, KC_MNXT, _______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______,TG(WIN_W),_______, _______, _______, _______, _______, _______, DF(MAC_B),_______,_______, _______, RGB_MOD, _______, _______, _______, @@ -53,7 +53,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, KC_CALC, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_VAI, _______, GU_TOGG, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_VAD, RGB_SAI), - [MAC_B] = LAYOUT( /* Base */ + [MAC_B] = LAYOUT_tkl_ansi( /* Base */ KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, KC_F5, KC_F6, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_SCRL, KC_PAUS, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, @@ -61,14 +61,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, MO(MAC_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - [MAC_W] = LAYOUT( /* Base */ + [MAC_W] = LAYOUT_tkl_ansi( /* Base */ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_W, _______, _______, _______, _______, _______, _______, MO(MAC_FN), _______, KC_A, KC_S, KC_D), - [MAC_FN] = LAYOUT( /* FN */ + [MAC_FN] = LAYOUT_tkl_ansi( /* FN */ KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______,TG(MAC_W),_______, _______, _______, _______, _______, _______, DF(WIN_B),_______,_______, _______, RGB_MOD, _______, _______, _______, From 956e15445f7a394dc438678f678429fb580e7195 Mon Sep 17 00:00:00 2001 From: "jonylee@hfd" <108282809+jonylee1986@users.noreply.github.com> Date: Mon, 21 Aug 2023 09:24:18 +0800 Subject: [PATCH 29/37] Update keyboards/monsgeek/m3/keymaps/via/keymap.c Co-authored-by: Duncan Sutherland --- keyboards/monsgeek/m3/keymaps/via/keymap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/monsgeek/m3/keymaps/via/keymap.c b/keyboards/monsgeek/m3/keymaps/via/keymap.c index 88bfbc8e1fdc..7122c4694bf9 100644 --- a/keyboards/monsgeek/m3/keymaps/via/keymap.c +++ b/keyboards/monsgeek/m3/keymaps/via/keymap.c @@ -28,7 +28,7 @@ enum __layers { // clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [WIN_B] = LAYOUT( /* Base */ + [WIN_B] = LAYOUT_tkl_ansi( /* Base */ KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, @@ -36,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(WIN_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - [WIN_W] = LAYOUT( /* Base */ + [WIN_W] = LAYOUT_tkl_ansi( /* Base */ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -45,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, MO(WIN_FN), _______, KC_A, KC_S, KC_D), - [WIN_FN] = LAYOUT( /* FN */ + [WIN_FN] = LAYOUT_tkl_ansi( /* FN */ _______, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_MSEL, KC_MPLY, KC_MPRV, KC_MNXT, _______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______,TG(WIN_W),_______, _______, _______, _______, _______, _______, DF(MAC_B),_______,_______, _______, RGB_MOD, _______, _______, _______, @@ -53,7 +53,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, KC_CALC, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_VAI, _______, GU_TOGG, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_VAD, RGB_SAI), - [MAC_B] = LAYOUT( /* Base */ + [MAC_B] = LAYOUT_tkl_ansi( /* Base */ KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, KC_F5, KC_F6, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_SCRL, KC_PAUS, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, @@ -61,14 +61,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, MO(MAC_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - [MAC_W] = LAYOUT( /* Base */ + [MAC_W] = LAYOUT_tkl_ansi( /* Base */ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_W, _______, _______, _______, _______, _______, _______, MO(MAC_FN), _______, KC_A, KC_S, KC_D), - [MAC_FN] = LAYOUT( /* FN */ + [MAC_FN] = LAYOUT_tkl_ansi( /* FN */ KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, _______, _______, _______, _______, _______,TG(MAC_W),_______, _______, _______, _______, _______, _______, DF(WIN_B),_______,_______, _______, RGB_MOD, _______, _______, _______, From 06ac5be615a4e921fd25d03a733485d90852eab3 Mon Sep 17 00:00:00 2001 From: "jonylee@hfd" <108282809+jonylee1986@users.noreply.github.com> Date: Mon, 21 Aug 2023 09:24:29 +0800 Subject: [PATCH 30/37] Update keyboards/monsgeek/m3/info.json Co-authored-by: Duncan Sutherland --- keyboards/monsgeek/m3/info.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/keyboards/monsgeek/m3/info.json b/keyboards/monsgeek/m3/info.json index 7a8371880c76..23c8a0b62810 100644 --- a/keyboards/monsgeek/m3/info.json +++ b/keyboards/monsgeek/m3/info.json @@ -13,12 +13,10 @@ "bootloader": "wb32-dfu", "features": { "bootmagic": true, - "mousekey": false, "extrakey": true, "console": false, "command": false, "nkro": true, - "encoder": false, "rgb_matrix": true }, "dynamic_keymap": { From 46e81c14dca5c981ef2608be9a944579dd63e7c4 Mon Sep 17 00:00:00 2001 From: "jonylee@hfd" <108282809+jonylee1986@users.noreply.github.com> Date: Tue, 22 Aug 2023 14:17:01 +0800 Subject: [PATCH 31/37] Update keyboards/monsgeek/m3/info.json Co-authored-by: Ryan --- keyboards/monsgeek/m3/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/monsgeek/m3/info.json b/keyboards/monsgeek/m3/info.json index 23c8a0b62810..f1f7a4ad31eb 100644 --- a/keyboards/monsgeek/m3/info.json +++ b/keyboards/monsgeek/m3/info.json @@ -49,7 +49,7 @@ "typing_heatmap": true, "solid_reactive_simple": true, "solid_reactive": true, - "solid_reactive_cross": true, + "solid_reactive_cross": true, "multisplash": true }, "layout":[ From eb35464d0ebbc817be95fe8a59f5429527f61b1d Mon Sep 17 00:00:00 2001 From: "jonylee@hfd" <108282809+jonylee1986@users.noreply.github.com> Date: Wed, 30 Aug 2023 17:43:59 +0800 Subject: [PATCH 32/37] Update keyboards/monsgeek/m3/info.json Co-authored-by: Drashna Jaelre --- keyboards/monsgeek/m3/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/monsgeek/m3/info.json b/keyboards/monsgeek/m3/info.json index f1f7a4ad31eb..d46bdc2bcfea 100644 --- a/keyboards/monsgeek/m3/info.json +++ b/keyboards/monsgeek/m3/info.json @@ -31,7 +31,7 @@ "caps_lock": "A15" }, "rgb_matrix": { - "driver": "IS31FL3733", + "driver": "is31fl3733", "max_brightness": 160, "animations": { "breathing": true, From 9288b1a51b55d156f0447d1f786db7f1630681d5 Mon Sep 17 00:00:00 2001 From: "jonylee@hfd" <108282809+jonylee1986@users.noreply.github.com> Date: Wed, 30 Aug 2023 17:49:31 +0800 Subject: [PATCH 33/37] Update m3.c --- keyboards/monsgeek/m3/m3.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/keyboards/monsgeek/m3/m3.c b/keyboards/monsgeek/m3/m3.c index e7401ee6f511..4266021de951 100644 --- a/keyboards/monsgeek/m3/m3.c +++ b/keyboards/monsgeek/m3/m3.c @@ -135,25 +135,16 @@ enum __layers { MAC_FN, }; - -void led_init_ports(void) { - // set our LED pings as output - setPinOutput(LED_CAPS_LOCK_PIN); // LED1 Num Lock - writePinLow(LED_CAPS_LOCK_PIN); +void matrix_init_kb(void) { setPinOutput(LED_MAC_OS_PIN); // LDE2 MAC\WIN writePinLow(LED_MAC_OS_PIN); setPinOutput(LED_WIN_LOCK_PIN); // LED3 Win Lock writePinLow(LED_WIN_LOCK_PIN); } -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if (res) { - writePin(LED_CAPS_LOCK_PIN, led_state.caps_lock); - writePin(LED_MAC_OS_PIN, (get_highest_layer(default_layer_state) == 3)); - writePin(LED_WIN_LOCK_PIN, keymap_config.no_gui); - } - return res; +void housekeeping_task_kb(void){ + writePin(LED_MAC_OS_PIN, (get_highest_layer(default_layer_state) == 3)); + writePin(LED_WIN_LOCK_PIN, keymap_config.no_gui); } bool process_record_kb(uint16_t keycode, keyrecord_t* record) { From a56c979b80e487c17126700f60d8f061992a537f Mon Sep 17 00:00:00 2001 From: "jonylee@hfd" <108282809+jonylee1986@users.noreply.github.com> Date: Mon, 18 Sep 2023 12:17:54 +0800 Subject: [PATCH 34/37] Update keyboards/monsgeek/m3/info.json Co-authored-by: Ryan --- keyboards/monsgeek/m3/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/monsgeek/m3/info.json b/keyboards/monsgeek/m3/info.json index d46bdc2bcfea..db646103f12c 100644 --- a/keyboards/monsgeek/m3/info.json +++ b/keyboards/monsgeek/m3/info.json @@ -31,7 +31,7 @@ "caps_lock": "A15" }, "rgb_matrix": { - "driver": "is31fl3733", + "driver": "ckled2001", "max_brightness": 160, "animations": { "breathing": true, From 62d4f575a696e35cfbaaf74e99ef2d5bfa3a938e Mon Sep 17 00:00:00 2001 From: "jonylee@hfd" <108282809+jonylee1986@users.noreply.github.com> Date: Mon, 18 Sep 2023 12:18:01 +0800 Subject: [PATCH 35/37] Update keyboards/monsgeek/m3/m3.c Co-authored-by: Ryan --- keyboards/monsgeek/m3/m3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/monsgeek/m3/m3.c b/keyboards/monsgeek/m3/m3.c index 4266021de951..95bfb34789b5 100644 --- a/keyboards/monsgeek/m3/m3.c +++ b/keyboards/monsgeek/m3/m3.c @@ -17,7 +17,7 @@ #include "quantum.h" // clang-format off #ifdef RGB_MATRIX_ENABLE -const is31_led PROGMEM g_is31_leds[RGB_MATRIX_LED_COUNT] = { +const ckled2001_led PROGMEM g_ckled2001_leds[RGB_MATRIX_LED_COUNT] = { /* Refer to IS31 manual for these locations * driver * | R location From dc9e467b17edb0be63e50ff1368e3bcbc02de778 Mon Sep 17 00:00:00 2001 From: "jonylee@hfd" <108282809+jonylee1986@users.noreply.github.com> Date: Wed, 27 Sep 2023 11:00:44 +0800 Subject: [PATCH 36/37] Update keymap.c replace the tabs with spaces --- .../monsgeek/m3/keymaps/default/keymap.c | 70 +++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/keyboards/monsgeek/m3/keymaps/default/keymap.c b/keyboards/monsgeek/m3/keymaps/default/keymap.c index 7122c4694bf9..d075b6067f34 100644 --- a/keyboards/monsgeek/m3/keymaps/default/keymap.c +++ b/keyboards/monsgeek/m3/keymaps/default/keymap.c @@ -29,51 +29,51 @@ enum __layers { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [WIN_B] = LAYOUT_tkl_ansi( /* Base */ - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(WIN_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(WIN_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), [WIN_W] = LAYOUT_tkl_ansi( /* Base */ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_W, - _______, _______, _______, _______, _______, _______, MO(WIN_FN), _______, KC_A, KC_S, KC_D), + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_W, + _______, _______, _______, _______, _______, _______, MO(WIN_FN), _______, KC_A, KC_S, KC_D), [WIN_FN] = LAYOUT_tkl_ansi( /* FN */ _______, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_MSEL, KC_MPLY, KC_MPRV, KC_MNXT, _______,_______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, _______, _______, _______, - _______, _______,TG(WIN_W),_______, _______, _______, _______, _______, _______, DF(MAC_B),_______,_______, _______, RGB_MOD, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, _______, _______, RGB_HUI, - _______, _______, _______, KC_CALC, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_VAI, - _______, GU_TOGG, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_VAD, RGB_SAI), + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, _______, _______, _______, + _______, _______,TG(WIN_W),_______, _______, _______, _______, _______, _______, DF(MAC_B),_______,_______, _______, RGB_MOD, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, _______, _______, RGB_HUI, + _______, _______, _______, KC_CALC, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_VAI, + _______, GU_TOGG, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_VAD, RGB_SAI), [MAC_B] = LAYOUT_tkl_ansi( /* Base */ - KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, KC_F5, KC_F6, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_SCRL, KC_PAUS, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, MO(MAC_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, KC_F5, KC_F6, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_SCRL, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, MO(MAC_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), [MAC_W] = LAYOUT_tkl_ansi( /* Base */ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_W, - _______, _______, _______, _______, _______, _______, MO(MAC_FN), _______, KC_A, KC_S, KC_D), + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_W, + _______, _______, _______, _______, _______, _______, MO(MAC_FN), _______, KC_A, KC_S, KC_D), [MAC_FN] = LAYOUT_tkl_ansi( /* FN */ - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, _______, _______, _______, - _______, _______,TG(MAC_W),_______, _______, _______, _______, _______, _______, DF(WIN_B),_______,_______, _______, RGB_MOD, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, _______, _______, RGB_HUI, - _______, _______, _______, KC_CALC, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_VAI, - _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_VAD, RGB_SAI) + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, _______, _______, _______, + _______, _______,TG(MAC_W),_______, _______, _______, _______, _______, _______, DF(WIN_B),_______,_______, _______, RGB_MOD, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, _______, _______, RGB_HUI, + _______, _______, _______, KC_CALC, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_VAI, + _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_VAD, RGB_SAI) }; // clang-format on From ec7aca8610fe69b323ea0dce4cf44735dadf0789 Mon Sep 17 00:00:00 2001 From: "jonylee@hfd" <108282809+jonylee1986@users.noreply.github.com> Date: Wed, 27 Sep 2023 11:01:03 +0800 Subject: [PATCH 37/37] Update keymap.c replace the tabs with spaces --- keyboards/monsgeek/m3/keymaps/via/keymap.c | 70 +++++++++++----------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/keyboards/monsgeek/m3/keymaps/via/keymap.c b/keyboards/monsgeek/m3/keymaps/via/keymap.c index 7122c4694bf9..d075b6067f34 100644 --- a/keyboards/monsgeek/m3/keymaps/via/keymap.c +++ b/keyboards/monsgeek/m3/keymaps/via/keymap.c @@ -29,51 +29,51 @@ enum __layers { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [WIN_B] = LAYOUT_tkl_ansi( /* Base */ - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(WIN_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(WIN_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), [WIN_W] = LAYOUT_tkl_ansi( /* Base */ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_W, - _______, _______, _______, _______, _______, _______, MO(WIN_FN), _______, KC_A, KC_S, KC_D), + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_W, + _______, _______, _______, _______, _______, _______, MO(WIN_FN), _______, KC_A, KC_S, KC_D), [WIN_FN] = LAYOUT_tkl_ansi( /* FN */ _______, KC_MYCM, KC_MAIL, KC_WSCH, KC_WHOM, KC_MSEL, KC_MPLY, KC_MPRV, KC_MNXT, _______,_______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, _______, _______, _______, - _______, _______,TG(WIN_W),_______, _______, _______, _______, _______, _______, DF(MAC_B),_______,_______, _______, RGB_MOD, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, _______, _______, RGB_HUI, - _______, _______, _______, KC_CALC, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_VAI, - _______, GU_TOGG, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_VAD, RGB_SAI), + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, _______, _______, _______, + _______, _______,TG(WIN_W),_______, _______, _______, _______, _______, _______, DF(MAC_B),_______,_______, _______, RGB_MOD, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, _______, _______, RGB_HUI, + _______, _______, _______, KC_CALC, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_VAI, + _______, GU_TOGG, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_VAD, RGB_SAI), [MAC_B] = LAYOUT_tkl_ansi( /* Base */ - KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, KC_F5, KC_F6, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_SCRL, KC_PAUS, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, MO(MAC_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, KC_F5, KC_F6, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_SCRL, KC_PAUS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, MO(MAC_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), [MAC_W] = LAYOUT_tkl_ansi( /* Base */ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_W, - _______, _______, _______, _______, _______, _______, MO(MAC_FN), _______, KC_A, KC_S, KC_D), + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_W, + _______, _______, _______, _______, _______, _______, MO(MAC_FN), _______, KC_A, KC_S, KC_D), [MAC_FN] = LAYOUT_tkl_ansi( /* FN */ - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, _______, _______, _______, - _______, _______,TG(MAC_W),_______, _______, _______, _______, _______, _______, DF(WIN_B),_______,_______, _______, RGB_MOD, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, _______, _______, RGB_HUI, - _______, _______, _______, KC_CALC, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_VAI, - _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_VAD, RGB_SAI) + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______, _______, _______, _______, + _______, _______,TG(MAC_W),_______, _______, _______, _______, _______, _______, DF(WIN_B),_______,_______, _______, RGB_MOD, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, _______, _______, RGB_HUI, + _______, _______, _______, KC_CALC, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_VAI, + _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_VAD, RGB_SAI) }; // clang-format on