Compare commits

...

15 Commits

Author SHA1 Message Date
Epomaker
3320b40087
Merge 11cab828b7 into 9bea332a21 2024-11-20 22:22:13 -08:00
Ryan
9bea332a21
qmk via2json: Improve macro parsing (#24345) 2024-11-21 17:20:05 +11:00
Ryan
8cbcdcac62
qmk new-keymap: validate keymap name (#23420) 2024-11-21 17:18:51 +11:00
岩弈
11cab828b7 change pid 2024-04-24 13:41:58 +08:00
Epomaker
303539c27f
Update keyboards/epomaker/tide75/info.json
Co-authored-by: jack <0x6a73@protonmail.com>
2024-04-19 09:45:14 +08:00
岩弈
7a3ae37596 Add Epomaker tide75 2024-04-18 16:09:41 +08:00
岩弈
827dd39a77 delete th75 2024-04-18 16:06:36 +08:00
Epomaker
d020e3556b
Merge branch 'qmk:master' into master 2024-04-18 09:51:32 +08:00
Epomaker
1224c68f41
Merge branch 'qmk:master' into master 2024-04-08 13:52:21 +08:00
yanyi24
3699fd877c
Merge branch 'qmk:master' into master 2024-03-26 10:51:16 +08:00
Epomaker
bfcb52adbd
Merge branch 'qmk:master' into master 2024-03-21 14:39:36 +08:00
岩弈
ef02f10106 delete 2024-03-20 18:10:02 +08:00
岩弈
9154e2a50a test 2024-03-20 18:04:45 +08:00
Rene Flores
5c33345de4 EPOMAKER TH96 Update 2022-11-29 21:44:42 -06:00
Epomaker
00c0811b1f
Add files via upload 2022-09-28 15:23:13 +08:00
9 changed files with 398 additions and 9 deletions

View File

@ -0,0 +1,264 @@
{
"manufacturer": "HS",
"keyboard_name": "EPOMAKER TIDE 75",
"maintainer": "sdk66",
"bootloader": "wb32-dfu",
"diode_direction": "ROW2COL",
"encoder": {
"rotary": [
{"pin_a": "B7", "pin_b": "B6"}
]
},
"features": {
"bootmagic": true,
"encoder": true,
"extrakey": true,
"mousekey": true,
"nkro": true,
"rgb_matrix": true
},
"matrix_pins": {
"cols": ["C0", "C1", "C2", "C3", "A6", "B10", "B11", "B12", "B13", "B14", "A10", "C6", "C7", "C8", "C9"],
"rows": ["A0", "A1", "A2", "A3", "A4", "C13"]
},
"processor": "WB32FQ95",
"rgb_matrix": {
"animations": {
"alphas_mods": true,
"band_pinwheel_sat": true,
"band_pinwheel_val": true,
"band_sat": true,
"band_spiral_sat": true,
"band_spiral_val": true,
"band_val": true,
"breathing": true,
"cycle_all": true,
"cycle_left_right": true,
"cycle_out_in": true,
"cycle_out_in_dual": true,
"cycle_pinwheel": true,
"cycle_spiral": true,
"cycle_up_down": true,
"digital_rain": true,
"dual_beacon": true,
"gradient_left_right": true,
"gradient_up_down": true,
"hue_breathing": true,
"hue_pendulum": true,
"hue_wave": true,
"jellybean_raindrops": true,
"multisplash": true,
"pixel_flow": true,
"pixel_fractal": true,
"pixel_rain": true,
"rainbow_beacon": true,
"rainbow_moving_chevron": true,
"rainbow_pinwheels": true,
"raindrops": true,
"solid_multisplash": true,
"solid_reactive": true,
"solid_reactive_cross": true,
"solid_reactive_multicross": true,
"solid_reactive_multinexus": true,
"solid_reactive_multiwide": true,
"solid_reactive_nexus": true,
"solid_reactive_simple": true,
"solid_reactive_wide": true,
"solid_splash": true,
"splash": true,
"typing_heatmap": true
},
"driver": "ws2812",
"layout": [
{"matrix": [0, 0], "x": 0, "y": 0, "flags": 4},
{"matrix": [0, 1], "x": 16, "y": 0, "flags": 4},
{"matrix": [0, 2], "x": 32, "y": 0, "flags": 4},
{"matrix": [0, 3], "x": 48, "y": 0, "flags": 4},
{"matrix": [0, 4], "x": 64, "y": 0, "flags": 4},
{"matrix": [0, 5], "x": 80, "y": 0, "flags": 4},
{"matrix": [0, 6], "x": 96, "y": 0, "flags": 4},
{"matrix": [0, 7], "x": 112, "y": 0, "flags": 4},
{"matrix": [0, 8], "x": 128, "y": 0, "flags": 4},
{"matrix": [0, 9], "x": 144, "y": 0, "flags": 4},
{"matrix": [0, 10], "x": 160, "y": 0, "flags": 4},
{"matrix": [0, 11], "x": 176, "y": 0, "flags": 4},
{"matrix": [0, 12], "x": 192, "y": 0, "flags": 4},
{"matrix": [0, 13], "x": 208, "y": 0, "flags": 4},
{"matrix": [1, 0], "x": 0, "y": 13, "flags": 4},
{"matrix": [1, 1], "x": 16, "y": 13, "flags": 4},
{"matrix": [1, 2], "x": 32, "y": 13, "flags": 4},
{"matrix": [1, 3], "x": 48, "y": 13, "flags": 4},
{"matrix": [1, 4], "x": 64, "y": 13, "flags": 4},
{"matrix": [1, 5], "x": 80, "y": 13, "flags": 4},
{"matrix": [1, 6], "x": 96, "y": 13, "flags": 4},
{"matrix": [1, 7], "x": 112, "y": 13, "flags": 4},
{"matrix": [1, 8], "x": 128, "y": 13, "flags": 4},
{"matrix": [1, 9], "x": 144, "y": 13, "flags": 4},
{"matrix": [1, 10], "x": 160, "y": 13, "flags": 4},
{"matrix": [1, 11], "x": 176, "y": 13, "flags": 4},
{"matrix": [1, 12], "x": 192, "y": 13, "flags": 4},
{"matrix": [1, 13], "x": 208, "y": 13, "flags": 4},
{"matrix": [1, 14], "x": 224, "y": 13, "flags": 4},
{"matrix": [2, 0], "x": 0, "y": 26, "flags": 4},
{"matrix": [2, 1], "x": 16, "y": 26, "flags": 4},
{"matrix": [2, 2], "x": 32, "y": 26, "flags": 4},
{"matrix": [2, 3], "x": 48, "y": 26, "flags": 4},
{"matrix": [2, 4], "x": 64, "y": 26, "flags": 4},
{"matrix": [2, 5], "x": 80, "y": 26, "flags": 4},
{"matrix": [2, 6], "x": 96, "y": 26, "flags": 4},
{"matrix": [2, 7], "x": 112, "y": 26, "flags": 4},
{"matrix": [2, 8], "x": 128, "y": 26, "flags": 4},
{"matrix": [2, 9], "x": 144, "y": 26, "flags": 4},
{"matrix": [2, 10], "x": 160, "y": 26, "flags": 4},
{"matrix": [2, 11], "x": 176, "y": 26, "flags": 4},
{"matrix": [2, 12], "x": 192, "y": 26, "flags": 4},
{"matrix": [2, 13], "x": 208, "y": 26, "flags": 4},
{"matrix": [2, 14], "x": 224, "y": 26, "flags": 4},
{"matrix": [3, 0], "x": 0, "y": 38, "flags": 4},
{"matrix": [3, 1], "x": 16, "y": 38, "flags": 4},
{"matrix": [3, 2], "x": 32, "y": 38, "flags": 4},
{"matrix": [3, 3], "x": 48, "y": 38, "flags": 4},
{"matrix": [3, 4], "x": 64, "y": 38, "flags": 4},
{"matrix": [3, 5], "x": 80, "y": 38, "flags": 4},
{"matrix": [3, 6], "x": 96, "y": 38, "flags": 4},
{"matrix": [3, 7], "x": 112, "y": 38, "flags": 4},
{"matrix": [3, 8], "x": 128, "y": 38, "flags": 4},
{"matrix": [3, 9], "x": 144, "y": 38, "flags": 4},
{"matrix": [3, 10], "x": 160, "y": 38, "flags": 4},
{"matrix": [3, 11], "x": 176, "y": 38, "flags": 4},
{"matrix": [3, 12], "x": 192, "y": 38, "flags": 4},
{"matrix": [3, 13], "x": 208, "y": 38, "flags": 4},
{"matrix": [3, 14], "x": 224, "y": 38, "flags": 4},
{"matrix": [4, 0], "x": 0, "y": 51, "flags": 4},
{"matrix": [4, 1], "x": 16, "y": 51, "flags": 4},
{"matrix": [4, 2], "x": 32, "y": 51, "flags": 4},
{"matrix": [4, 3], "x": 48, "y": 51, "flags": 4},
{"matrix": [4, 4], "x": 64, "y": 51, "flags": 4},
{"matrix": [4, 5], "x": 80, "y": 51, "flags": 4},
{"matrix": [4, 6], "x": 96, "y": 51, "flags": 4},
{"matrix": [4, 7], "x": 112, "y": 51, "flags": 4},
{"matrix": [4, 8], "x": 128, "y": 51, "flags": 4},
{"matrix": [4, 9], "x": 144, "y": 51, "flags": 4},
{"matrix": [4, 10], "x": 160, "y": 51, "flags": 4},
{"matrix": [4, 11], "x": 176, "y": 51, "flags": 4},
{"matrix": [4, 13], "x": 208, "y": 51, "flags": 4},
{"matrix": [4, 14], "x": 224, "y": 51, "flags": 4},
{"matrix": [4, 0], "x": 0, "y": 64, "flags": 4},
{"matrix": [4, 1], "x": 16, "y": 64, "flags": 4},
{"matrix": [4, 2], "x": 32, "y": 64, "flags": 4},
{"matrix": [4, 3], "x": 48, "y": 64, "flags": 4},
{"matrix": [4, 4], "x": 64, "y": 64, "flags": 4},
{"matrix": [4, 6], "x": 96, "y": 64, "flags": 4},
{"matrix": [4, 7], "x": 112, "y": 64, "flags": 4},
{"matrix": [4, 9], "x": 144, "y": 64, "flags": 4},
{"matrix": [4, 10], "x": 160, "y": 64, "flags": 4},
{"matrix": [4, 11], "x": 176, "y": 64, "flags": 4},
{"matrix": [4, 11], "x": 192, "y": 64, "flags": 4},
{"matrix": [4, 13], "x": 208, "y": 64, "flags": 4},
{"matrix": [4, 14], "x": 224, "y": 64, "flags": 4}
]
},
"url": "",
"usb": {
"device_version": "0.0.1",
"force_nkro": true,
"pid": "0xE471",
"suspend_wakeup_delay": 1000,
"vid": "0x342D"
},
"ws2812": {
"pin": "B15"
},
"layouts": {
"LAYOUT": {
"layout": [
{"matrix": [0, 0], "x": 0, "y": 0},
{"matrix": [0, 1], "x": 1.5, "y": 0},
{"matrix": [0, 2], "x": 2.5, "y": 0},
{"matrix": [0, 3], "x": 3.5, "y": 0},
{"matrix": [0, 4], "x": 4.5, "y": 0},
{"matrix": [0, 5], "x": 5.75, "y": 0},
{"matrix": [0, 6], "x": 6.75, "y": 0},
{"matrix": [0, 7], "x": 7.75, "y": 0},
{"matrix": [0, 8], "x": 8.75, "y": 0},
{"matrix": [0, 9], "x": 10, "y": 0},
{"matrix": [0, 10], "x": 11, "y": 0},
{"matrix": [0, 11], "x": 12, "y": 0},
{"matrix": [0, 12], "x": 13, "y": 0},
{"matrix": [0, 13], "x": 14.25, "y": 0},
{"matrix": [0, 14], "x": 15.75, "y": 0},
{"matrix": [1, 0], "x": 0, "y": 1.25},
{"matrix": [1, 1], "x": 1, "y": 1.25},
{"matrix": [1, 2], "x": 2, "y": 1.25},
{"matrix": [1, 3], "x": 3, "y": 1.25},
{"matrix": [1, 4], "x": 4, "y": 1.25},
{"matrix": [1, 5], "x": 5, "y": 1.25},
{"matrix": [1, 6], "x": 6, "y": 1.25},
{"matrix": [1, 7], "x": 7, "y": 1.25},
{"matrix": [1, 8], "x": 8, "y": 1.25},
{"matrix": [1, 9], "x": 9, "y": 1.25},
{"matrix": [1, 10], "x": 10, "y": 1.25},
{"matrix": [1, 11], "x": 11, "y": 1.25},
{"matrix": [1, 12], "x": 12, "y": 1.25},
{"matrix": [1, 13], "x": 13, "y": 1.25, "w": 2.25},
{"matrix": [1, 14], "x": 15.75, "y": 1.25},
{"matrix": [2, 0], "x": 0, "y": 2.25, "w": 1.5},
{"matrix": [2, 1], "x": 2.5, "y": 2.25},
{"matrix": [2, 2], "x": 3.5, "y": 2.25},
{"matrix": [2, 3], "x": 4.5, "y": 2.25},
{"matrix": [2, 4], "x": 5.5, "y": 2.25},
{"matrix": [2, 5], "x": 6.5, "y": 2.25},
{"matrix": [2, 6], "x": 7.5, "y": 2.25},
{"matrix": [2, 7], "x": 8.5, "y": 2.25},
{"matrix": [2, 8], "x": 9.5, "y": 2.25},
{"matrix": [2, 9], "x": 10.5, "y": 2.25},
{"matrix": [2, 10], "x": 11.5, "y": 2.25},
{"matrix": [2, 11], "x": 12.5, "y": 2.25},
{"matrix": [2, 12], "x": 13.5, "y": 2.25},
{"matrix": [2, 13], "x": 14.5, "y": 2.25, "w": 1.75},
{"matrix": [2, 14], "x": 15.75, "y": 2.25},
{"matrix": [3, 0], "x": 0, "y": 3.25, "w": 1.75},
{"matrix": [3, 1], "x": 2.75, "y": 3.25},
{"matrix": [3, 2], "x": 3.75, "y": 3.25},
{"matrix": [3, 3], "x": 4.75, "y": 3.25},
{"matrix": [3, 4], "x": 5.75, "y": 3.25},
{"matrix": [3, 5], "x": 6.75, "y": 3.25},
{"matrix": [3, 6], "x": 7.75, "y": 3.25},
{"matrix": [3, 7], "x": 8.75, "y": 3.25},
{"matrix": [3, 8], "x": 9.75, "y": 3.25},
{"matrix": [3, 9], "x": 10.75, "y": 3.25},
{"matrix": [3, 10], "x": 11.75, "y": 3.25},
{"matrix": [3, 11], "x": 12.75, "y": 3.25},
{"matrix": [3, 13], "x": 13.75, "y": 3.25, "w": 2.5},
{"matrix": [3, 14], "x": 15.75, "y": 3.25},
{"matrix": [4, 0], "x": 0, "y": 4.25, "w": 2.25},
{"matrix": [4, 1], "x": 3.25, "y": 4.25},
{"matrix": [4, 2], "x": 4.25, "y": 4.25, "w": 1.25},
{"matrix": [4, 3], "x": 5.25, "y": 4.25, "w": 2.75},
{"matrix": [4, 4], "x": 6.25, "y": 4.25, "w": 2.75},
{"matrix": [4, 5], "x": 7.25, "y": 4.25, "w": 2.75},
{"matrix": [4, 6], "x": 8.25, "y": 4.25, "w": 2.75},
{"matrix": [4, 7], "x": 9.25, "y": 4.25, "w": 2.25},
{"matrix": [4, 8], "x": 10.25, "y": 4.25, "w": 1.25},
{"matrix": [4, 9], "x": 11.25, "y": 4.25, "w": 1.25},
{"matrix": [4, 10], "x": 12.25, "y": 4.25},
{"matrix": [4, 11], "x": 13.25, "y": 4.25, "w": 2},
{"matrix": [4, 13], "x": 14.5, "y": 4.25},
{"matrix": [4, 14], "x": 15.75, "y": 4.25},
{"matrix": [5, 0], "x": 0, "y": 5.25, "w": 1.25},
{"matrix": [5, 1], "x": 1.25, "y": 5.25, "w": 1.25},
{"matrix": [5, 2], "x": 2.5, "y": 5.25, "w": 1.25},
{"matrix": [5, 3], "x": 3.75, "y": 5.25, "w": 2.25},
{"matrix": [5, 5], "x": 5, "y": 5.25, "w": 1.25},
{"matrix": [5, 6], "x": 6.25, "y": 5.25, "w": 2.75},
{"matrix": [5, 7], "x": 9, "y": 5.25, "w": 1.25},
{"matrix": [5, 9], "x": 10.25, "y": 5.25},
{"matrix": [5, 10], "x": 11.25, "y": 5.25},
{"matrix": [5, 11], "x": 12.25, "y": 5.25},
{"matrix": [5, 12], "x": 13.5, "y": 5.25},
{"matrix": [5, 13], "x": 14.5, "y": 5.25},
{"matrix": [5, 14], "x": 15.5, "y": 5.25}
]
}
}
}

View File

@ -0,0 +1,28 @@
// Copyright 2024 SDK (@sdk66)
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = 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_DEL, KC_MUTE,
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_HOME,
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_END,
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_PGUP,
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_PGDN,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
),
[1] = LAYOUT( /* Base */
_______, KC_MYCM, KC_WHOM, KC_MAIL, KC_CALC, KC_MSEL, KC_MSTP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, GU_TOGG, _______, EE_CLR, _______, EE_CLR, EE_CLR, _______, _______, _______, _______, _______, _______
)
};
// clang-format on

