Compare commits

...

26 Commits

Author SHA1 Message Date
nagmeal
7b787fcd45
Merge d7f856ebdd 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
t-ando
d7f856ebdd Merge branch 'master' into nagmeal/develop 2024-09-15 22:19:29 +09:00
t-ando
cfd24c2c79 delete VIA kyemap 2024-08-31 21:16:58 +09:00
t-ando
52c2ed4c9d remove: rules.mk update: keyboard.json 2024-08-31 20:53:28 +09:00
t-ando
339e3f9c2b Merge branch 'master' into nagmeal/develop 2024-08-31 20:40:35 +09:00
t-ando
2f5d377444 LAYOUT_split_7x4 -> LAYOUT 2024-08-05 00:37:31 +09:00
t-ando
8c93d5a78b LAYOUT_split_6x3_3_1 -> LAYOUT_split_7x4 2024-07-12 22:16:08 +09:00
t-ando
a8a6f7b7e3 correcting imgur URL 2024-07-04 12:14:46 +09:00
t-ando
cd173c714e Corrected according to review 2024-07-04 08:53:43 +09:00
t-ando
ee20c8b721 Move VIA_ENABLE to the via directory 2024-07-04 00:36:51 +09:00
t-ando
181920e4d4 revet .vscode/settings.json 2024-07-03 23:34:14 +09:00
t-ando
c96449b48f VIA support 2024-07-03 23:15:56 +09:00
t-ando
8eeb55a337 reorganized directories 2024-07-03 23:15:56 +09:00
t-ando
99ec7f9161 LED compatible 2024-07-03 23:15:56 +09:00
t-ando
4660f77763 Importing the latest from fork source 2024-07-03 23:15:55 +09:00
t-ando
7891abb01a fiix 2024-07-03 23:15:55 +09:00
t-ando
1df17d909d 動く事を確認できた状態 2024-07-03 23:15:55 +09:00
t-ando
6d45ffbcc0 yubino_hara 2024-07-03 23:15:55 +09:00
t-ando
8dcdbfbb68 kemap/viaを一旦削除。普段使いと同じキー配置にdefaultキーマップを更新 2024-07-03 23:15:54 +09:00
t-ando
64d9dbe0d7 keymap作成 2024-07-03 23:15:54 +09:00
t-ando
17f7f21016 (多分)動く状態まで 2024-07-03 23:15:54 +09:00
t-ando
26aa0b5f5e 名前入れ直し 2024-07-03 23:15:54 +09:00
t-ando
3f56cc609d qmk new-keyboardで再作成 2024-07-03 23:15:53 +09:00
t-ando
532ba769e0 crkbdをコピーしてsepsepkbdを作成 2024-07-03 23:15:53 +09:00
5 changed files with 212 additions and 9 deletions

View File

