Compare commits

...

32 Commits

Author SHA1 Message Date
Christian C. Berclaz
02087883dd
Merge 0c6aed510f into 9bea332a21 2024-11-21 07:30:08 +01: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
Christian C. Berclaz
0c6aed510f fix(zlant_xl): added the forgotten extension .jpg to the imgur link. 2024-11-16 19:03:42 +01:00
Christian C. Berclaz
47a618dfc6 fix(zlant_xl): fixed the wrong link to imgur.com 2024-11-16 18:55:45 +01:00
Christian C. Berclaz
f8c5832e96 chore(zlant_zl): changed image link to imgur.com 2024-11-16 18:51:49 +01:00
Christian C. Berclaz
91f17ac8ce
Update keyboards/zlant_xl/readme.md
Co-authored-by: jack <jack@pngu.org>
2024-11-16 18:39:43 +01:00
Christian C. Berclaz
65a0055409
Update keyboards/zlant_xl/keymaps/default/keymap.c
Co-authored-by: jack <jack@pngu.org>
2024-11-16 18:39:17 +01:00
Christian C. Berclaz
768f01e4f6
Update keyboards/zlant_xl/keymaps/default/keymap.c
Co-authored-by: jack <jack@pngu.org>
2024-11-16 18:38:50 +01:00
Christian C. Berclaz
689e117024 chore(zlant_xl): run qmk format-json on keyboard.json 2024-11-16 14:53:07 +01:00
Christian C. Berclaz
f381765f08 docs(zlant_xl): update readme with correct position of the reset button. 2024-11-16 14:49:11 +01:00
Christian C. Berclaz
b448690e67 fix(zlant_xl): fixed a wrong link in readme.md 2024-11-16 14:45:16 +01:00
Christian C. Berclaz
d29b667c13 docs(zlant_xl): add readme.md, updated keymap.c with correct year 2024-11-16 14:38:03 +01:00
Christian C. Berclaz
2994f91cc8
Merge branch 'qmk:master' into zlant_xl 2024-11-16 14:09:30 +01:00
Christian C. Berclaz
6df80c2f43 ADDED:
keyboard.json for Xlant XL
2024-11-13 19:33:28 +01:00
Christian C. Berclaz
c00d849cf7 zlant_xl:
Reconfigured the keyboard now fully data driven.
TODO: add support for RGB lighting
2024-11-09 22:21:11 +01:00
Christian C. Berclaz
88691e9d69 Added the Zlant_XL keyboard (legacy) 2024-11-08 08:25:12 +01:00
Christian C. Berclaz
ea62d2ecf7
Merge branch 'qmk:master' into zlant_xl 2024-11-08 08:22:11 +01:00
Christian C. Berclaz
6d06fdc610 Cleaning this branch to keep only the zlant_xl files. 2024-11-07 13:48:42 +01:00
Christian C. Berclaz
7a9a6c72b0 Wind X R1:
applied `qmk format-json -i` on keyboard.json to conform with the
project formatt standards.
2024-11-07 12:22:01 +01:00
Christian C. Berclaz
1dbe38d4e9 Wind X R1
- Corrected the default keymap with the QK_GESC key instead of the
  KC_ESC.
