Skip to content

Commit

Permalink
Add custom keymap
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroDSFerreira committed May 26, 2024
1 parent 8c81db8 commit d0cfc05
Show file tree
Hide file tree
Showing 3 changed files with 204 additions and 29 deletions.
82 changes: 55 additions & 27 deletions config/corne.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -8,49 +8,77 @@
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/mouse.h>
#include "keymap_pt.h"

#define DEFAULT 0
#define LOWER 1
#define RAISE 2
#define EXTRA 3
#define xxx &none
#define ___ &trans
#define MEH LC(LS(LALT))

/ {
keymap {
compatible = "zmk,keymap";

default_layer {
// -----------------------------------------------------------------------------------------
// | TAB | Q | W | E | R | T | | Y | U | I | O | P | BKSP |
// | CTRL | A | S | D | F | G | | H | J | K | L | ; | ' |
// | SHFT | Z | X | C | V | B | | N | M | , | . | / | ESC |
// | GUI | LWR | SPC | | ENT | RSE | ALT |
// ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// | ESC | Q | W | E | R | T | | Y | U | I | O | P | DEL |
// | CTRL | A | S | D | F | G | | H | J | K | L | ; | ' |
// | MEH | Z | X | C | V | B | | N | M | , | . | / | º |
//
// | GUI | TAB | SPC | | ENT | BSPC | ALT |
bindings = <
&kp TAB &kp Q &mmv MOVE_UP &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSPC
&kp LCTRL &mmv MOVE_LEFT &mmv MOVE_DOWN &mmv MOVE_RIGHT &kp F &kp G &kp H &msc MOVE_DOWN &msc MOVE_UP &kp L &kp SEMI &kp SQT
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp ESC
&kp LGUI &mo 1 &kp SPACE &kp RET &mo 2 &kp RALT
&kp ESC &kp PT_Q &kp PT_W &kp PT_E &kp PT_R &kp PT_T &kp PT_Y &kp PT_U &kp PT_I &kp PT_O &kp PT_P &kp DEL
&kp LCTRL &kp PT_A &kp PT_S &kp PT_D &kp PT_F &kp PT_G &kp PT_H &kp PT_J &kp PT_K &kp PT_L &kp PT_CCED &kp PT_TILD
&mt MEH CAPS &kp PT_Z &kp PT_X &kp PT_C &kp PT_V &kp PT_B &kp PT_N &kp PT_M &kp PT_COMM &kp PT_DOT &kp PT_MINS &kp PT_MORD
&kp LGUI &lt LOWER TAB &mt LSHIFT SPACE &lt RAISE ENTER &lt LOWER BSPC &mt LALT PT_ACUT
>;
};

lower_layer {
// -----------------------------------------------------------------------------------------
// | TAB | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BKSP |
// | BTCLR| BT1 | BT2 | BT3 | BT4 | BT5 | | LFT | DWN | UP | RGT | | |
// | SHFT | | | | | | | | | | | | |
// | GUI | | SPC | | ENT | | ALT |
// ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// | $ | % | ! | " | ( | ) | | - | / | 7 | 8 | 9 | HOME |
// | @ | # | ? | ' | [ | ] | | + | * | 4 | 5 | 6 | END |
// | < | > | | | & | { | } | | = | 0 | 1 | 2 | 3 | € |
//
// | | | | | | | |
bindings = <
&kp TAB &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp BSPC
&bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &kp LEFT &kp DOWN &kp UP &kp RIGHT &trans &trans
&kp LSHFT &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&kp LGUI &trans &kp SPACE &kp RET &trans &kp RALT
&kp PT_DLR &kp PT_PERC &kp PT_EXLM &kp PT_DQUO &kp PT_LPRN &kp PT_RPRN &kp PT_MINS &kp PT_SLSH &kp PT_7 &kp PT_8 &kp PT_9 &kp HOME
&kp PT_AT &kp PT_HASH &kp PT_QUES &kp PT_QUOT &kp PT_LBRC &kp PT_RBRC &kp PT_PLUS &kp PT_ASTR &kp PT_4 &kp PT_5 &kp PT_6 &kp END
&kp PT_LABK &kp PT_RABK &kp PT_PIPE &kp PT_AMPR &kp PT_LCBR &kp PT_RCBR &kp PT_EQL &kp PT_0 &kp PT_1 &kp PT_2 &kp PT_3 &kp PT_EURO
xxx &mo EXTRA xxx xxx &mo EXTRA xxx
>;
};

raise_layer {
// -----------------------------------------------------------------------------------------
// | TAB | ! | @ | # | $ | % | | ^ | & | * | ( | ) | BKSP |
// | CTRL | | | | | | | - | = | [ | ] | \ | ` |
// | SHFT | | | | | | | _ | + | { | } | "|" | ~ |
// | GUI | | SPC | | ENT | | ALT |
// ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// | F7 | F8 | F9 | F12 | PRNT_SCR | SCRL_UP | | MOUSE_LEFT | MOUSE_DOWN | MOUSE_UP | MOUSE_RIGHT | BRIGHTNESS_UP | PAGE_UP |
// | F4 | F5 | F6 | F11 | | SCRL_DOWN | | LEFT | DOWN | UP | RIGHT |BRIGHTNESS_DOWN| PAGE_DOWN |
// | F1 | F2 | F3 | F10 | | | | PLAY | VOL_DOWN | VOL_UP | MUTE | | |
//
// | | CLICK_R | CLICK_L | | | | |
bindings = <
&kp F7 &kp F8 &kp F9 &kp F12 &kp PRINTSCREEN &msc MOVE_UP &mmv MOVE_LEFT &mmv MOVE_DOWN &mmv MOVE_UP &mmv MOVE_RIGHT &kp C_BRI_UP &kp PG_UP
&kp F4 &kp F5 &kp F6 &kp F11 xxx &msc MOVE_DOWN &kp LEFT_ARROW &kp DOWN_ARROW &kp UP_ARROW &kp RIGHT_ARROW &kp C_BRI_DN &kp PG_DN
&kp F1 &kp F2 &kp F3 &kp F10 xxx xxx &kp C_PP &kp C_VOL_DN &kp C_VOL_UP &kp C_MUTE xxx xxx
xxx &mkp RCLK &mkp LCLK xxx xxx xxx
>;
};

extra_layer {
// ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// | | | | | | | | | | | | | BT_CLEAR |
// | | | | | | | | | | BT_4 | | | |
// | | | | | | | | | | BT_1 | BT_2 | BT_3 | |
//
// | | | | | | | |
bindings = <
&kp TAB &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp ASTRK &kp LPAR &kp RPAR &kp BSPC
&kp LCTRL &trans &trans &trans &trans &trans &kp MINUS &kp EQUAL &kp LBKT &kp RBKT &kp BSLH &kp GRAVE
&kp LSHFT &trans &trans &trans &trans &trans &kp UNDER &kp PLUS &kp LBRC &kp RBRC &kp PIPE &kp TILDE
&kp LGUI &trans &kp SPACE &kp RET &trans &kp RALT
xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx &bt BT_CLR
xxx xxx xxx xxx xxx xxx xxx xxx &bt BT_SEL 4 xxx xxx xxx
xxx xxx xxx xxx xxx xxx xxx &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 xxx
xxx xxx xxx xxx xxx xxx
>;
};
};
Expand Down
149 changes: 149 additions & 0 deletions config/keymap_pt.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
#pragma once


#include <dt-bindings/zmk/hid_usage.h>
#include <dt-bindings/zmk/hid_usage_pages.h>
#include <dt-bindings/zmk/modifiers.h>
#include <dt-bindings/zmk/keys.h>

/*
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐
* │ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ « │ │
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤
* │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ + │ ' │ │
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │
* │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ç │ º │ ~ │ │
* ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤
* │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │
* ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤
* │ │ │ │ │ │ │ │ │
* └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘
*/

// Row 1
#define PT_BSLS GRAVE // (backslash)
#define PT_1 N1 // 1
#define PT_2 N2 // 2
#define PT_3 N3 // 3
#define PT_4 N4 // 4
#define PT_5 N5 // 5
#define PT_6 N6 // 6
#define PT_7 N7 // 7
#define PT_8 N8 // 8
#define PT_9 N9 // 9
#define PT_0 N0 // 0
#define PT_QUOT MINUS // '
#define PT_LDAQ EQUAL // «

// Row 2
#define PT_Q Q // Q
#define PT_W W // W
#define PT_E E // E
#define PT_R R // R
#define PT_T T // T
#define PT_Y Y // Y
#define PT_U U // U
#define PT_I I // I
#define PT_O O // O
#define PT_P P // P
#define PT_PLUS LBKT // +
#define PT_ACUT RBKT // ´ (dead)

// Row 3
#define PT_A A // A
#define PT_S S // S
#define PT_D D // D
#define PT_F F // F
#define PT_G G // G
#define PT_H H // H
#define PT_J J // J
#define PT_K K // K
#define PT_L L // L
#define PT_CCED SEMI // Ç
#define PT_MORD SQT // º
#define PT_TILD NUHS // ~ (dead)

// Row 4
#define PT_LABK NUBS // <
#define PT_Z Z // Z
#define PT_X X // X
#define PT_C C // C
#define PT_V V // V
#define PT_B B // B
#define PT_N N // N
#define PT_M M // M
#define PT_COMM COMMA // ,
#define PT_DOT DOT // .
#define PT_MINS FSLH // -


/* Shifted symbols
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐
* │ | │ ! │ " │ # │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ » │ │
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤
* │ │ │ │ │ │ │ │ │ │ │ │ * │ ` │ │
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │
* │ │ │ │ │ │ │ │ │ │ │ │ ª │ ^ │ │
* ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤
* │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │
* ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤
* │ │ │ │ │ │ │ │ │
* └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘
*/

// Row 1
#define PT_PIPE LS(PT_BSLS) // |
#define PT_EXLM LS(PT_1) // !
#define PT_DQUO LS(PT_2) // "
#define PT_HASH LS(PT_3) // #
#define PT_DLR LS(PT_4) // $
#define PT_PERC LS(PT_5) // %
#define PT_AMPR LS(PT_6) // &
#define PT_SLSH LS(PT_7) // /
#define PT_LPRN LS(PT_8) // (
#define PT_RPRN LS(PT_9) // )
#define PT_EQL LS(PT_0) // =
#define PT_QUES LS(PT_QUOT) // ?
#define PT_RDAQ LS(PT_LDAQ) // »

// Row 2
#define PT_ASTR LS(PT_PLUS) // *
#define PT_GRV LS(PT_ACUT) // ` (dead)

// Row 3
#define PT_FORD LS(PT_MORD) // ª
#define PT_CIRC LS(PT_TILD) // ^ (dead)

// Row 4
#define PT_RABK LS(PT_LABK) // >
#define PT_SCLN LS(PT_COMM) // ;
#define PT_COLN LS(PT_DOT) // :
#define PT_UNDS LS(PT_MINS) // _


/* AltGr symbols
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐
* │ │ │ @ │ £ │ § │ │ │ { │ [ │ ] │ } │ │ │ │
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤
* │ │ │ │ € │ │ │ │ │ │ │ │ ¨ │ │ │
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │
* │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
* ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤
* │ │ │ │ │ │ │ │ │ │ │ │ │ │
* ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤
* │ │ │ │ │ │ │ │ │
* └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘
*/

// Row 1
#define PT_AT RA(PT_2) // @
#define PT_PND RA(PT_3) // £
#define PT_SECT RA(PT_4) // §
#define PT_LCBR RA(PT_7) // {
#define PT_LBRC RA(PT_8) // [
#define PT_RBRC RA(PT_9) // ]
#define PT_RCBR RA(PT_0) // }

// Row 2
#define PT_EURO RA(PT_E) // €
#define PT_DIAE RA(PT_PLUS) // ¨ (dead)
2 changes: 0 additions & 2 deletions config/west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ manifest:
url-base: https://github.com/zmkfirmware
- name: petejohanson
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: petejohanson
Expand Down

0 comments on commit d0cfc05

Please sign in to comment.