@ -0,0 +1,112 @@
{
"manufacturer": "t-ando",
"keyboard_name": "yubino_hara",
"maintainer": "nagmeal",
"bootloader": "rp2040",
"diode_direction": "COL2ROW",
"features": {
"rgblight": true,
"bootmagic": true,
"extrakey": true,
"mousekey": true,
"nkro": true
},
"split": {
"enabled": true,
"soft_serial_pin": "GP0",
"serial": {
"driver": "vendor",
"pin": "GP0"
},
"transport": {
"sync": {
"matrix_state": true
}
}
},
"matrix_pins": {
"cols": ["GP1", "GP2", "GP3", "GP4", "GP5", "GP6", "GP7"],
"rows": ["GP29", "GP28", "GP27", "GP26"]
},
"processor": "RP2040",
"url": "",
"usb": {
"device_version": "1.0.0",
"pid": "0x0000",
"vid": "0x7A93"
},
"ws2812": {
"driver": "vendor",
"pin": "GP14"
},
"rgblight": {
"led_count": 44,
"split": true,
"split_count": [22, 22],
"sleep": true,
"default": {
"hue": 0,
"sat": 0,
"val": 50
}
},
"layouts": {
"LAYOUT": {
"layout": [
{"matrix": [0, 0], "label":"0,0", "x":0, "y":0},
{"matrix": [0, 1], "label":"0,1", "x":1, "y":0},
{"matrix": [0, 2], "label":"0,2", "x":2, "y":0},
{"matrix": [0, 3], "label":"0,3", "x":3, "y":0},
{"matrix": [0, 4], "label":"0,4", "x":4, "y":0},
{"matrix": [0, 5], "label":"0,5", "x":5, "y":0},
{"matrix": [4, 5], "label":"0,8", "x":9.25, "y":0},
{"matrix": [4, 4], "label":"0,9", "x":10.25, "y":0},
{"matrix": [4, 3], "label":"0,10", "x":11.25, "y":0},
{"matrix": [4, 2], "label":"0,11", "x":12.25, "y":0},
{"matrix": [4, 1], "label":"0,12", "x":13.25, "y":0},
{"matrix": [4, 0], "label":"0,13", "x":14.25, "y":0},
{"matrix": [1, 0], "label":"1,0", "x":0, "y":1},
{"matrix": [1, 1], "label":"1,1", "x":1.25, "y":1},
{"matrix": [1, 2], "label":"1,2", "x":2.25, "y":1},
{"matrix": [1, 3], "label":"1,3", "x":3.25, "y":1},
{"matrix": [1, 4], "label":"1,4", "x":4.25, "y":1},
{"matrix": [1, 5], "label":"1,5", "x":5.25, "y":1},
{"matrix": [5, 5], "label":"1,8", "x":9, "y":1},
{"matrix": [5, 4], "label":"1,9", "x":10, "y":1},
{"matrix": [5, 3], "label":"1,10", "x":11, "y":1},
{"matrix": [5, 2], "label":"1,11", "x":12, "y":1},
{"matrix": [5, 1], "label":"1,12", "x":13, "y":1},
{"matrix": [5, 0], "label":"1,13", "x":14.25, "y":1},
{"matrix": [2, 0], "label":"2,0", "x":0, "y":2},
{"matrix": [2, 1], "label":"2,1", "x":1, "y":2},
{"matrix": [2, 2], "label":"2,2", "x":2, "y":2},
{"matrix": [2, 3], "label":"2,3", "x":3, "y":2},
{"matrix": [2, 4], "label":"2,4", "x":4, "y":2},
{"matrix": [2, 5], "label":"2,5", "x":5, "y":2},
{"matrix": [2, 6], "label":"2,6", "x":6.25, "y":1, "h":2},
{"matrix": [6, 6], "label":"2,7", "x":8, "y":1, "h":2},
{"matrix": [6, 5], "label":"2,8", "x":9.25, "y":2},
{"matrix": [6, 4], "label":"2,9", "x":10.25, "y":2},
{"matrix": [6, 3], "label":"2,10", "x":11.25, "y":2},
{"matrix": [6, 2], "label":"2,11", "x":12.25, "y":2},
{"matrix": [6, 1], "label":"2,12", "x":13.25, "y":2},
{"matrix": [6, 0], "label":"2,13", "x":14.25, "y":2},
{"matrix": [3, 4], "label":"3,4", "x":4.25, "y":3.25},
{"matrix": [3, 5], "label":"3,5", "x":5.25, "y":3},
{"matrix": [3, 6], "label":"3,6", "x":6.25, "y":3.25},
{"matrix": [7, 6], "label":"3,7", "x":8, "y":3.25},
{"matrix": [7, 5], "label":"3,8", "x":9, "y":3},
{"matrix": [7, 4], "label":"3,9", "x":10, "y":3.25}
]
}
}
}

View File

@ -0,0 +1,31 @@
// Copyright 2023 QMK
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(
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_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_MINS,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BTN1, KC_BTN2, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ESC,
KC_LGUI, MO(1), KC_SPC, KC_ENT, MO(2), KC_RALT
),
[1] = LAYOUT(
KC_TAB, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_ASTR, KC_AMPR, KC_LPRN, KC_RPRN, KC_CIRC, KC_BSPC,
KC_LCTL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, LGUI(KC_SPC), KC_QUOT, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, KC_GRV,
KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LNG2, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, KC_TILD,
_______, _______, _______, _______, MO(3), _______
),
[2] = LAYOUT(
KC_TAB, XXXXXXX, KC_7, KC_8, KC_9, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX,
KC_LCTL, XXXXXXX, KC_4, KC_5, KC_6, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX,
KC_LSFT, KC_LALT, KC_1, KC_2, KC_3, KC_0, _______, _______, KC_LNG1, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, MO(3), _______, _______, _______, _______
),
[3] = LAYOUT(
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_LCTL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
KC_LSFT, XXXXXXX, XXXXXXX, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG, _______, RGB_VAD, RGB_SAD, RGB_HUD, XXXXXXX, XXXXXXX, XXXXXXX,
_______, _______, _______, _______, _______, _______
),
};

View File

@ -0,0 +1,32 @@
# yubino_hara
![yubino_hara](https://i.imgur.com/WtB6bMy.jpeg)
- Split
- Reverse tilt (tilted from front to back)
- Symmetrical staggered
* Keyboard Maintainer: [t-ando](https://github.com/nagmeal)
* Hardware Supported: *YUBINO-HARA PCB, RP2040-zero*
* Hardware Availability: *[PCB & Case Data](https://github.com/nagmeal/sep-sep-kbd/tree/main/yubino-hara)*
Make example for this keyboard (after setting up your build environment):
make sepsepkbd/yubino_hara:default
Flashing example for this keyboard:
make sepsepkbd/yubino_hara: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**: Connect to PC while holding down the "BOOT" button on the RP2040-zero.
* **Physical reset button**: Press the "RESET" button on RP2040-zero.

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