Compare commits

...

11 Commits

Author SHA1 Message Date
takashicompany
f6f0394dd5
Merge f3605e745a 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
takashicompany
f3605e745a
Update readme.md 2024-10-10 00:42:19 +09:00
takashicompany
5ee1bff088 fix layout 2024-10-10 00:40:15 +09:00
takashicompany
642e354213
Update keyboards/takashicompany/jourkey/readme.md
Co-authored-by: Joel Challis <git@zvecr.com>
2024-10-04 14:20:40 +09:00
takashicompany
c730a45e18 format json 2024-09-19 02:11:20 +09:00
takashicompany
a8ad50fb6d jourkey 2024-09-19 02:02:52 +09:00
takashicompany
272b507494 fix keymap 2024-09-12 15:17:33 +09:00
takashicompany
072e2b0224 rotary encoder 2024-09-01 15:28:03 +09:00
takashicompany
739d14215c jourkey 2024-09-01 00:01:59 +09:00
6 changed files with 148 additions and 9 deletions

View File

@ -0,0 +1,51 @@
{
"manufacturer": "takashicompany",
"keyboard_name": "Jourkey",
"maintainer": "takashicompany",
"development_board": "promicro",
"diode_direction": "COL2ROW",
"encoder": {
"rotary": [
{"pin_a": "D1", "pin_b": "D0"}
]
},
"features": {
"bootmagic": true,
"command": false,
"console": false,
"encoder": true,
"extrakey": true,
"mousekey": true,
"nkro": true
},
"matrix_pins": {
"direct": [
["D4", "C6", "D7", "E6", "B4", "F5", "F6", "F7", "B5", "B1", "B3", "B2", "B6"]
]
},
"url": "",
"usb": {
"device_version": "1.0.0",
"pid": "0x0062",
"vid": "0x7463"
},
"layouts": {
"LAYOUT": {
"layout": [
{"matrix": [0, 0], "x": 0, "y": 0},
{"matrix": [0, 1], "x": 1, "y": 0},
{"matrix": [0, 2], "x": 2, "y": 0},
{"matrix": [0, 3], "x": 3, "y": 0},
{"matrix": [0, 4], "x": 4, "y": 0},
{"matrix": [0, 5], "x": 0, "y": 1, "w": 1.5},
{"matrix": [0, 6], "x": 1.5, "y": 1},
{"matrix": [0, 7], "x": 2.5, "y": 1},
{"matrix": [0, 8], "x": 3.5, "y": 1, "w": 1.5},
{"matrix": [0, 9], "x": 0, "y": 2, "w":1.75},
{"matrix": [0, 10], "x": 1.75, "y": 2},
{"matrix": [0, 11], "x": 2.75, "y": 2},
{"matrix": [0, 12], "x": 3.75, "y": 2, "w":1.25}
]
}
}
}

View File

@ -0,0 +1,18 @@
// 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_ESC, KC_1, KC_2, KC_3, KC_4,
KC_TAB, KC_Q, KC_W, KC_ENT,
KC_LCTL, KC_A, KC_S, KC_RSFT
)
};
#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[0] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN) }
};
#endif

View File

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

View File

@ -0,0 +1,41 @@
# Joukey
![takashicompany/jourkey](https://i.imgur.com/pCrTbKn.jpeg)
Jourkey was designed as “a keyboard for taking pictures with scenery while traveling.
The layout is like a smaller version of a traditional keyboard.
Decorate it with your favorite keycaps and case to make it your travel companion.
Of course, it can also be used as a macro pad.
---
Jourkeyは「旅先で景色と写真を撮るためのキーボード」としてデザインされました。
従来のキーボードを小さくしたようなレイアウトです。
お気に入りのキーキャップやケースでデコレーションして貴方の旅のお供になります。
もちろん、マクロパッドとして使用することも可能です。
* Keyboard Maintainer: [takashicompany](https://github.com/takashicompany)
* Hardware Supported: Jourkey PCB, Pro Micro
* Hardware Availability: https://github.com/takashicompany/jourkey
Make example for this keyboard (after setting up your build environment):
make takashicompany/jourkey:default
Flashing example for this keyboard:
make takashicompany/jourkey: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 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.
"""
import re
import shutil
from milc import cli
@ -13,6 +14,13 @@ from qmk.keyboard import keyboard_completer, keyboard_folder
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():
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}.
@ -60,6 +68,10 @@ def new_keymap(cli):
cli.log.error(f'Default keymap {{fg_cyan}}{keymap_path_default}{{fg_reset}} does not exist!')
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():
cli.log.error(f'Keymap {{fg_cyan}}{user_name}{{fg_reset}} already exists! Please choose a different name.')
return False

View File

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