Compare commits

...

12 Commits

Author SHA1 Message Date
chalex
92d35d5502
Merge ce73a3c772 into 9bea332a21 2024-11-20 22:22:14 -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
gaclee3b
ce73a3c772 fix hardware support to includ compatible case configs. fix hardware availability to specify pcb is typically sold in-stock as bulk listing on r/mechmarket 2024-11-01 23:47:31 -04:00
gaclee3b
2347cd926b remove via config files from this area to conform to qmk's new configuration as of august 26, 2024 2024-10-04 06:54:04 -04:00
chalex
77df690461 add hardware availability field information 2024-08-18 21:38:40 -04:00
chalex
cb54748918 add comment on bootmagic top-left key for entering dfu mode. clarify other dfu methods. 2024-08-07 16:35:47 -04:00
chalex
424d4777ac remove config.h since default value 4 builds fine 2024-08-07 16:10:39 -04:00
chalex
3409e230be
Apply suggestions from code review
update bootmagic key assignment. update imagr link.

Co-authored-by: Joel Challis <git@zvecr.com>
Co-authored-by: jack <0x6a73@protonmail.com>
2024-08-07 16:09:52 -04:00
chalex
04fe6752a1
Update readme.md pcb name
missed stale pcb name at the very top
2024-08-07 02:21:38 -04:00
chalex
3a89a53f6f
Update readme.md
checked in version was missing imgur link and had some stale fields that are now updated.
2024-08-07 02:19:50 -04:00
chalex
1c62be8ee6 add piche60 with tested and working files 2024-08-07 02:07:56 -04:00
5 changed files with 230 additions and 9 deletions

View File

@ -0,0 +1,128 @@
{
"manufacturer": "chlx bsmt",
"keyboard_name": "piche60",
"maintainer": "gaclee4b",
"bootloader": "atmel-dfu",
"bootmagic": {
"matrix": [1, 1]
},
"diode_direction": "COL2ROW",
"features": {
"bootmagic": true,
"command": false,
"console": false,
"extrakey": true,
"mousekey": true,
"nkro": true
},
"qmk": {
"locking": {
"enabled": true,
"resync": true
}
},
"indicators": {
"caps_lock": "C7",
"compose": "B5",
"num_lock": "B6",
"scroll_lock": "C6",
"on_state": 0
},
"matrix_pins": {
"cols": ["D0", "F5", "F7", "E6", "F0", "D4", "D5", "D7", "D3", "D2", "D1", "B7", "B3", "B2", "B1", "B0"],
"rows": ["F4", "F1", "F6", "D6", "B4"]
},
"processor": "atmega32u4",
"url": "www.github.com/gaclee3b",
"usb": {
"device_version": "1.1.0",
"pid": "0x0611",
"vid": "0x4358"
},
"layouts": {
"LAYOUT": {
"layout": [
{"matrix": [1, 1], "x": 0.5, "y": 0},
{"matrix": [0, 1], "x": 1.75, "y": 0.25},
{"matrix": [0, 2], "x": 2.75, "y": 0.25},
{"matrix": [0, 3], "x": 3.75, "y": 0},
{"matrix": [0, 4], "x": 4.75, "y": 0.25},
{"matrix": [0, 5], "x": 5.75, "y": 0.25},
{"matrix": [0, 6], "x": 6.75, "y": 0.25},
{"matrix": [0, 7], "x": 7.75, "y": 0.25},
{"matrix": [0, 8], "x": 11, "y": 0.25},
{"matrix": [0, 9], "x": 12, "y": 0.25},
{"matrix": [0, 10], "x": 13, "y": 0.25},
{"matrix": [0, 11], "x": 14, "y": 0.25},
{"matrix": [0, 12], "x": 15, "y": 0},
{"matrix": [0, 13], "x": 16, "y": 0.25},
{"matrix": [0, 14], "x": 17, "y": 0.25},
{"matrix": [0, 15], "x": 18, "y": 0.25},
{"matrix": [2, 1], "x": 0.25, "y": 1},
{"matrix": [1, 2], "x": 1.5, "y": 1.25, "w": 1.5},
{"matrix": [1, 3], "x": 3, "y": 1.25},
{"matrix": [1, 4], "x": 4.25, "y": 1.25},
{"matrix": [1, 5], "x": 5.25, "y": 1.25},
{"matrix": [1, 6], "x": 6.25, "y": 1.25},
{"matrix": [1, 7], "x": 7.25, "y": 1.25},
{"matrix": [1, 8], "x": 10.5, "y": 1.25},
{"matrix": [1, 9], "x": 11.5, "y": 1.25},
{"matrix": [1, 10], "x": 12.5, "y": 1.25},
{"matrix": [1, 11], "x": 13.5, "y": 1.25},
{"matrix": [1, 12], "x": 14.75, "y": 1.25},
{"matrix": [1, 13], "x": 15.75, "y": 1.25},
{"matrix": [1, 14], "x": 16.75, "y": 1.25},
{"matrix": [1, 15], "x": 17.75, "y": 1.25, "w": 1.5},
{"matrix": [3, 1], "x": 0, "y": 2},
{"matrix": [2, 2], "x": 1.5, "y": 2.25, "w": 1.75},
{"matrix": [2, 3], "x": 3.25, "y": 2.25},
{"matrix": [2, 4], "x": 4.5, "y": 2.25},
{"matrix": [2, 5], "x": 5.5, "y": 2.25},
{"matrix": [2, 6], "x": 6.5, "y": 2.25},
{"matrix": [2, 7], "x": 7.5, "y": 2.25},
{"matrix": [2, 8], "x": 10.75, "y": 2.25},
{"matrix": [2, 9], "x": 11.75, "y": 2.25},
{"matrix": [2, 10], "x": 12.75, "y": 2.25},
{"matrix": [2, 11], "x": 13.75, "y": 2.25},
{"matrix": [2, 12], "x": 15.25, "y": 2.25},
{"matrix": [2, 13], "x": 16.25, "y": 2.25},
{"matrix": [2, 14], "x": 17.25, "y": 2.25, "w": 2.25},
{"matrix": [3, 2], "x": 1.5, "y": 3.25, "w": 2.25},
{"matrix": [3, 3], "x": 3.75, "y": 3.25},
{"matrix": [3, 4], "x": 5, "y": 3.25},
{"matrix": [3, 5], "x": 6, "y": 3.25},
{"matrix": [3, 6], "x": 7, "y": 3.25},
{"matrix": [3, 7], "x": 8, "y": 3.25},
{"matrix": [3, 8], "x": 10.25, "y": 3.25},
{"matrix": [3, 9], "x": 11.25, "y": 3.25},
{"matrix": [3, 10], "x": 12.25, "y": 3.25},
{"matrix": [3, 11], "x": 13.25, "y": 3.25},
{"matrix": [3, 12], "x": 15, "y": 3.25},
{"matrix": [3, 13], "x": 16, "y": 3.25},
{"matrix": [3, 14], "x": 17, "y": 3.25, "w": 1.75},
{"matrix": [3, 15], "x": 18.75, "y": 3.25},
{"matrix": [4, 2], "x": 1.5, "y": 4.25, "w": 1.5},
{"matrix": [4, 3], "x": 3, "y": 4.25, "w": 1.25},
{"matrix": [4, 4], "x": 5, "y": 4.25, "w": 1.5},
{"matrix": [4, 6], "x": 6.5, "y": 4.25, "w": 2},
{"matrix": [4, 7], "x": 8.5, "y": 4.25},
{"matrix": [4, 9], "x": 10.25, "y": 4.25, "w": 2.75},
{"matrix": [4, 11], "x": 13, "y": 4.25, "w": 1.5},
{"matrix": [4, 13], "x": 15.5, "y": 4.25, "w": 1.25},
{"matrix": [4, 14], "x": 16.75, "y": 4.25, "w": 1.25},
{"matrix": [4, 15], "x": 18, "y": 4.25, "w": 1.5}
]
}
}
}

