Compare commits

...

44 Commits

Author SHA1 Message Date
Micah
644724e5ef
Merge 49994e2ee7 into 9bea332a21 2024-11-20 22:22:15 -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
Micah
49994e2ee7 Delete R2 2024-11-18 05:06:21 +08:00
Micah
bfa9f56472 Merge branch 'master' of https://github.com/micahyy/qmk_firmware 2024-11-06 21:35:37 +08:00
Micah
2d03adccea
Delete keyboards/.vscode/settings.json 2024-11-06 21:28:43 +08:00
Micah
b158846dd2 format keyboard.json 2024-11-04 20:02:05 +08:00
Micah
11e01001b6 change layer1 2024-11-04 19:56:53 +08:00
Micah
dac5b384b1
Update keyboards/czmao/ds17r2/keymaps/default/keymap.c
Co-authored-by: jack <jack@pngu.org>
2024-11-04 19:49:43 +08:00
Micah
21ce200089
Update keyboards/czmao/ds17r2/keymaps/default/keymap.c
Co-authored-by: jack <jack@pngu.org>
2024-11-04 19:49:16 +08:00
Micah
3b49c6c824
Update keyboards/czmao/ds17r2/keymaps/default/keymap.c
Co-authored-by: jack <jack@pngu.org>
2024-11-04 19:47:07 +08:00
Micah
94a4a618a1
Update keyboards/czmao/ds17r2/readme.md
Co-authored-by: jack <jack@pngu.org>
2024-11-04 19:46:42 +08:00
Micah
cef68a422f
Update keyboards/czmao/ds17r2/keyboard.json
Co-authored-by: jack <jack@pngu.org>
2024-11-04 19:46:15 +08:00
Micah
9cd8c802df update readme 2024-11-03 21:04:39 +08:00
Micah
b2b4d39f33 delete sw65 2024-11-03 20:59:07 +08:00
Micah
b07a965200 delete other beyond ds17 2024-11-03 20:55:05 +08:00
Micah
91926a7040 submit 2024-11-03 20:43:38 +08:00
Micah
5389b80ca2 upadte ds17
upadte ds17
2024-11-03 20:42:41 +08:00
Micah
4dcca8f3a5 update DS17 2024-09-23 11:50:59 +08:00
Micah
cc746de87c update ds17 rgb maxbrightness to 180 2024-09-16 18:03:01 +08:00
Micah
fa0d72f989 update Ds17 2024-09-16 17:58:50 +08:00
Micah
5d7a3a9735 update DS17 default keymap 2024-09-11 18:12:22 +08:00
Micah
e950864e99 update ds17 2024-09-11 18:07:10 +08:00
Micah
c170d43d91 Update readme.md 2024-09-11 17:55:00 +08:00
Micah
f3cd0cfd24 update ds17 2024-09-11 17:48:35 +08:00
Micah
6559da777e Update readme.md 2024-09-11 16:58:07 +08:00
Micah
64ed6ded43 delete sk60 2024-09-11 16:51:42 +08:00
Micah
bf09550108 update ds17 RGB_Matrix 2024-09-08 22:28:47 +08:00
Micah
afc8f0a218 upload integral 2024-09-08 20:27:47 +08:00
Micah
dd7bb6d0fa delete I 2024-09-08 20:27:06 +08:00
Micah
d50b8ed982 Update readme.md 2024-09-08 20:15:21 +08:00
Micah
4c18328bef DS17层10,SK60改名字 2024-09-08 20:11:08 +08:00
Micah
37ed8c6d6f change SK60 and ds17 to 新版本固件 2024-09-08 19:43:47 +08:00
Micah
4690b1856f Update readme.md 2024-09-08 18:55:41 +08:00
Micah
e339335a0e submit ds17 2024-09-08 18:52:01 +08:00
Micah
87e8fcdb18 Delete config.h 2024-09-08 17:55:33 +08:00
Micah
9914af9a43 sk60 2024-09-08 17:44:19 +08:00
Micah
74f33a8b5c delete 2024-09-08 17:43:49 +08:00
Micah
7e95504680 Merge branch 'master' of https://github.com/micahyy/qmk_firmware 2024-09-08 17:43:40 +08:00
Micah
b7215e462a new sk60 2024-09-08 17:25:21 +08:00
Micah
ab019cb1a8 delete sk60 2024-09-08 17:24:51 +08:00
Micah
790a00706d update sk60 2024-09-08 17:17:20 +08:00
Micah
97c44d048d
Update readme.md 2024-09-08 16:51:52 +08:00
Micah
94ab372a48 submit sk60
submit sk60
2024-09-08 16:48:54 +08:00
5 changed files with 277 additions and 9 deletions

View File

