Compare commits

...

12 Commits

Author SHA1 Message Date
lfischer79
e9b46048be
Merge a69069cc9d 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
lfischer79
a69069cc9d
Update config.h 2024-09-26 08:44:11 -04:00
lfischer79
05b8aba6e5
Create raw-kle.txt 2024-09-26 08:38:24 -04:00
lfischer79
23c690e603
Create rules.mk 2024-09-26 08:37:13 -04:00
lfischer79
897d7fe418
Create vial.json 2024-09-26 08:28:14 -04:00
lfischer79
cd1eddf15c
Update config.h 2024-09-26 08:18:16 -04:00
lfischer79
9e8184db08
Create config.h 2024-09-26 08:17:47 -04:00
lfischer79
a721e255c7
Create rules.mk 2024-09-26 08:14:36 -04:00
lfischer79
4ef8b8ab10
Update keymap.c 2024-09-26 08:10:49 -04:00
lfischer79
0c21d576d0 info.json
{
    "manufacturer": "Worldspawn00",
    "keyboard_name": "Memoria 2.0a",
    "maintainer": "Worldspawn00",
    "bootloader": "rp2040",
    "diode_direction": "COL2ROW",
    "features": {
        "bootmagic": true,
        "command": false,
        "console": false,
        "extrakey": true,
        "mousekey": true,
        "encoder": true,
        "nkro": true
    },
    "matrix_pins": {
        "cols": ["GP19", "GP25", "GP24", "GP10", "GP9", "GP6", "GP5", "GP4", "GP3", "GP2", "GP1", "GP0"],
        "rows": ["GP28", "GP26", "GP29", "GP20", "GP23"]
    },
    {
      "encoder": {
        "rotary": [
          { "pin_a": "GP11", "pin_b": "GP12", "resolution": 4 }
        ]
      }
    },
    "processor": "RP2040",
    "url": "https://github.com/shinkaimayano/Memoria",
    "usb": {
        "device_version": "2.0a",
        "pid": "0x0003",
        "vid": "0x548C"
    },
    "layouts": {
        "LAYOUT": {
            "layout": [
                { "matrix": [0, 1], "x": 0.5, "y": 0 },
                { "matrix": [0, 2], "x": 1.5, "y": 0 },
                { "matrix": [0, 3], "x": 2.5, "y": 0 },
                { "matrix": [0, 4], "x": 3.5, "y": 0 },
                { "matrix": [0, 5], "x": 4.5, "y": 0 },
                { "matrix": [0, 6], "x": 5.5, "y": 0 },
                { "matrix": [1, 0], "x": 0, "y": 1 },
                { "matrix": [1, 1], "x": 1, "y": 1 },
                { "matrix": [1, 2], "x": 2, "y": 1 },
                { "matrix": [1, 3], "x": 3, "y": 1 },
                { "matrix": [1, 4], "x": 4, "y": 1 },
                { "matrix": [1, 5], "x": 5, "y": 1 },
                { "matrix": [1, 6], "x": 6, "y": 1 },
                { "matrix": [1, 7], "x": 7, "y": 1 },
                { "matrix": [1, 8], "x": 8, "y": 1 },
                { "matrix": [1, 9], "x": 9, "y": 1 },
                { "matrix": [1, 10], "x": 10, "y": 1 },
                { "matrix": [1, 11], "x": 11, "y": 1 },
                { "matrix": [2, 0], "x": 0, "y": 2 },
                { "matrix": [2, 1], "x": 1.25, "y": 2 },
                { "matrix": [2, 2], "x": 2.25, "y": 2 },
                { "matrix": [2, 3], "x": 3.25, "y": 2 },
                { "matrix": [2, 4], "x": 4.25, "y": 2 },
                { "matrix": [2, 5], "x": 5.25, "y": 2 },
                { "matrix": [2, 6], "x": 6.25, "y": 2 },
                { "matrix": [2, 7], "x": 7.25, "y": 2 },
                { "matrix": [2, 8], "x": 8.25, "y": 2 },
                { "matrix": [2, 9], "x": 9.25, "y": 2 },
                { "matrix": [2, 10], "x": 10.25, "y": 2 },
                { "matrix": [2, 11], "x": 11.25, "y": 2 },
                { "matrix": [3, 0], "x": 0, "y": 3 },
                { "matrix": [3, 1], "x": 1.75, "y": 3 },
                { "matrix": [3, 2], "x": 2.75, "y": 3 },
                { "matrix": [3, 3], "x": 3.75, "y": 3 },
                { "matrix": [3, 4], "x": 4.75, "y": 3 },
                { "matrix": [3, 5], "x": 5.75, "y": 3 },
                { "matrix": [3, 6], "x": 6.75, "y": 3 },
                { "matrix": [3, 7], "x": 7.75, "y": 3 },
                { "matrix": [3, 8], "x": 8.75, "y": 3 },
                { "matrix": [3, 9], "x": 9.75, "y": 3 },
                { "matrix": [3, 10], "x": 10.75, "y": 3 },
                { "matrix": [3, 11], "x": 11.75, "y": 3 },
                { "matrix": [4, 0], "x": 0, "y": 4 },
                { "matrix": [4, 1], "x": 1.25, "y": 4 },
                { "matrix": [4, 2], "x": 2.25, "y": 4 },
                { "matrix": [4, 5], "x": 3.5, "y": 4 },
                { "matrix": [4, 9], "x": 9.75, "y": 4 },
                { "matrix": [4, 10], "x": 10.75, "y": 4 },
                { "matrix": [4, 11], "x": 11.75, "y": 4 }
            ]
        }
    }
}
2024-09-26 07:59:30 -04:00
10 changed files with 317 additions and 9 deletions

