diff options
Diffstat (limited to 'keyboards/mechwild/mokulua')
30 files changed, 682 insertions, 152 deletions
diff --git a/keyboards/mechwild/mokulua/info.json b/keyboards/mechwild/mokulua/info.json deleted file mode 100644 index 0be62ecf80..0000000000 --- a/keyboards/mechwild/mokulua/info.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "keyboard_name": "Mokulua", - "url": "https://mechwild.com", - "maintainer": "kylemccreery", - "layouts": { - "LAYOUT": { - "layout": [{"x":0.5, "y":0}, {"x":1.5, "y":0}, {"x":15.75, "y":0}, {"x":16.75, "y":0}, {"x":0.47, "y":1, "w":1.5}, {"x":1.97, "y":1}, {"x":15.5, "y":1}, {"x":16.5, "y":1, "w":1.5}, {"x":0.37, "y":2, "w":1.75}, {"x":2.12, "y":2}, {"x":15.85, "y":2}, {"x":16.85, "y":2, "w":1.75}, {"x":0.22, "y":3, "w":1.25}, {"x":1.47, "y":3}, {"x":2.47, "y":3}, {"x":9.43, "y":3}, {"x":15.5, "y":3}, {"x":16.5, "y":3}, {"x":17.5, "y":3, "w":1.25}, {"x":0.47, "y":4}, {"x":1.47, "y":4}, {"x":2.47, "y":4}, {"x":9.68, "y":4}, {"x":15.5, "y":4}, {"x":16.5, "y":4}, {"x":17.5, "y":4}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":4, "y":1.25}, {"x":0.5, "y":2.25}, {"x":1.5, "y":2.25}, {"x":2.5, "y":2.25}, {"x":3.5, "y":2.25}, {"x":4.5, "y":2.25}, {"x":0.75, "y":3.25}, {"x":1.75, "y":3.25}, {"x":2.75, "y":3.25}, {"x":3.75, "y":3.25}, {"x":4.75, "y":3.25}, {"x":1.25, "y":4.25}, {"x":2.25, "y":4.25}, {"x":3.25, "y":4.25}, {"x":4.25, "y":4.25}, {"x":5.57, "y":4.25}, {"x":1, "y":5.25, "w":1.25}, {"x":2.25, "y":5.25, "w":1.5}, {"x":3.75, "y":5.25, "w":1.5}, {"x":5.32, "y":5.25}, {"x":-1.5, "y":2}, {"x":-0.5, "y":2}, {"x":0.5, "y":2}, {"x":1.5, "y":2}, {"x":2.5, "y":2}, {"x":-1.0, "y":3}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":-1.75, "y":4}, {"x":-0.75, "y":4}, {"x":0.25, "y":4}, {"x":1.25, "y":4}, {"x":2.25, "y":4}, {"x":-1.25, "y":5}, {"x":-0.25, "y":5}, {"x":0.75, "y":5}, {"x":1.75, "y":5}, {"x":-1.25, "y":6, "w":1.5}, {"x":0.25, "y":6, "w":1.5}, {"x":1.75, "y":6, "w":1.25}] - } - } -} diff --git a/keyboards/mechwild/mokulua/mirrored/config.h b/keyboards/mechwild/mokulua/mirrored/config.h new file mode 100644 index 0000000000..3742bd1958 --- /dev/null +++ b/keyboards/mechwild/mokulua/mirrored/config.h @@ -0,0 +1,88 @@ +// Copyright 2022 Kyle McCreery (@kylemccreery) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "config_common.h" + +/* Key matrix size */ +#define MATRIX_ROWS 12 +#define MATRIX_COLS 6 + +/* Key matrix pins */ +#define MATRIX_ROW_PINS { F4, F5, F6, F7, B1, B3 } +#define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5 } + +/* Encoder pins */ +#define ENCODERS_PAD_A { D2 } +#define ENCODERS_PAD_B { B2 } + +/* Encoder resolution */ +#define ENCODER_RESOLUTION 4 +#define TAP_CODE_DELAY 10 + +/* COL2ROW, ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +#define OLED_FONT_H "keyboards/mechwild/mokulua/glcdfont.c" + +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D3 +#define MASTER_LEFT +//#define MASTER_RIGHT +#define RGBLIGHT_SPLIT +#define RGBLED_SPLIT { 8, 8 } +#define SPLIT_LAYER_STATE_ENABLE +#define SPLIT_LED_STATE_ENABLE +#define SPLIT_MODS_ENABLE +#define SPLIT_OLED_ENABLE + +/* RGB options */ +#define RGB_DI_PIN B6 +#ifdef RGB_DI_PIN +# define RGBLED_NUM 16 +# define RGBLIGHT_HUE_STEP 8 +# define RGBLIGHT_SAT_STEP 8 +# define RGBLIGHT_VAL_STEP 8 +# define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +# define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +/*== choose RGB animations ==*/ +//# define RGBLIGHT_EFFECT_BREATHING +# define RGBLIGHT_EFFECT_RAINBOW_MOOD +# define RGBLIGHT_EFFECT_RAINBOW_SWIRL +//# define RGBLIGHT_EFFECT_SNAKE +//# define RGBLIGHT_EFFECT_KNIGHT +//# define RGBLIGHT_EFFECT_CHRISTMAS +//# define RGBLIGHT_EFFECT_STATIC_GRADIENT +//# define RGBLIGHT_EFFECT_RGB_TEST +//# define RGBLIGHT_EFFECT_ALTERNATING +/*== customize breathing effect ==*/ +/*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +//# define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +/*==== use exp() and sin() ====*/ +//# define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +//# define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is useful for the Windows task manager shortcut (ctrl+shift+esc). + */ +//#define GRAVE_ESC_CTRL_OVERRIDE + + +/* Bootmagic Lite key configuration */ +#define BOOTMAGIC_LITE_ROW 0 +#define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/mechwild/mokulua/mirrored/info.json b/keyboards/mechwild/mokulua/mirrored/info.json new file mode 100644 index 0000000000..15ed63a858 --- /dev/null +++ b/keyboards/mechwild/mokulua/mirrored/info.json @@ -0,0 +1,93 @@ +{ + "keyboard_name": "Mokulua Mirrored", + "manufacturer": "MechWild", + "url": "https://mechwild.com", + "maintainer": "kylemccreery", + "usb": { + "vid": "0x6D77", + "pid": "0x170C", + "device_version": "1.0.3" + }, + "layouts": { + "LAYOUT_mirrored": { + "layout": [ + {"label":"Esc", "x":0.62, "y":0}, + {"label":"1!", "x":1.62, "y":0}, + {"label":"2@", "x":2.62, "y":0}, + {"label":"3#", "x":3.62, "y":0}, + {"label":"4$", "x":4.62, "y":0}, + {"label":"5%", "x":5.62, "y":0}, + {"label":"6^", "x":6.62, "y":0}, + {"label":"7&", "x":10.12, "y":0}, + {"label":"8*", "x":11.12, "y":0}, + {"label":"9(", "x":12.12, "y":0}, + {"label":"0)", "x":13.12, "y":0}, + {"label":"-_", "x":14.12, "y":0}, + {"label":"Backspace", "x":15.12, "y":0}, + {"label":"Backspace", "x":16.12, "y":0}, + + {"label":"Tab", "x":0.37, "y":1, "w":1.5}, + {"label":"Q", "x":1.87, "y":1}, + {"label":"W", "x":2.87, "y":1}, + {"label":"E", "x":3.87, "y":1}, + {"label":"R", "x":4.87, "y":1}, + {"label":"T", "x":5.87, "y":1}, + {"label":"Y", "x":6.87, "y":1}, + {"label":"Y", "x":9.87, "y":1}, + {"label":"U", "x":10.87, "y":1}, + {"label":"I", "x":11.87, "y":1}, + {"label":"O", "x":12.87, "y":1}, + {"label":"P", "x":13.87, "y":1}, + {"label":"]}", "x":14.87, "y":1}, + {"label":"\\|", "x":15.87, "y":1, "w":1.5}, + + {"label":"Caps Lock", "x":0.25, "y":2, "w":1.75}, + {"label":"A", "x":2, "y":2}, + {"label":"S", "x":3, "y":2}, + {"label":"D", "x":4, "y":2}, + {"label":"F", "x":5, "y":2}, + {"label":"G", "x":6, "y":2}, + {"label":"H", "x":7, "y":2}, + {"label":";:", "x":9.75, "y":2}, + {"label":"H", "x":10.75, "y":2}, + {"label":"J", "x":11.75, "y":2}, + {"label":"K", "x":12.75, "y":2}, + {"label":"L", "x":13.75, "y":2}, + {"label":"'\"", "x":14.75, "y":2}, + {"label":"Enter", "x":15.75, "y":2, "w":1.75}, + + {"label":"Shift", "x":0, "y":3, "w":1.25}, + {"label":"\\|", "x":1.25, "y":3}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"Mute", "x":7.37, "y":3}, + {"label":"Mute", "x":9.37, "y":3}, + {"label":"B", "x":10.5, "y":3}, + {"label":"N", "x":11.5, "y":3}, + {"label":"M", "x":12.5, "y":3}, + {"label":",<", "x":13.5, "y":3}, + {"label":".>", "x":14.5, "y":3}, + {"label":"\u2191", "x":15.5, "y":3}, + {"label":"Shift", "x":16.5, "y":3, "w":1.25}, + + {"label":"Ctrl", "x":0.25, "y":4}, + {"label":"GUI", "x":1.25, "y":4}, + {"label":"Alt", "x":2.25, "y":4}, + {"label":"Fn2", "x":3.5, "y":4, "w":1.25}, + {"label":"Fn1/Space", "x":4.94, "y":4, "h":1.5}, + {"label":"Fn2/Space", "x":5.94, "y":4, "h":1.5}, + {"label":"RGB Mode -", "x":7.13, "y":4}, + {"label":"RGB Mode +", "x":9.62, "y":4}, + {"label":"Fn2/Space", "x":10.81, "y":4, "h":1.5}, + {"label":"Fn1/Space", "x":11.81, "y":4, "h":1.5}, + {"label":"Fn2", "x":13, "y":4, "w":1.25}, + {"label":"\u2190", "x":14.5, "y":4}, + {"label":"\u2193", "x":15.5, "y":4}, + {"label":"\u2192", "x":16.5, "y":4} + ] + } + } +} diff --git a/keyboards/mechwild/mokulua/mirrored/keymaps/default/keymap.c b/keyboards/mechwild/mokulua/mirrored/keymaps/default/keymap.c new file mode 100644 index 0000000000..d83bcedfe7 --- /dev/null +++ b/keyboards/mechwild/mokulua/mirrored/keymaps/default/keymap.c @@ -0,0 +1,55 @@ +// Copyright 2022 Kyle McCreery (@kylemccreery) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +#define FN1_SPC LT(1, KC_SPC) +#define FN2_SPC LT(2, KC_SPC) + +// Defines names for use in layer keycodes and the keymap +enum layer_names { + _BASE, + _FN1, + _FN2, + _FN3 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_BSPC, _______, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRC, KC_BSLS, + MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_SCLN, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT, + KC_LSFT, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MUTE, KC_MUTE, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, MO(2), FN1_SPC, FN2_SPC, RGB_RMOD, RGB_MOD, FN2_SPC, FN1_SPC, MO(2), KC_LEFT, KC_DOWN, KC_RGHT + ), + [_FN1] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, KC_DEL, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_SCLN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_SLSH, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END + ), + [_FN2] = LAYOUT( + _______, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + [_FN3] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +#ifdef ENCODER_MAP_ENABLE +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_PGDN, KC_PGUP) }, + [_FN1] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }, + [_FN2] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }, + [_FN3] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }, +}; +#endif diff --git a/keyboards/mechwild/mokulua/mirrored/keymaps/default/readme.md b/keyboards/mechwild/mokulua/mirrored/keymaps/default/readme.md new file mode 100644 index 0000000000..727105dcba --- /dev/null +++ b/keyboards/mechwild/mokulua/mirrored/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for Mokulua using a mirrored right-half diff --git a/keyboards/mechwild/mokulua/mirrored/keymaps/default/rules.mk b/keyboards/mechwild/mokulua/mirrored/keymaps/default/rules.mk new file mode 100644 index 0000000000..ee32568148 --- /dev/null +++ b/keyboards/mechwild/mokulua/mirrored/keymaps/default/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/mechwild/mokulua/mirrored/keymaps/via/keymap.c b/keyboards/mechwild/mokulua/mirrored/keymaps/via/keymap.c new file mode 100644 index 0000000000..d83bcedfe7 --- /dev/null +++ b/keyboards/mechwild/mokulua/mirrored/keymaps/via/keymap.c @@ -0,0 +1,55 @@ +// Copyright 2022 Kyle McCreery (@kylemccreery) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +#define FN1_SPC LT(1, KC_SPC) +#define FN2_SPC LT(2, KC_SPC) + +// Defines names for use in layer keycodes and the keymap +enum layer_names { + _BASE, + _FN1, + _FN2, + _FN3 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_BSPC, _______, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRC, KC_BSLS, + MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_SCLN, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT, + KC_LSFT, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MUTE, KC_MUTE, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, MO(2), FN1_SPC, FN2_SPC, RGB_RMOD, RGB_MOD, FN2_SPC, FN1_SPC, MO(2), KC_LEFT, KC_DOWN, KC_RGHT + ), + [_FN1] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, KC_DEL, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_SCLN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_SLSH, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END + ), + [_FN2] = LAYOUT( + _______, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + [_FN3] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +#ifdef ENCODER_MAP_ENABLE +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_PGDN, KC_PGUP) }, + [_FN1] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }, + [_FN2] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }, + [_FN3] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }, +}; +#endif diff --git a/keyboards/mechwild/mokulua/mirrored/keymaps/via/readme.md b/keyboards/mechwild/mokulua/mirrored/keymaps/via/readme.md new file mode 100644 index 0000000000..37aca6eac7 --- /dev/null +++ b/keyboards/mechwild/mokulua/mirrored/keymaps/via/readme.md @@ -0,0 +1 @@ +# The VIA keymap for Mokulua using a mirrored right-half diff --git a/keyboards/mechwild/mokulua/keymaps/via/rules.mk b/keyboards/mechwild/mokulua/mirrored/keymaps/via/rules.mk index 36b7ba9cbc..1189f4ad19 100644 --- a/keyboards/mechwild/mokulua/keymaps/via/rules.mk +++ b/keyboards/mechwild/mokulua/mirrored/keymaps/via/rules.mk @@ -1,2 +1,3 @@ VIA_ENABLE = yes LTO_ENABLE = yes +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/mechwild/mokulua/mirrored/mirrored.c b/keyboards/mechwild/mokulua/mirrored/mirrored.c new file mode 100644 index 0000000000..6b5410642a --- /dev/null +++ b/keyboards/mechwild/mokulua/mirrored/mirrored.c @@ -0,0 +1,82 @@ +// Copyright 2022 Kyle McCreery (@Kyle McCreery) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "mirrored.h" + +#ifdef ENCODER_ENABLE +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + switch (index) { + case 0: + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + break; + case 1: + if (clockwise) { + tap_code(KC_PGUP); + } else { + tap_code(KC_PGDN); + } + break; + + } + return true; +} +#endif + +#ifdef OLED_ENABLE + oled_rotation_t oled_init_kb(oled_rotation_t rotation) { + return OLED_ROTATION_270; // flips the display 270 degrees + } + + static void render_logo(void) { // Render MechWild "MW" Logo + static const char PROGMEM logo_1[] = {0x8A, 0x8B, 0x8C, 0x8D, 0x00}; + static const char PROGMEM logo_2[] = {0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0x00}; + static const char PROGMEM logo_3[] = {0xCA, 0xCB, 0xCC, 0xCD, 0x00}; + static const char PROGMEM logo_4[] = {0x20, 0x8E, 0x8F, 0x90, 0x00}; + oled_set_cursor(0,0); + oled_write_P(logo_1, false); + oled_set_cursor(0,1); + oled_write_P(logo_2, false); + oled_set_cursor(0,2); + oled_write_P(logo_3, false); + oled_set_cursor(0,3); + oled_write_P(logo_4, false); + } + bool oled_task_kb(void) { + if (!oled_task_user()) { + return false; + } + render_logo(); + oled_set_cursor(0,6); + + oled_write_ln_P(PSTR("Layer"), false); + + switch (get_highest_layer(layer_state)) { + case 0: + oled_write_ln_P(PSTR("Base"), false); + break; + case 1: + oled_write_ln_P(PSTR("FN 1"), false); + break; + case 2: + oled_write_ln_P(PSTR("FN 2"), false); + break; + case 3: + oled_write_ln_P(PSTR("FN 3"), false); + break; + default: + oled_write_ln_P(PSTR("Undef"), false); + } + oled_write_ln_P(PSTR(""), false); + // Host Keyboard LED Status + led_t led_state = host_keyboard_led_state(); + oled_write_ln_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); + oled_write_ln_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); + oled_write_ln_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); + return false; + } +#endif diff --git a/keyboards/mechwild/mokulua/mirrored/mirrored.h b/keyboards/mechwild/mokulua/mirrored/mirrored.h new file mode 100644 index 0000000000..66df5cdd6b --- /dev/null +++ b/keyboards/mechwild/mokulua/mirrored/mirrored.h @@ -0,0 +1,31 @@ +// Copyright 2022 Kyle McCreery (@kylemccreery) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "quantum.h" + +#define ___ KC_NO + +#define LAYOUT_mirrored( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, L34, L35, L36, L37, R30, R31, R32, R33, R34, R35, R36, R37, \ + L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ +) { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { L40, L41, L42, L43, L44, L45 }, \ + { L46, L36, L37, L26, L16, L06 }, \ + { R06, R05, R04, R03, R02, R01 }, \ + { R16, R15, R14, R13, R12, R11 }, \ + { R26, R25, R24, R23, R22, R21 }, \ + { R37, R36, R35, R34, R33, R32 }, \ + { R46, R45, R44, R43, R42, R41 }, \ + { R40, R31, R30, R20, R10, R00 } \ +} + +#define LAYOUT LAYOUT_mirrored
\ No newline at end of file diff --git a/keyboards/mechwild/mokulua/mirrored/rules.mk b/keyboards/mechwild/mokulua/mirrored/rules.mk new file mode 100644 index 0000000000..5aae5c7c76 --- /dev/null +++ b/keyboards/mechwild/mokulua/mirrored/rules.mk @@ -0,0 +1,22 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = caterina + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output +ENCODER_ENABLE = yes # Enable encoder +OLED_ENABLE = yes # Enable OLED Screen +OLED_DRIVER = SSD1306 # Define OLED Driver +SPLIT_KEYBOARD = yes # Define split functionality
\ No newline at end of file diff --git a/keyboards/mechwild/mokulua/mokulua.c b/keyboards/mechwild/mokulua/mokulua.c deleted file mode 100644 index 57c800ef89..0000000000 --- a/keyboards/mechwild/mokulua/mokulua.c +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2022 Kyle McCreery (@Kyle McCreery) -// SPDX-License-Identifier: GPL-2.0-or-later - -#include "mokulua.h" - -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } - switch (index) { - case 0: - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - break; - case 1: - if (clockwise) { - tap_code(KC_PGUP); - } else { - tap_code(KC_PGDN); - } - break; - - } - return true; -} -#endif - -#ifdef OLED_ENABLE - oled_rotation_t oled_init_kb(oled_rotation_t rotation) { - return OLED_ROTATION_270; // flips the display 270 degrees - } - - static void render_logo(void) { // Render MechWild "MW" Logo - static const char PROGMEM logo_1[] = {0x8A, 0x8B, 0x8C, 0x8D, 0x00}; - static const char PROGMEM logo_2[] = {0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0x00}; - static const char PROGMEM logo_3[] = {0xCA, 0xCB, 0xCC, 0xCD, 0x00}; - static const char PROGMEM logo_4[] = {0x20, 0x8E, 0x8F, 0x90, 0x00}; - oled_set_cursor(0,0); - oled_write_P(logo_1, false); - oled_set_cursor(0,1); - oled_write_P(logo_2, false); - oled_set_cursor(0,2); - oled_write_P(logo_3, false); - oled_set_cursor(0,3); - oled_write_P(logo_4, false); - } - bool oled_task_kb(void) { - if (!oled_task_user()) { - return false; - } - render_logo(); - oled_set_cursor(0,6); - - oled_write_ln_P(PSTR("Layer"), false); - - switch (get_highest_layer(layer_state)) { - case 0: - oled_write_ln_P(PSTR("Base"), false); - break; - case 1: - oled_write_ln_P(PSTR("FN 1"), false); - break; - case 2: - oled_write_ln_P(PSTR("FN 2"), false); - break; - case 3: - oled_write_ln_P(PSTR("FN 3"), false); - break; - default: - oled_write_ln_P(PSTR("Undef"), false); - } - oled_write_ln_P(PSTR(""), false); - // Host Keyboard LED Status - led_t led_state = host_keyboard_led_state(); - oled_write_ln_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); - oled_write_ln_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); - oled_write_ln_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); - return false; - } -#endif diff --git a/keyboards/mechwild/mokulua/readme.md b/keyboards/mechwild/mokulua/readme.md index a8f2b055df..24f01b10d4 100644 --- a/keyboards/mechwild/mokulua/readme.md +++ b/keyboards/mechwild/mokulua/readme.md @@ -24,4 +24,4 @@ Enter the bootloader in 3 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 * **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead -* **Keycode in layout**: Press the key mapped to `RESET` if it is available
\ No newline at end of file +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available
\ No newline at end of file diff --git a/keyboards/mechwild/mokulua/rules.mk b/keyboards/mechwild/mokulua/rules.mk index 17eb654430..3a87a143e5 100644 --- a/keyboards/mechwild/mokulua/rules.mk +++ b/keyboards/mechwild/mokulua/rules.mk @@ -1,22 +1 @@ -# MCU name -MCU = atmega32u4 - -# Bootloader selection -BOOTLOADER = caterina - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite -MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = no # Console for debug -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = no # Enable N-Key Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow -AUDIO_ENABLE = no # Audio output -ENCODER_ENABLE = yes # Enable encoder -OLED_ENABLE = yes # Enable OLED Screen -OLED_DRIVER = SSD1306 # Define OLED Driver -SPLIT_KEYBOARD = yes # Define split functionality +DEFAULT_FOLDER = mechwild/mokulua/standard
\ No newline at end of file diff --git a/keyboards/mechwild/mokulua/config.h b/keyboards/mechwild/mokulua/standard/config.h index a424bc6648..21a6f314c3 100644 --- a/keyboards/mechwild/mokulua/config.h +++ b/keyboards/mechwild/mokulua/standard/config.h @@ -5,13 +5,6 @@ #include "config_common.h" -/* USB Device descriptor parameter */ -#define VENDOR_ID 0x6D77 // mw = "MechWild" -#define PRODUCT_ID 0x170B -#define DEVICE_VER 0x0103 -#define MANUFACTURER MechWild -#define PRODUCT Mokulua - /* Key matrix size */ #define MATRIX_ROWS 12 #define MATRIX_COLS 6 @@ -19,7 +12,6 @@ /* Key matrix pins */ #define MATRIX_ROW_PINS { F4, F5, F6, F7, B1, B3 } #define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5 } -#define UNUSED_PINS /* Encoder pins */ #define ENCODERS_PAD_A { D2 } @@ -56,9 +48,7 @@ # define RGBLIGHT_VAL_STEP 8 # define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ # define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ -/*== all animations enable ==*/ -//# define RGBLIGHT_ANIMATIONS -/*== or choose animations ==*/ +/*== choose RGB animations ==*/ //# define RGBLIGHT_EFFECT_BREATHING # define RGBLIGHT_EFFECT_RAINBOW_MOOD # define RGBLIGHT_EFFECT_RAINBOW_SWIRL @@ -79,6 +69,9 @@ /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCE 5 +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ @@ -128,5 +121,5 @@ /* Bootmagic Lite key configuration */ -//#define BOOTMAGIC_LITE_ROW 0 -//#define BOOTMAGIC_LITE_COLUMN 0 +#define BOOTMAGIC_LITE_ROW 0 +#define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/mechwild/mokulua/standard/info.json b/keyboards/mechwild/mokulua/standard/info.json new file mode 100644 index 0000000000..74bcd0b16f --- /dev/null +++ b/keyboards/mechwild/mokulua/standard/info.json @@ -0,0 +1,92 @@ +{ + "keyboard_name": "Mokulua Standard", + "manufacturer": "MechWild", + "url": "https://mechwild.com", + "maintainer": "kylemccreery", + "usb": { + "vid": "0x6D77", + "pid": "0x170B", + "device_version": "1.0.3" + }, + "layouts": { + "LAYOUT_standard": { + "layout": [ + {"label":"Esc", "x":0.62, "y":0}, + {"label":"1!", "x":1.62, "y":0}, + {"label":"2@", "x":2.62, "y":0}, + {"label":"3#", "x":3.62, "y":0}, + {"label":"4$", "x":4.62, "y":0}, + {"label":"5%", "x":5.62, "y":0}, + {"label":"6^", "x":6.62, "y":0}, + {"label":"7&", "x":9.62, "y":0}, + {"label":"8*", "x":10.62, "y":0}, + {"label":"9(", "x":11.62, "y":0}, + {"label":"0)", "x":12.62, "y":0}, + {"label":"-_", "x":13.62, "y":0}, + {"label":"Backspace", "x":14.62, "y":0}, + {"label":"Backspace", "x":15.62, "y":0}, + + {"label":"Tab", "x":0.37, "y":1, "w":1.5}, + {"label":"Q", "x":1.87, "y":1}, + {"label":"W", "x":2.87, "y":1}, + {"label":"E", "x":3.87, "y":1}, + {"label":"R", "x":4.87, "y":1}, + {"label":"T", "x":5.87, "y":1}, + {"label":"Y", "x":6.87, "y":1}, + {"label":"U", "x":10.37, "y":1}, + {"label":"I", "x":11.37, "y":1}, + {"label":"O", "x":12.37, "y":1}, + {"label":"P", "x":13.37, "y":1}, + {"label":"]}", "x":14.37, "y":1}, + {"label":"\\|", "x":15.37, "y":1, "w":1.5}, + + {"label":"Caps Lock", "x":0.25, "y":2, "w":1.75}, + {"label":"A", "x":2, "y":2}, + {"label":"S", "x":3, "y":2}, + {"label":"D", "x":4, "y":2}, + {"label":"F", "x":5, "y":2}, + {"label":"G", "x":6, "y":2}, + {"label":"H", "x":7, "y":2}, + {"label":";:", "x":9.75, "y":2}, + {"label":"H", "x":10.75, "y":2}, + {"label":"J", "x":11.75, "y":2}, + {"label":"K", "x":12.75, "y":2}, + {"label":"L", "x":13.75, "y":2}, + {"label":"'\"", "x":14.75, "y":2}, + {"label":"Enter", "x":15.75, "y":2, "w":1.75}, + + {"label":"Shift", "x":0, "y":3, "w":1.25}, + {"label":"\\|", "x":1.25, "y":3}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"Mute", "x":7.37, "y":3}, + {"label":"Mute", "x":9.37, "y":3}, + {"label":"B", "x":10.5, "y":3}, + {"label":"N", "x":11.5, "y":3}, + {"label":"M", "x":12.5, "y":3}, + {"label":",<", "x":13.5, "y":3}, + {"label":".>", "x":14.5, "y":3}, + {"label":"\u2191", "x":15.5, "y":3}, + {"label":"Shift", "x":16.5, "y":3, "w":1.25}, + + {"label":"Ctrl", "x":0.25, "y":4}, + {"label":"GUI", "x":1.25, "y":4}, + {"label":"Alt", "x":2.25, "y":4}, + {"label":"Fn2", "x":3.5, "y":4, "w":1.25}, + {"label":"Fn1/Space", "x":4.94, "y":4, "h":1.5}, + {"label":"Fn2/Space", "x":5.94, "y":4, "h":1.5}, + {"label":"RGB Mode -", "x":7.13, "y":4}, + {"label":"RGB Mode +", "x":9.62, "y":4}, + {"label":"Fn2/Space", "x":10.81, "y":4, "h":1.5}, + {"label":"Fn1/Space", "x":11.81, "y":4, "h":1.5}, + {"label":"Fn2", "x":13, "y":4, "w":1.25}, + {"label":"\u2190", "x":14.5, "y":4}, + {"label":"\u2193", "x":15.5, "y":4}, + {"label":"\u2192", "x":16.5, "y":4} + ] + } + } +} diff --git a/keyboards/mechwild/mokulua/keymaps/default/keymap.c b/keyboards/mechwild/mokulua/standard/keymaps/default/keymap.c index f95663bb6b..bb438fe1bf 100644 --- a/keyboards/mechwild/mokulua/keymaps/default/keymap.c +++ b/keyboards/mechwild/mokulua/standard/keymaps/default/keymap.c @@ -14,7 +14,7 @@ enum layer_names { _FN3 }; -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BASE] = LAYOUT( KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_MINS, KC_7, KC_8, KC_9, KC_0, _______, KC_BSPC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, @@ -29,14 +29,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_SLSH, KC_PGUP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END ), - [_FN2] = LAYOUT( + [_FN2] = LAYOUT( _______, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), - [_FN3] = LAYOUT( + [_FN3] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -44,3 +44,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) }; + +#ifdef ENCODER_MAP_ENABLE +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_PGDN, KC_PGUP) }, + [_FN1] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }, + [_FN2] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }, + [_FN3] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }, +}; +#endif diff --git a/keyboards/mechwild/mokulua/keymaps/default/readme.md b/keyboards/mechwild/mokulua/standard/keymaps/default/readme.md index 81569df142..81569df142 100644 --- a/keyboards/mechwild/mokulua/keymaps/default/readme.md +++ b/keyboards/mechwild/mokulua/standard/keymaps/default/readme.md diff --git a/keyboards/mechwild/mokulua/standard/keymaps/default/rules.mk b/keyboards/mechwild/mokulua/standard/keymaps/default/rules.mk new file mode 100644 index 0000000000..ee32568148 --- /dev/null +++ b/keyboards/mechwild/mokulua/standard/keymaps/default/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/mechwild/mokulua/keymaps/silly/config.h b/keyboards/mechwild/mokulua/standard/keymaps/silly/config.h index 1e0e3ac5eb..1e0e3ac5eb 100644 --- a/keyboards/mechwild/mokulua/keymaps/silly/config.h +++ b/keyboards/mechwild/mokulua/standard/keymaps/silly/config.h diff --git a/keyboards/mechwild/mokulua/keymaps/silly/keymap.c b/keyboards/mechwild/mokulua/standard/keymaps/silly/keymap.c index 9463f162c0..61df3e000f 100644 --- a/keyboards/mechwild/mokulua/keymaps/silly/keymap.c +++ b/keyboards/mechwild/mokulua/standard/keymaps/silly/keymap.c @@ -32,7 +32,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_FN2] = LAYOUT( _______, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ @@ -47,20 +47,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; #ifdef OLED_ENABLE - static void render_logo(void) { // Render MechWild "MW" Logo - static const char PROGMEM logo_1[] = {0x8A, 0x8B, 0x8C, 0x8D, 0x00}; - static const char PROGMEM logo_2[] = {0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0x00}; - static const char PROGMEM logo_3[] = {0xCA, 0xCB, 0xCC, 0xCD, 0x00}; - static const char PROGMEM logo_4[] = {0x20, 0x8E, 0x8F, 0x90, 0x00}; - oled_set_cursor(0,0); - oled_write_P(logo_1, false); - oled_set_cursor(0,1); - oled_write_P(logo_2, false); - oled_set_cursor(0,2); - oled_write_P(logo_3, false); - oled_set_cursor(0,3); - oled_write_P(logo_4, false); - } + static void render_logo(void) { // Render MechWild "MW" Logo + static const char PROGMEM logo_1[] = {0x8A, 0x8B, 0x8C, 0x8D, 0x00}; + static const char PROGMEM logo_2[] = {0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0x00}; + static const char PROGMEM logo_3[] = {0xCA, 0xCB, 0xCC, 0xCD, 0x00}; + static const char PROGMEM logo_4[] = {0x20, 0x8E, 0x8F, 0x90, 0x00}; + oled_set_cursor(0,0); + oled_write_P(logo_1, false); + oled_set_cursor(0,1); + oled_write_P(logo_2, false); + oled_set_cursor(0,2); + oled_write_P(logo_3, false); + oled_set_cursor(0,3); + oled_write_P(logo_4, false); + } bool oled_task_user(void) { render_logo(); oled_set_cursor(0,6); diff --git a/keyboards/mechwild/mokulua/keymaps/silly/readme.md b/keyboards/mechwild/mokulua/standard/keymaps/silly/readme.md index 4659a3aaeb..4659a3aaeb 100644 --- a/keyboards/mechwild/mokulua/keymaps/silly/readme.md +++ b/keyboards/mechwild/mokulua/standard/keymaps/silly/readme.md diff --git a/keyboards/mechwild/mokulua/keymaps/silly/rules.mk b/keyboards/mechwild/mokulua/standard/keymaps/silly/rules.mk index 36b7ba9cbc..36b7ba9cbc 100644 --- a/keyboards/mechwild/mokulua/keymaps/silly/rules.mk +++ b/keyboards/mechwild/mokulua/standard/keymaps/silly/rules.mk diff --git a/keyboards/mechwild/mokulua/keymaps/via/keymap.c b/keyboards/mechwild/mokulua/standard/keymaps/via/keymap.c index f95663bb6b..bb438fe1bf 100644 --- a/keyboards/mechwild/mokulua/keymaps/via/keymap.c +++ b/keyboards/mechwild/mokulua/standard/keymaps/via/keymap.c @@ -14,7 +14,7 @@ enum layer_names { _FN3 }; -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BASE] = LAYOUT( KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_MINS, KC_7, KC_8, KC_9, KC_0, _______, KC_BSPC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, @@ -29,14 +29,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_SLSH, KC_PGUP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END ), - [_FN2] = LAYOUT( + [_FN2] = LAYOUT( _______, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), - [_FN3] = LAYOUT( + [_FN3] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -44,3 +44,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) }; + +#ifdef ENCODER_MAP_ENABLE +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_PGDN, KC_PGUP) }, + [_FN1] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }, + [_FN2] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }, + [_FN3] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }, +}; +#endif diff --git a/keyboards/mechwild/mokulua/keymaps/via/readme.md b/keyboards/mechwild/mokulua/standard/keymaps/via/readme.md index 4f47e50e88..4f47e50e88 100644 --- a/keyboards/mechwild/mokulua/keymaps/via/readme.md +++ b/keyboards/mechwild/mokulua/standard/keymaps/via/readme.md diff --git a/keyboards/mechwild/mokulua/standard/keymaps/via/rules.mk b/keyboards/mechwild/mokulua/standard/keymaps/via/rules.mk new file mode 100644 index 0000000000..1189f4ad19 --- /dev/null +++ b/keyboards/mechwild/mokulua/standard/keymaps/via/rules.mk @@ -0,0 +1,3 @@ +VIA_ENABLE = yes +LTO_ENABLE = yes +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/mechwild/mokulua/standard/rules.mk b/keyboards/mechwild/mokulua/standard/rules.mk new file mode 100644 index 0000000000..5aae5c7c76 --- /dev/null +++ b/keyboards/mechwild/mokulua/standard/rules.mk @@ -0,0 +1,22 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = caterina + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output +ENCODER_ENABLE = yes # Enable encoder +OLED_ENABLE = yes # Enable OLED Screen +OLED_DRIVER = SSD1306 # Define OLED Driver +SPLIT_KEYBOARD = yes # Define split functionality
\ No newline at end of file diff --git a/keyboards/mechwild/mokulua/standard/standard.c b/keyboards/mechwild/mokulua/standard/standard.c new file mode 100644 index 0000000000..4bccb70e3f --- /dev/null +++ b/keyboards/mechwild/mokulua/standard/standard.c @@ -0,0 +1,82 @@ +// Copyright 2022 Kyle McCreery (@Kyle McCreery) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "standard.h" + +#ifdef ENCODER_ENABLE +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + switch (index) { + case 0: + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + break; + case 1: + if (clockwise) { + tap_code(KC_PGUP); + } else { + tap_code(KC_PGDN); + } + break; + + } + return true; +} +#endif + +#ifdef OLED_ENABLE + oled_rotation_t oled_init_kb(oled_rotation_t rotation) { + return OLED_ROTATION_270; // flips the display 270 degrees + } + + static void render_logo(void) { // Render MechWild "MW" Logo + static const char PROGMEM logo_1[] = {0x8A, 0x8B, 0x8C, 0x8D, 0x00}; + static const char PROGMEM logo_2[] = {0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0x00}; + static const char PROGMEM logo_3[] = {0xCA, 0xCB, 0xCC, 0xCD, 0x00}; + static const char PROGMEM logo_4[] = {0x20, 0x8E, 0x8F, 0x90, 0x00}; + oled_set_cursor(0,0); + oled_write_P(logo_1, false); + oled_set_cursor(0,1); + oled_write_P(logo_2, false); + oled_set_cursor(0,2); + oled_write_P(logo_3, false); + oled_set_cursor(0,3); + oled_write_P(logo_4, false); + } + bool oled_task_kb(void) { + if (!oled_task_user()) { + return false; + } + render_logo(); + oled_set_cursor(0,6); + + oled_write_ln_P(PSTR("Layer"), false); + + switch (get_highest_layer(layer_state)) { + case 0: + oled_write_ln_P(PSTR("Base"), false); + break; + case 1: + oled_write_ln_P(PSTR("FN 1"), false); + break; + case 2: + oled_write_ln_P(PSTR("FN 2"), false); + break; + case 3: + oled_write_ln_P(PSTR("FN 3"), false); + break; + default: + oled_write_ln_P(PSTR("Undef"), false); + } + oled_write_ln_P(PSTR(""), false); + // Host Keyboard LED Status + led_t led_state = host_keyboard_led_state(); + oled_write_ln_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); + oled_write_ln_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); + oled_write_ln_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); + return false; + } +#endif diff --git a/keyboards/mechwild/mokulua/mokulua.h b/keyboards/mechwild/mokulua/standard/standard.h index 95ea1e3709..0484340e8d 100644 --- a/keyboards/mechwild/mokulua/mokulua.h +++ b/keyboards/mechwild/mokulua/standard/standard.h @@ -7,7 +7,7 @@ #define ___ KC_NO -#define LAYOUT( \ +#define LAYOUT_standard( \ L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ L10, L11, L12, L13, L14, L15, L16, R11, R12, R13, R14, R15, R16, \ L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ @@ -27,3 +27,5 @@ { R41, R42, R43, R44, R45, R46 }, \ { R00, R20, R31, R30, R40, ___ } \ } + +#define LAYOUT LAYOUT_standard |