Skip to content

Commit

Permalink
feat: Initial config setup for preonic.
Browse files Browse the repository at this point in the history
  • Loading branch information
petejohanson committed Feb 12, 2025
1 parent fa751b1 commit c933441
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 5 deletions.
11 changes: 6 additions & 5 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# For simple board + shield combinations, add them to the top level board and
# shield arrays, for more control, add individual board + shield combinations
# to the `include` property. You can also use the `cmake-args` property to
# pass flags to the build command, `snippet` to add a Zephyr snippet, and
# `artifact-name` to assign a name to distinguish build outputs from each other:
# pass flags to the build command and `artifact-name` to assign a name to
# distinguish build outputs from each other:
#
# board: [ "nice_nano_v2" ]
# shield: [ "corne_left", "corne_right" ]
Expand All @@ -13,8 +13,9 @@
# shield: reviung41
# - board: nice_nano_v2
# shield: corne_left
# snippet: studio-rpc-usb-uart
# cmake-args: -DCONFIG_ZMK_STUDIO=y
# artifact-name: corne_left_with_studio
# cmake-args: -DCONFIG_ZMK_USB_LOGGING=y
# artifact-name: corne_left_with_logging
#
---
include:
- board: keyboardio_preonic
83 changes: 83 additions & 0 deletions config/keyboardio_preonic.keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
* Copyright (c) 2022 Pete Johanson
*
* SPDX-License-Identifier: MIT
*/

#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/outputs.h>

#define PREONIC_ORTHO 1
// #define PREONIC_MIT 1

#define NAV_L 1
#define NUM_L 2
#define SYM_L 3

// Using layer taps on thumbs, having quick tap as well helps w/ repeating space/backspace
&lt { quick_tap_ms = <200>; };

#define BT(n) BT_SEL n

/ {
#if defined(PREONIC_ORTHO)
chosen {
zmk,matrix_transform = &ortho_transform;
};
#endif

keymap {
compatible = "zmk,keymap";

base_layer {
label = "Base";
bindings = <
&kp X &kp Y &kp Z
&kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp DEL
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BKSP
&gresc &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp QUOT
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RET
#if defined(PREONIC_ORTHO)
&kp LCTRL &mo SYM_L &kp LGUI &kp LALT &mo NAV_L &kp SPACE &kp RET &mo NUM_L &kp LEFT &kp UP &kp DOWN &kp RIGHT
#else
&kp LCTRL &mo SYM_L &kp LGUI &kp LALT &mo NAV_L &kp SPACE &mo NUM_L &kp LEFT &kp UP &kp DOWN &kp RIGHT
#endif
>;
};

nav_layer {
label = "Nav";
bindings = <
&trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&bt BT_CLR &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &kp DEL
&trans &trans &trans &trans &trans &trans &trans &kp LEFT &kp DOWN &kp UP &kp RIGHT &trans
&trans &bt BT(0) &bt BT(1) &bt BT(2) &bt BT(3) &bt BT(4) &trans &kp HOME &kp PG_DN &kp PG_UP &kp END &trans
#if defined(PREONIC_ORTHO)
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
#else
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
#endif
>;
};

num_layer {
label = "Num";
bindings = <
&trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &kp LBKT &trans &trans &trans &kp RBKT &kp C_PREV &kp N7 &kp N8 &kp N9 &trans &trans
&trans &kp MINUS &trans &trans &trans &kp EQUAL &kp C_NEXT &kp N4 &kp N5 &kp N6 &trans &trans
&trans &kp GRAVE &trans &trans &trans &kp BSLH &trans &kp N1 &kp N2 &kp N3 &trans &trans
#if defined(PREONIC_ORTHO)
&trans &trans &trans &kp N0 &trans &none &none &kp ESC &kp DEL &trans &trans &trans
#else
&trans &trans &trans &kp N0 &trans &none &trans &kp DEL &trans &trans &trans
#endif
>;
};
};
};

4 changes: 4 additions & 0 deletions config/west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ manifest:
remotes:
- name: zmkfirmware
url-base: https://github.com/zmkfirmware
- name: keyboardio
url-base: https://github.com/petejohanson
# Additional modules containing boards/shields/custom code can be listed here as well
# See https://docs.zephyrproject.org/3.2.0/develop/west/manifest.html#projects
projects:
- name: zmk
remote: zmkfirmware
revision: main
import: app/west.yml
- name: keyboardio-preonic-zmk-module
remote: keyboardio
self:
path: config

0 comments on commit c933441

Please sign in to comment.