View File

@ -0,0 +1,48 @@
{
"manufacturer": "lfischer79",
"keyboard_name": "memoria",
"maintainer": "lfischer79",
"bootloader": "rp2040",
"diode_direction": "COL2ROW",
"features": {
"bootmagic": true,
"command": false,
"console": false,
"extrakey": true,
"mousekey": true,
"nkro": true
},
"matrix_pins": {
"cols": ["C2", "C2", "C2", "C2"],
"rows": ["D1", "D1", "D1", "D1"]
},
"processor": "RP2040",
"url": "",
"usb": {
"device_version": "1.0.0",
"pid": "0x0000",
"vid": "0xFEED"
},
"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": [1, 0], "x": 0, "y": 1},
{"matrix": [1, 1], "x": 1, "y": 1},
{"matrix": [1, 2], "x": 2, "y": 1},
{"matrix": [1, 3], "x": 3, "y": 1},
{"matrix": [2, 0], "x": 0, "y": 2},
{"matrix": [2, 1], "x": 1, "y": 2},
{"matrix": [2, 2], "x": 2, "y": 2},
{"matrix": [2, 3], "x": 3, "y": 2},
{"matrix": [3, 0], "x": 0, "y": 3},
{"matrix": [3, 1], "x": 1, "y": 3},
{"matrix": [3, 2], "x": 2, "y": 3},
{"matrix": [3, 3], "x": 3, "y": 3}
]
}
}
}

View File

@ -0,0 +1,13 @@
#pragma once
#define VIAL_KEYBOARD_UID {0x5B, 0x05, 0x1C, 0x81, 0x84, 0x3F, 0xFF, 0x4F}
#define DYNAMIC_KEYMAP_LAYER_COUNT 4
#define RGB_MATRIX_LED_PROCESS_LIMIT (RGB_MATRIX_LED_COUNT + 12)
#define RGB_MODE_PLAIN
#define RGB_MODE_RAINBOW
#define RGB_MODE_SWIRL

View File