View File

@ -0,0 +1,35 @@
// Copyright 2024 SDK (@sdk66)
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = 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_DEL, KC_MUTE,
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_HOME,
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_END,
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_PGUP,
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_PGDN,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
),
[1] = LAYOUT( /* Base */
_______, KC_MYCM, KC_WHOM, KC_MAIL, KC_CALC, KC_MSEL, KC_MSTP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, GU_TOGG, _______, EE_CLR, _______, EE_CLR, EE_CLR, _______, _______, _______, _______, _______, _______
)
};
#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[0] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)},
[1] = {ENCODER_CCW_CW(_______, _______)},
};
#endif
// clang-format on

View File

@ -0,0 +1,2 @@
ENCODER_MAP_ENABLE = yes
VIA_ENABLE = yes

View File

@ -0,0 +1,21 @@
# EPOMAKER TIDE 75
* Keyboard Maintainer: [sdk66](https://github.com/sdk66)
* Hardware Supported: EPOMAKER TIDE 75
* Hardware Availability: [epomaker](https://www.epomaker.com)
Make example for this keyboard (after setting up your build environment):
make epomaker/tide_75:default
Flashing example for this keyboard:
make epomaker/tide75:default:flash
To reset the board into bootloader mode, do one of the following:
* Hold the Reset switch mounted on the bottom side of the PCB while connecting the USB cable
* Hold the Escape key while connecting the USB cable (also erases persistent settings)
* Fn+R_Shift+Esc will reset the board to bootloader mode if you have flashed the default QMK keymap
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).

View File

@ -0,0 +1 @@
# This file intentionally left blank

View File

@ -0,0 +1,10 @@
// Copyright 2024 SDK (@sdk66)
// SPDX-License-Identifier: GPL-2.0-or-later
#include "quantum.h"
void keyboard_pre_init_kb(void) {
gpio_set_pin_output(A5);
gpio_write_pin_high(A5);
keyboard_pre_init_user();
}

View File

@ -1,5 +1,6 @@
"""This script automates the copying of the default keymap into your own keymap. """This script automates the copying of the default keymap into your own keymap.
""" """
import re
import shutil import shutil
from milc import cli from milc import cli
@ -13,6 +14,13 @@ from qmk.keyboard import keyboard_completer, keyboard_folder
from qmk.userspace import UserspaceDefs from qmk.userspace import UserspaceDefs
def validate_keymap_name(name):
"""Returns True if the given keymap name contains only a-z, 0-9 and underscore characters.
"""
regex = re.compile(r'^[a-zA-Z0-9][a-zA-Z0-9_]+$')
return bool(regex.match(name))
def prompt_keyboard(): def prompt_keyboard():
prompt = """{fg_yellow}Select Keyboard{style_reset_all} prompt = """{fg_yellow}Select Keyboard{style_reset_all}
If you`re unsure you can view a full list of supported keyboards with {fg_yellow}qmk list-keyboards{style_reset_all}. If you`re unsure you can view a full list of supported keyboards with {fg_yellow}qmk list-keyboards{style_reset_all}.
@ -60,6 +68,10 @@ def new_keymap(cli):
cli.log.error(f'Default keymap {{fg_cyan}}{keymap_path_default}{{fg_reset}} does not exist!') cli.log.error(f'Default keymap {{fg_cyan}}{keymap_path_default}{{fg_reset}} does not exist!')
return False return False
if not validate_keymap_name(user_name):
cli.log.error('Keymap names must contain only {fg_cyan}a-z{fg_reset}, {fg_cyan}0-9{fg_reset} and {fg_cyan}_{fg_reset}! Please choose a different name.')
return False
if keymap_path_new.exists(): if keymap_path_new.exists():
cli.log.error(f'Keymap {{fg_cyan}}{user_name}{{fg_reset}} already exists! Please choose a different name.') cli.log.error(f'Keymap {{fg_cyan}}{user_name}{{fg_reset}} already exists! Please choose a different name.')
return False return False

View File

@ -29,6 +29,7 @@ def _convert_macros(via_macros):
if len(via_macros) == 0: if len(via_macros) == 0:
return list() return list()
split_regex = re.compile(r'(}\,)|(\,{)') split_regex = re.compile(r'(}\,)|(\,{)')
macro_group_regex = re.compile(r'({.+?})')
macros = list() macros = list()
for via_macro in via_macros: for via_macro in via_macros:
# Split VIA macro to its elements # Split VIA macro to its elements
@ -38,13 +39,28 @@ def _convert_macros(via_macros):
macro_data = list() macro_data = list()
for m in macro: for m in macro:
if '{' in m or '}' in m: if '{' in m or '}' in m:
# Found keycode(s) # Split macro groups
keycodes = m.split(',') macro_groups = macro_group_regex.findall(m)
# Remove whitespaces and curly braces from around keycodes for macro_group in macro_groups:
keycodes = list(map(lambda s: s.strip(' {}'), keycodes)) # Remove whitespaces and curly braces from around group
# Remove the KC prefix macro_group = macro_group.strip(' {}')
keycodes = list(map(lambda s: s.replace('KC_', ''), keycodes))
macro_data.append({"action": "tap", "keycodes": keycodes}) macro_action = 'tap'
macro_keycodes = []
if macro_group[0] == '+':
macro_action = 'down'
macro_keycodes.append(macro_group[1:])
elif macro_group[0] == '-':
macro_action = 'up'
macro_keycodes.append(macro_group[1:])
else:
macro_keycodes.extend(macro_group.split(',') if ',' in macro_group else [macro_group])
# Remove the KC prefixes
macro_keycodes = list(map(lambda s: s.replace('KC_', ''), macro_keycodes))
macro_data.append({"action": macro_action, "keycodes": macro_keycodes})
else: else:
# Found text # Found text
macro_data.append(m) macro_data.append(m)
@ -54,13 +70,13 @@ def _convert_macros(via_macros):
def _fix_macro_keys(keymap_data): def _fix_macro_keys(keymap_data):
macro_no = re.compile(r'MACRO0?([0-9]{1,2})') macro_no = re.compile(r'MACRO0?\(([0-9]{1,2})\)')
for i in range(0, len(keymap_data)): for i in range(0, len(keymap_data)):
for j in range(0, len(keymap_data[i])): for j in range(0, len(keymap_data[i])):
kc = keymap_data[i][j] kc = keymap_data[i][j]
m = macro_no.match(kc) m = macro_no.match(kc)
if m: if m:
keymap_data[i][j] = f'MACRO_{m.group(1)}' keymap_data[i][j] = f'MC_{m.group(1)}'
return keymap_data return keymap_data