View File

@ -0,0 +1,34 @@
/*
Copyright 2024 Alexander Lee <chlx.bsmt@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
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(
KC_ESC, 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_DEL, KC_BSPC,
KC_PGUP, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
KC_PGDN, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1),
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LGUI, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL),
[1] = LAYOUT(
KC_TRNS, KC_TRNS, 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_TRNS, KC_DEL,
KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_UP, KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_END, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS,
KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_MPLY, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_PGDN, KC_DOWN, 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,31 @@
# piche60
![piche60 PCB](https://i.imgur.com/CBeJSUy.jpeg)
- 60% alice format keyboard pcb with USB-C and unified daughterboard compatibility.
- Layout adds 3 additional keys in the palm area voids of traditional alice format.
- USB-C can be snapped off and converted into an ai03 C3 compatible daughterboard.
- Left and right halves can be snapped off and connected through 14-pin JST-SH interfaces.
- PCB can be manufactured with top-side USB-C for compatibility with legacy alice PCBs.
Keyboard Maintainer: [Alexander Lee](https://github.com/gaclee3b)
Hardware Supported: chlx PCB piche60.x.x.x; top-side USB version compatible with most keyboard cases using legacy alice format PCBs (i.e. lubrigante)
Hardware Availability: sales are typically done in-stock as bulk listings on reddit's mechanical keyboard market (r/mechmarket)
Make example for this keyboard (after setting up your build environment):
make chlx/piche60:default
Flashing example for this keyboard:
make chlx/piche60: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 bootloader mode by any of the following options -
- When unplugged, holding the top-left key (typically ESC) while plugging in the keyboard
- When already plugged in, pressing and releasing the reset button on the pcb bottom behind the CAPSLOCK / A-key region
- When already plugged in, shorting out the two reset metal contacts near the 'z' key (accessible through the switch LED slot)

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