@ -0,0 +1,52 @@
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(
KC_1, KC_2, KC_3, KC_4, KC_5, KC_6,
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_RSFT,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LEFT, KC_DOWN, KC_RGHT
)
};
/* aRGB Configuration */
led_config_t g_led_config = { {
// Key Matrix to LED Index
{ NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
{ 2, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
{ 1, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
{ 0, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
{ NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }
}, {
// LED Index to Physical Position
{ 0, 16 }, { 0, 8 }, { 0, 5 }
}, {
// LED Index to Flag
8, 8, 8
} };
#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
[0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
// Encoder 1
};
#endif
void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
if (layer_state_is (1)) {
RGB_MATRIX_INDICATOR_SET_COLOR(2, 60, 15, 15);
} else {
RGB_MATRIX_INDICATOR_SET_COLOR(2, 0, 0, 0);
}
if (layer_state_is (2)) {
RGB_MATRIX_INDICATOR_SET_COLOR(1, 15, 60, 15);
} else {
RGB_MATRIX_INDICATOR_SET_COLOR(1, 0, 0, 0);
}
if (layer_state_is (3)) {
RGB_MATRIX_INDICATOR_SET_COLOR(0, 15, 15, 60);
} else {
RGB_MATRIX_INDICATOR_SET_COLOR(0, 0, 0, 0);
}
}

View File

@ -0,0 +1,5 @@
VIA_ENABLE = yes
VIAL_ENABLE = yes
VIAL_INSECURE = yes
VIALRGB_ENABLE = yes
ENCODER_MAP_ENABLE = yes

View File

@ -0,0 +1,124 @@
{
"vial": {
"midi": "advanced"
},
"lighting": "vial_rgb",
"matrix": {
"rows": 5,
"cols": 12
},
"layouts": {
"labels":[
[
"Bottom Row",
"Jetvan (6.25u)",
"Minisub (2.75u-2.25u-1.25u)"
]
],
"keymap":[
[
{ "x": 6.75 },
"0,0\n\n\n\n\n\n\n\n\ne",
"0,1\n\n\n\n\n\n\n\n\ne"],
[
{
"y": -0.75, "x": 0.5
},
"0,1",
"0,2",
"0,3",
"0,4",
"0,5",
"0,6"
],
[
"1,0",
"1,1",
"1,2",
"1,3",
"1,4",
"1,5",
"1,6",
"1,7",
"1,8",
"1,9",
"1,10",
{
"w": 1.75
},
"1,11"
],
[
{
"w": 1.25
},
"2,0",
"2,1",
"2,2",
"2,3",
"2,4",
"2,5",
"2,6",
"2,7",
"2,8",
"2,9",
"2,10",
{
"w": 1.5
},
"2,11"
],
[
{
"w": 1.75
},
"3,0",
"3,1",
"3,2",
"3,3",
"3,4",
"3,5",
"3,6",
"3,7",
"3,8",
"3,9",
"3,10",
"3,11"
],
[
{
"w": 1.25
},
"4,0",
"4,1",
{
"w": 1.25
},
"4,2",
{
"w": 6.25
},
"4,5\n\n\n0,0",
"4,9",
"4,10",
"4,11"
],
[
{
"y": 0.25,
"x": 3.5,
"w": 2.75
},
"4,4\n\n\n0,1",
{
"w": 2.25
},
"4,5\n\n\n0,1",
{
"w": 1.25
},
"4,8\n\n\n0,1"
]
]
}
}

View File

@ -0,0 +1,7 @@
[{x:6.75},"0,0\n\n\n\n\n\n\n\n\ne","0,1\n\n\n\n\n\n\n\n\ne"],
[{y:-0.75,x:0.5},"0,1","0,2","0,3","0,4","0,5","0,6"],
["1,0","1,1","1,2","1,3","1,4","1,5","1,6","1,7","1,8","1,9","1,10",{w:1.75},"1,11"],
[{w:1.25},"2,0","2,1","2,2","2,3","2,4","2,5","2,6","2,7","2,8","2,9","2,10",{w:1.5},"2,11"],
[{w:1.75},"3,0","3,1","3,2","3,3","3,4","3,5","3,6","3,7","3,8","3,9","3,10","3,11"],
[{w:1.25},"4,0","4,1",{w:1.25},"4,2",{w:6.25},"4,5\n\n\n0,0","4,9","4,10","4,11"],
[{y:0.25,x:3.5,w:2.75},"4,4\n\n\n0,1",{w:2.25},"4,5\n\n\n0,1",{w:1.25},"4,8\n\n\n0,1"]

View File

@ -0,0 +1,27 @@
# memoria
![memoria](imgur.com image replace me!)
*A short description of the keyboard/project*
* Keyboard Maintainer: [lfischer79](https://github.com/lfischer79)
* Hardware Supported: *The PCBs, controllers supported*
* Hardware Availability: *Links to where you can find this hardware*
Make example for this keyboard (after setting up your build environment):
make memoria:default
Flashing example for this keyboard:
make memoria: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

@ -0,0 +1,4 @@
RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = ws2812
WS2812_DRIVER = vendor
ENCODER_ENABLE = yes

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