- Removed the unnecessary rules.mk in the default layout
2024-11-07 12:18:29 +01:00
Christian C. Berclaz
115bd7b0a3 Added a proper link to the image (logo of windstudio) 2024-11-07 12:15:10 +01:00
Christian C. Berclaz
9c7271f940
Update keyboards/windstudio/wind_x/r1/readme.md
Co-authored-by: jack <jack@pngu.org>
2024-11-07 12:05:13 +01:00
Christian C. Berclaz
c94912dabf
Update keyboards/windstudio/wind_x/r1/keymaps/default/keymap.c
Co-authored-by: jack <jack@pngu.org>
2024-11-07 12:04:37 +01:00
Christian C. Berclaz
8a9530ad51
Update keyboards/windstudio/wind_x/r1/keyboard.json
Co-authored-by: jack <jack@pngu.org>
2024-11-07 12:04:16 +01:00
Christian C. Berclaz
0d7d756722
Update keyboards/windstudio/wind_x/r1/keyboard.json
Co-authored-by: jack <jack@pngu.org>
2024-11-07 12:03:55 +01:00
Christian C. Berclaz
1b8428326d Added a license header to keymap.c 2024-11-05 17:03:04 +01:00
Christian C. Berclaz
550673a379 Added readme.md files for the keyboard and default layout. 2024-11-05 16:44:42 +01:00
Christian C. Berclaz
91a48c4a96 Renamed the folder R1 into r1. 2024-11-05 16:30:59 +01:00
Christian C. Berclaz
cc9b828ba5 Added rules.mk to the default layout 2024-11-05 16:27:33 +01:00
Christian C. Berclaz
084a28b523 Wind X R1: cleaned-up the folders to make clear that this firmware is
for the release 1 of this keyboard.
2024-11-05 16:06:44 +01:00
Christian C. Berclaz
e1db7e4857 Added a default firmware and layout for the WindStudio Wind X R1
keyboard.
2024-11-05 15:55:18 +01:00
5 changed files with 194 additions and 9 deletions

View File