@ -0,0 +1,143 @@
{
"keyboard_name": "mao_DS17R3_lefthand",
"manufacturer": "CZMAO",
"url": "https://github.com/micahyy/czmao/tree/main/ds17_solder",
"maintainer": "MAOKB",
"diode_direction": "COL2ROW",
"processor": "STM32F103",
"bootloader": "stm32duino",
"usb": {
"vid": "0x4A15",
"pid": "0x4A15",
"device_version": "1.0.0"
},
"features": {
"bootmagic": true,
"command": true,
"console": true,
"extrakey": true,
"mousekey": true,
"nkro": true,
"rgb_matrix": true
},
"dynamic_keymap": {
"layer_count": 8
},
"matrix_pins": {
"cols": ["B12", "B14", "B15", "A8"],
"rows": ["A9", "A10", "A15", "B3", "B4"]
},
"ws2812": {
"pin": "B13"
},
"rgb_matrix": {
"animations": {
"gradient_left_right": true,
"breathing": true,
"band_sat": true,
"band_val": true,
"band_pinwheel_sat": true,
"band_pinwheel_val": true,
"band_spiral_sat": true,
"band_spiral_val": 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,
"rainbow_pinwheels": true,
"raindrops": true,
"jellybean_raindrops": true,
"hue_breathing": true,
"hue_pendulum": true,
"hue_wave": true,
"typing_heatmap": true,
"solid_reactive_simple": true,
"solid_reactive": true,
"solid_reactive_wide": true,
"solid_reactive_multiwide": true,
"solid_reactive_cross": true,
"solid_reactive_multicross": true,
"solid_reactive_nexus": true,
"solid_reactive_multinexus": true,
"splash": true,
"multisplash": true,
"solid_splash": true,
"solid_multisplash": true
},
"driver": "ws2812",
"max_brightness":180,
"layout": [
{ "flags": 2, "matrix": [0, 0], "x": 224, "y": 0 },
{ "flags": 2, "matrix": [0, 1], "x": 150, "y": 0 },
{ "flags": 2, "matrix": [0, 2], "x": 75, "y": 0 },
{ "flags": 2, "matrix": [0, 3], "x": 0, "y": 0 },
{ "flags": 2, "matrix": [1, 0], "x": 224, "y": 16 },
{ "flags": 2, "matrix": [1, 1], "x": 150, "y": 16 },
{ "flags": 2, "matrix": [1, 2], "x": 75, "y": 16 },
{ "flags": 2, "matrix": [1, 3], "x": 0, "y": 24 },
{ "flags": 2, "matrix": [2, 0], "x": 224, "y": 32 },
{ "flags": 2, "matrix": [2, 1], "x": 150, "y": 32 },
{ "flags": 2, "matrix": [2, 2], "x": 75, "y": 32 },
{ "flags": 2, "matrix": [3, 0], "x": 224, "y": 48 },
{ "flags": 2, "matrix": [3, 1], "x": 150, "y": 48 },
{ "flags": 2, "matrix": [3, 2], "x": 75, "y": 48 },
{ "flags": 2, "matrix": [3, 3], "x": 0, "y": 56 },
{ "flags": 2, "matrix": [4, 0], "x": 187, "y": 64 },
{ "flags": 2, "matrix": [4, 2], "x": 75, "y": 64 }
],
"sleep": true
},
"layouts": {
"LAYOUT_numberpad_5x4": {
"layout": [
{"label":"FN", "matrix": [ 0,0],"x":0,"y":0},
{"label":"PSLS", "matrix": [ 0,1],"x":1,"y":0},
{"label":"PAST", "matrix": [ 0,2],"x":2,"y":0},
{"label":"PMNS", "matrix": [ 0,3],"x":3,"y":0},
{"label":"P7", "matrix": [ 1,0],"x":0,"y":1},
{"label":"P8", "matrix": [ 1,1],"x":1,"y":1},
{"label":"P9", "matrix": [ 1,2],"x":2,"y":1},
{"label":"P4", "matrix": [2,0],"x":2,"y":1},
{"label":"P5", "matrix": [2,1],"x":3,"y":1},
{"label":"P6", "matrix": [2,2],"x":4,"y":1},
{"label":"PPLS", "matrix": [1,3],"x":3,"y":1,"h":2},
{"label":"P1", "matrix": [ 3,0],"x":0,"y":2},
{"label":"P2", "matrix": [ 3,1],"x":1,"y":2},
{"label":"P3", "matrix": [ 3,2],"x":2,"y":2},
{"label":"P0", "matrix": [ 4,0],"x":0,"y":3},
{"label":"PDOT", "matrix": [ 4,2],"x":1,"y":3},
{"label":"PENT", "matrix": [ 3,3],"x":3,"y":2,"h":2}
]
}
}
}

View File

@ -0,0 +1,63 @@
/*
Copyright 2012,2013 Jun Wako <wakojun@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
// enum custom_keycodes {
// QWERTY = SAFE_RANGE,
// LOWER,
// RAISE
// };
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_numberpad_5x4(
//1 2 3 4
MO(1), KC_PSLS, KC_PAST, KC_PMNS,
KC_P7, KC_P8, KC_P9,
KC_P4, KC_P5, KC_P6, KC_PPLS,
KC_P1, KC_P2, KC_P3,
KC_P0, KC_PDOT, KC_PENT
),
[1] = LAYOUT_numberpad_5x4(
MO(1), KC_NUM, MO(2), KC_CALC,
KC_HOME, KC_UP, KC_PGUP,
KC_LEFT, KC_TRNS, KC_RGHT, KC_TRNS,
KC_END, KC_DOWN, KC_PGDN,
QK_RBT, KC_TRNS, KC_TRNS
),
[2] = LAYOUT_numberpad_5x4(
KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAI,
RGB_TOG, RGB_SAI, KC_TRNS,
RGB_HUD, KC_TRNS, RGB_HUI, RGB_VAD,
KC_TRNS, RGB_SAD, KC_TRNS,
RGB_MOD, KC_TRNS, KC_TRNS
),
[3] = LAYOUT_numberpad_5x4(
KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAI,
KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS
)
};

View File

@ -0,0 +1,34 @@
# mao ds 17r3l
3D print case , taobao link below
[link](https://item.taobao.com/item.htm?ft=t&id=848078753675&spm=a21dvs.23580594.0.0.1d292c1bICfvhj&sku_properties=122216346%3A21959%3B122216808%3A10491261%3B211004089%3A34593035581)
make czmao/ds17r3l:default
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).
* Keyboard Maintainer: [CZMAO](https://github.com/smollchungus)
* Hardware Supported: *CZMAO*
* Hardware Availability: *CZMAO Keyboards*
Make example for this keyboard (after setting up your build environment):
make czmao/ds17r2:default
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 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 `QK_BOOT` if it is available

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