@ -0,0 +1,89 @@
{
"manufacturer": "Ziptyze",
"keyboard_name": "ZlantXL",
"maintainer": "chrisgve",
"bootloader": "atmel-dfu",
"diode_direction": "COL2ROW",
"features": {
"bootmagic": true,
"extrakey": true,
"mousekey": true,
"nkro": true
},
"matrix_pins": {
"cols": ["D6", "D5", "C7", "C5", "D3", "D4"],
"rows": ["C4", "C6", "B1", "B0", "B3", "B2", "B5", "B4", "B7", "B6"]
},
"processor": "atmega32u2",
"usb": {
"device_version": "0.0.1",
"pid": "0x6800",
"vid": "0xFEED"
},
"layouts": {
"LAYOUT": {
"layout": [
{"label": "Esc", "matrix": [0, 0], "x": 0, "y": 0},
{"label": "1", "matrix": [1, 0], "x": 1, "y": 0},
{"label": "2", "matrix": [0, 1], "x": 2, "y": 0},
{"label": "3", "matrix": [1, 1], "x": 3, "y": 0},
{"label": "4", "matrix": [0, 2], "x": 4, "y": 0},
{"label": "5", "matrix": [1, 2], "x": 5, "y": 0},
{"label": "6", "matrix": [0, 3], "x": 6, "y": 0},
{"label": "7", "matrix": [1, 3], "x": 7, "y": 0},
{"label": "8", "matrix": [0, 4], "x": 8, "y": 0},
{"label": "9", "matrix": [1, 4], "x": 9, "y": 0},
{"label": "0", "matrix": [0, 5], "x": 10, "y": 0},
{"label": "Del", "matrix": [1, 5], "x": 11, "y": 0},
{"label": "Tab", "matrix": [2, 0], "x": 0, "y": 1},
{"label": "Q", "matrix": [3, 0], "x": 1, "y": 1},
{"label": "W", "matrix": [2, 1], "x": 2, "y": 1},
{"label": "E", "matrix": [3, 1], "x": 3, "y": 1},
{"label": "R", "matrix": [2, 2], "x": 4, "y": 1},
{"label": "T", "matrix": [3, 2], "x": 5, "y": 1},
{"label": "Y", "matrix": [2, 3], "x": 6, "y": 1},
{"label": "U", "matrix": [3, 3], "x": 7, "y": 1},
{"label": "I", "matrix": [2, 4], "x": 8, "y": 1},
{"label": "O", "matrix": [3, 4], "x": 9, "y": 1},
{"label": "P", "matrix": [2, 5], "x": 10, "y": 1},
{"label": "Backspace", "matrix": [3, 5], "x": 11, "y": 1},
{"label": "Keycaps", "matrix": [4, 0], "x": 0, "y": 2},
{"label": "A", "matrix": [5, 0], "x": 1, "y": 2},
{"label": "S", "matrix": [4, 1], "x": 2, "y": 2},
{"label": "D", "matrix": [5, 1], "x": 3, "y": 2},
{"label": "F", "matrix": [4, 2], "x": 4, "y": 2},
{"label": "G", "matrix": [5, 2], "x": 5, "y": 2},
{"label": "H", "matrix": [4, 3], "x": 6, "y": 2},
{"label": "J", "matrix": [5, 3], "x": 7, "y": 2},
{"label": "K", "matrix": [4, 4], "x": 8, "y": 2},
{"label": "L", "matrix": [5, 4], "x": 9, "y": 2},
{"label": ";", "matrix": [4, 5], "x": 10, "y": 2},
{"label": "'", "matrix": [5, 5], "x": 11, "y": 2},
{"label": "Shift", "matrix": [6, 0], "x": 0, "y": 3},
{"label": "Z", "matrix": [7, 0], "x": 1, "y": 3},
{"label": "X", "matrix": [6, 1], "x": 2, "y": 3},
{"label": "C", "matrix": [7, 1], "x": 3, "y": 3},
{"label": "V", "matrix": [6, 2], "x": 4, "y": 3},
{"label": "B", "matrix": [7, 2], "x": 5, "y": 3},
{"label": "N", "matrix": [6, 3], "x": 6, "y": 3},
{"label": "M", "matrix": [7, 3], "x": 7, "y": 3},
{"label": ",", "matrix": [6, 4], "x": 8, "y": 3},
{"label": ".", "matrix": [7, 4], "x": 9, "y": 3},
{"label": "/", "matrix": [6, 5], "x": 10, "y": 3},
{"label": "Enter", "matrix": [7, 5], "x": 11, "y": 3},
{"label": "", "matrix": [8, 0], "x": 0, "y": 4},
{"label": "Ctrl", "matrix": [9, 0], "x": 1, "y": 4},
{"label": "Alt", "matrix": [8, 1], "x": 2, "y": 4},
{"label": "GUI", "matrix": [9, 1], "x": 3, "y": 4},
{"label": "MO(2)", "matrix": [8, 2], "x": 4, "y": 4},
{"label": " ", "matrix": [9, 2], "x": 5, "y": 4},
{"label": " ", "matrix": [8, 3], "x": 6, "y": 4},
{"label": "MO(1)", "matrix": [9, 3], "x": 7, "y": 4},
{"label": "Left", "matrix": [8, 4], "x": 8, "y": 4},
{"label": "Down", "matrix": [9, 4], "x": 9, "y": 4},
{"label": "Up", "matrix": [8, 5], "x": 10, "y": 4},
{"label": "Right", "matrix": [9, 5], "x": 11, "y": 4}
]
}
}
}

View File

@ -0,0 +1,42 @@
/* Copyright 2024 Christian C. Berclaz
*
* 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
enum layers {
BASE,
FN
};
// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[BASE] = LAYOUT(
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT,
_______, KC_LCTL, KC_LALT, KC_LGUI, KC_LSFT, KC_SPC, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
),
[FN] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_HOME, KC_END, _______,
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
)
};
// clang-format on

View File

@ -0,0 +1,26 @@
# ZLANT XL
![ZLANT XL](https://imgur.com/Vcmjwro.jpg)
_A unique 50% mechanical keyboard that uses a slanted ortholinear layout_
- Keyboard Maintainer: [chrisgve](https://github.com/chrisgve)
- Hardware Supported: Zlant XL w/Ziptyze's atmega32u2 powered controller [The Rune](https://1upkeyboards.com/shop/controllers/the-rune-by-ziptyze/)
- Hardware Availability: [1UP Keyboards](https://1upkeyboards.com/shop/keyboard-kits/diy-40-kits/zlantxl-50-mechanical-keyboard-kit/)
Make example for this keyboard (after setting up your build environment):
make zlant_xl:default
Flashing example for this keyboard:
make zlant_xl:default:flash
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 board (button on The Rune)
- **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