forked from manna-harbour/miryoku_zmk
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce195ed
commit 24338e7
Showing
36 changed files
with
1,699 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,11 @@ | ||
// Copyright 2024 Manna Harbour | ||
// https://github.com/manna-harbour/miryoku | ||
|
||
#include "../miryoku/zmk-helpers/helper.h" | ||
#include "../miryoku/zmk-helpers/unicode-chars/estonian.dtsi" | ||
#include "../miryoku/zmk-helpers/unicode-chars/currency.dtsi" | ||
|
||
#include "../miryoku/custom_config.h" | ||
#include "../miryoku/mapping/36/minidox.h" | ||
#include "../miryoku/miryoku.dtsi" | ||
|
||
/ { | ||
|
||
macros { | ||
// add Estonian letters | ||
// õ | ||
est_ae: est_ae { | ||
compatible = "zmk,behavior-macro"; | ||
#binding-cells = <0>; | ||
wait-ms = <0>; | ||
tap-ms = <5>; | ||
bindings | ||
= <¯o_press &kp LALT> | ||
, <¯o_tap &kp KP_N0 &kp KP_N2 &kp KP_N4 &kp KP_N5> | ||
, <¯o_release &kp LALT> | ||
; | ||
}; | ||
// ö | ||
est_oe: est_oe { | ||
compatible = "zmk,behavior-macro"; | ||
#binding-cells = <0>; | ||
wait-ms = <0>; | ||
tap-ms = <5>; | ||
bindings | ||
= <¯o_press &kp LALT> | ||
, <¯o_tap &kp KP_N0 &kp KP_N2 &kp KP_N4 &kp KP_N6> | ||
, <¯o_release &kp LALT> | ||
; | ||
}; | ||
// ü | ||
est_ui: est_ui { | ||
compatible = "zmk,behavior-macro"; | ||
#binding-cells = <0>; | ||
wait-ms = <0>; | ||
tap-ms = <5>; | ||
bindings | ||
= <¯o_press &kp LALT> | ||
, <¯o_tap &kp KP_N0 &kp KP_N2 &kp KP_N5 &kp KP_N2> | ||
, <¯o_release &kp LALT> | ||
; | ||
}; | ||
// ä | ||
est_ai: est_ai { | ||
compatible = "zmk,behavior-macro"; | ||
#binding-cells = <0>; | ||
wait-ms = <0>; | ||
tap-ms = <5>; | ||
bindings | ||
= <¯o_press &kp LALT> | ||
, <¯o_tap &kp KP_N0 &kp KP_N2 &kp KP_N2 &kp KP_N8> | ||
, <¯o_release &kp LALT> | ||
; | ||
}; | ||
// € | ||
est_eur: est_eur { | ||
compatible = "zmk,behavior-macro"; | ||
#binding-cells = <0>; | ||
wait-ms = <0>; | ||
tap-ms = <5>; | ||
bindings | ||
= <¯o_press &kp LALT> | ||
, <¯o_tap &kp KP_N0 &kp KP_N1 &kp KP_N2 &kp KP_N8> | ||
, <¯o_release &kp LALT> | ||
; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,187 @@ | ||
/* | ||
* helper.h | ||
* | ||
* Convenience macros simplifying ZMK's keymap configuration. | ||
* See https://github.com/urob/zmk-helpers for documentation. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#define ZMK_HELPER_STRINGIFY(x) #x | ||
|
||
// Preprocessor mechanism to overload macros, cf. https://stackoverflow.com/a/27051616/6114651 | ||
#define VARGS_(_10, _9, _8, _7, _6, _5, _4, _3, _2, _1, N, ...) N | ||
#define VARGS(...) VARGS_(__VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) | ||
#define CONCAT_(a, b) a##b | ||
#define CONCAT(a, b) CONCAT_(a, b) | ||
|
||
/* ZMK_BEHAVIOR */ | ||
|
||
#define ZMK_BEHAVIOR_CORE_auto_layer compatible = "zmk,behavior-auto-layer"; #binding-cells = <1> | ||
#define ZMK_BEHAVIOR_CORE_caps_word compatible = "zmk,behavior-caps-word"; #binding-cells = <0> | ||
#define ZMK_BEHAVIOR_CORE_dynamic_macro compatible = "zmk,behavior-dynamic-macro"; #binding-cells = <1> | ||
#define ZMK_BEHAVIOR_CORE_hold_tap compatible = "zmk,behavior-hold-tap"; #binding-cells = <2> | ||
#define ZMK_BEHAVIOR_CORE_key_repeat compatible = "zmk,behavior-key-repeat"; #binding-cells = <0> | ||
#define ZMK_BEHAVIOR_CORE_macro compatible = "zmk,behavior-macro"; #binding-cells = <0> | ||
#define ZMK_BEHAVIOR_CORE_macro_one_param compatible = "zmk,behavior-macro-one-param"; #binding-cells = <1> | ||
#define ZMK_BEHAVIOR_CORE_macro_two_param compatible = "zmk,behavior-macro-two-param"; #binding-cells = <2> | ||
#define ZMK_BEHAVIOR_CORE_mod_morph compatible = "zmk,behavior-mod-morph"; #binding-cells = <0> | ||
#define ZMK_BEHAVIOR_CORE_sticky_key compatible = "zmk,behavior-sticky-key"; #binding-cells = <1> | ||
#define ZMK_BEHAVIOR_CORE_tap_dance compatible = "zmk,behavior-tap-dance"; #binding-cells = <0> | ||
#define ZMK_BEHAVIOR_CORE_tri_state compatible = "zmk,behavior-tri-state"; #binding-cells = <0> | ||
|
||
#define ZMK_BEHAVIOR(name, type, ...) \ | ||
/ { \ | ||
behaviors { \ | ||
name: name { \ | ||
ZMK_BEHAVIOR_CORE_ ## type; \ | ||
__VA_ARGS__ \ | ||
}; \ | ||
}; \ | ||
}; | ||
|
||
#define ZMK_AUTO_LAYER(name, ...) ZMK_BEHAVIOR(name, auto_layer, __VA_ARGS__) | ||
#define ZMK_CAPS_WORD(name, ...) ZMK_BEHAVIOR(name, caps_word, __VA_ARGS__) | ||
#define ZMK_HOLD_TAP(name, ...) ZMK_BEHAVIOR(name, hold_tap, __VA_ARGS__) | ||
#define ZMK_KEY_REPEAT(name, ...) ZMK_BEHAVIOR(name, key_repeat, __VA_ARGS__) | ||
#if ZMK_HELPERS_KEEP_NATIVE != 1 | ||
#undef ZMK_MACRO | ||
#define ZMK_MACRO(name, ...) ZMK_BEHAVIOR(name, macro, __VA_ARGS__) | ||
#endif | ||
#define ZMK_MACRO_ONE_PARAM(name, ...) ZMK_BEHAVIOR(name, macro_one_param, __VA_ARGS__) | ||
#define ZMK_MACRO_TWO_PARAM(name, ...) ZMK_BEHAVIOR(name, macro_two_param, __VA_ARGS__) | ||
#define ZMK_MOD_MORPH(name, ...) ZMK_BEHAVIOR(name, mod_morph, __VA_ARGS__) | ||
#define ZMK_STICKY_KEY(name, ...) ZMK_BEHAVIOR(name, sticky_key, __VA_ARGS__) | ||
#define ZMK_TAP_DANCE(name, ...) ZMK_BEHAVIOR(name, tap_dance, __VA_ARGS__) | ||
#define ZMK_TRI_STATE(name, ...) ZMK_BEHAVIOR(name, tri_state, __VA_ARGS__) | ||
|
||
/* ZMK_LAYER */ | ||
|
||
#define ZMK_LAYER(...) CONCAT(ZMK_LAYER_, VARGS(__VA_ARGS__))(__VA_ARGS__) | ||
#define ZMK_LAYER_2(_name, layout) \ | ||
/ { \ | ||
keymap { \ | ||
compatible = "zmk,keymap"; \ | ||
layer_ ## _name { \ | ||
display-name = ZMK_HELPER_STRINGIFY(_name); \ | ||
bindings = <layout>; \ | ||
}; \ | ||
}; \ | ||
}; | ||
#define ZMK_LAYER_3(_name, layout, sensors) \ | ||
/ { \ | ||
keymap { \ | ||
compatible = "zmk,keymap"; \ | ||
layer_ ## _name { \ | ||
display-name = ZMK_HELPER_STRINGIFY(_name); \ | ||
bindings = <layout>; \ | ||
sensor-bindings = <sensors>; \ | ||
}; \ | ||
}; \ | ||
}; | ||
|
||
/* ZMK_COMBOS */ | ||
|
||
#define ALL 0xff | ||
#if !defined COMBO_TERM | ||
#define COMBO_TERM 30 | ||
#endif | ||
|
||
#define ZMK_COMBO(...) CONCAT(ZMK_COMBO_, VARGS(__VA_ARGS__))(__VA_ARGS__) | ||
#define ZMK_COMBO_3(name, combo_bindings, keypos) \ | ||
ZMK_COMBO_4(name, combo_bindings, keypos, ALL) | ||
#define ZMK_COMBO_4(name, combo_bindings, keypos, combo_layers) \ | ||
ZMK_COMBO_5(name, combo_bindings, keypos, combo_layers, COMBO_TERM) | ||
#define ZMK_COMBO_5(name, combo_bindings, keypos, combo_layers, combo_timeout) \ | ||
ZMK_COMBO_6(name, combo_bindings, keypos, combo_layers, combo_timeout, 0) | ||
#define ZMK_COMBO_6(name, combo_bindings, keypos, combo_layers, combo_timeout, combo_idle) \ | ||
ZMK_COMBO_7(name, combo_bindings, keypos, combo_layers, combo_timeout, combo_idle, ) | ||
#define ZMK_COMBO_7(name, combo_bindings, keypos, combo_layers, combo_timeout, combo_idle, combo_vaargs) \ | ||
/ { \ | ||
combos { \ | ||
compatible = "zmk,combos"; \ | ||
combo_ ## name { \ | ||
timeout-ms = <combo_timeout>; \ | ||
bindings = <combo_bindings>; \ | ||
key-positions = <keypos>; \ | ||
layers = <combo_layers>; \ | ||
require-prior-idle-ms = <combo_idle>; \ | ||
combo_vaargs \ | ||
}; \ | ||
}; \ | ||
}; | ||
|
||
/* ZMK_CONDITIONAL_LAYER */ | ||
|
||
#define ZMK_CONDITIONAL_LAYER(name, if_layers, then_layer) \ | ||
/ { \ | ||
conditional_layers { \ | ||
compatible = "zmk,conditional-layers"; \ | ||
tri_layer_ ## name { \ | ||
if-layers = <if_layers>; \ | ||
then-layer = <then_layer>; \ | ||
}; \ | ||
}; \ | ||
}; | ||
|
||
/* ZMK_UNICODE */ | ||
|
||
#if !defined OS_UNICODE_LEAD | ||
#if HOST_OS == 2 | ||
#define OS_UNICODE_LEAD ¯o_press &kp LALT // macOS/Windows-Alt-Codes | ||
#elif HOST_OS == 1 | ||
#define OS_UNICODE_LEAD ¯o_tap &kp LS(LC(U)) // Linux | ||
#else | ||
#define OS_UNICODE_LEAD ¯o_tap &kp RALT &kp U // Windows + WinCompose (default) | ||
#endif | ||
#endif | ||
#if !defined OS_UNICODE_TRAIL | ||
#if HOST_OS == 2 | ||
#define OS_UNICODE_TRAIL ¯o_release &kp LALT // macOS/Windows-Alt-Codes | ||
#elif HOST_OS == 1 | ||
#define OS_UNICODE_TRAIL ¯o_tap &kp SPACE // Linux | ||
#else | ||
#define OS_UNICODE_TRAIL ¯o_tap &kp RET // Windows + WinCompose (default) | ||
#endif | ||
#endif | ||
|
||
#define UC_MACRO(name, unicode_bindings) \ | ||
/ { \ | ||
macros { \ | ||
name: name { \ | ||
compatible = "zmk,behavior-macro"; \ | ||
wait-ms = <0>; \ | ||
tap-ms = <0>; \ | ||
#binding-cells = <0>; \ | ||
bindings = <OS_UNICODE_LEAD>, <¯o_tap unicode_bindings>, <OS_UNICODE_TRAIL>; \ | ||
}; \ | ||
}; \ | ||
}; | ||
|
||
#define UC_MODMORPH(name, uc_binding, shifted_uc_binding) \ | ||
/ { \ | ||
behaviors { \ | ||
name: name { \ | ||
compatible = "zmk,behavior-mod-morph"; \ | ||
#binding-cells = <0>; \ | ||
bindings = <uc_binding>, <shifted_uc_binding>; \ | ||
mods = <(MOD_LSFT|MOD_RSFT)>; \ | ||
}; \ | ||
}; \ | ||
}; | ||
|
||
#define ZMK_UNICODE_SINGLE(name, L0, L1, L2, L3) \ | ||
UC_MACRO(name ## _lower, &kp L0 &kp L1 &kp L2 &kp L3) \ | ||
UC_MODMORPH(name, &name ## _lower, &none) | ||
|
||
#define ZMK_UNICODE_PAIR(name, L0, L1, L2, L3, U0, U1, U2, U3) \ | ||
UC_MACRO(name ## _lower, &kp L0 &kp L1 &kp L2 &kp L3) \ | ||
UC_MACRO(name ## _upper, &kp U0 &kp U1 &kp U2 &kp U3) \ | ||
UC_MODMORPH(name, &name ## _lower, &name ## _upper) | ||
|
||
/* ZMK_APPLY_MATRIX_TRANSFORM */ | ||
|
||
#define ZMK_APPLY_MATRIX_TRANSFORM(transform) \ | ||
/ { \ | ||
chosen { zmk,matrix_transform = &transform; }; \ | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* 34 KEY MATRIX / LAYOUT MAPPING | ||
╭────────────────────┬────────────────────╮ ╭─────────────────────┬─────────────────────╮ | ||
│ 0 1 2 3 4 │ 5 6 7 8 9 │ │ LT4 LT3 LT2 LT1 LT0 │ RT0 RT1 RT2 RT3 RT4 │ | ||
│ 10 11 12 13 14 │ 15 16 17 18 19 │ │ LM4 LM3 LM2 LM1 LM0 │ RM0 RM1 RM2 RM3 RM4 │ | ||
│ 20 21 22 23 24 │ 25 26 27 28 29 │ │ LB4 LB3 LB2 LB1 LB0 │ RB0 RB1 RB2 RB3 RB4 │ | ||
╰───────────╮ 30 31 │ 32 33 ╭───────────╯ ╰───────────╮ LH1 LH0 │ RH0 RH1 ╭───────────╯ | ||
╰────────┴────────╯ ╰─────────┴─────────╯ */ | ||
|
||
#pragma once | ||
|
||
#define LT0 4 // left-top row | ||
#define LT1 3 | ||
#define LT2 2 | ||
#define LT3 1 | ||
#define LT4 0 | ||
|
||
#define RT0 5 // right-top row | ||
#define RT1 6 | ||
#define RT2 7 | ||
#define RT3 8 | ||
#define RT4 9 | ||
|
||
#define LM0 14 // left-middle row | ||
#define LM1 13 | ||
#define LM2 12 | ||
#define LM3 11 | ||
#define LM4 10 | ||
|
||
#define RM0 15 // right-middle row | ||
#define RM1 16 | ||
#define RM2 17 | ||
#define RM3 18 | ||
#define RM4 19 | ||
|
||
#define LB0 24 // left-bottom row | ||
#define LB1 23 | ||
#define LB2 22 | ||
#define LB3 21 | ||
#define LB4 20 | ||
|
||
#define RB0 25 // right-bottom row | ||
#define RB1 26 | ||
#define RB2 27 | ||
#define RB3 28 | ||
#define RB4 29 | ||
|
||
#define LH0 31 // left thumb keys | ||
#define LH1 30 | ||
|
||
#define RH0 32 // right thumb keys | ||
#define RH1 33 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* 36 KEY MATRIX / LAYOUT MAPPING | ||
╭────────────────────┬────────────────────╮ ╭─────────────────────┬─────────────────────╮ | ||
│ 0 1 2 3 4 │ 5 6 7 8 9 │ │ LT4 LT3 LT2 LT1 LT0 │ RT0 RT1 RT2 RT3 RT4 │ | ||
│ 10 11 12 13 14 │ 15 16 17 18 19 │ │ LM4 LM3 LM2 LM1 LM0 │ RM0 RM1 RM2 RM3 RM4 │ | ||
│ 20 21 22 23 24 │ 25 26 27 28 29 │ │ LB4 LB3 LB2 LB1 LB0 │ RB0 RB1 RB2 RB3 RB4 │ | ||
╰───────╮ 30 31 32 │ 33 34 35 ╭───────╯ ╰───────╮ LH2 LH1 LH0 │ RH0 RH1 RH2 ╭───────╯ | ||
╰────────────┴────────────╯ ╰─────────────┴─────────────╯ */ | ||
|
||
#pragma once | ||
|
||
#define LT0 4 // left-top row | ||
#define LT1 3 | ||
#define LT2 2 | ||
#define LT3 1 | ||
#define LT4 0 | ||
|
||
#define RT0 5 // right-top row | ||
#define RT1 6 | ||
#define RT2 7 | ||
#define RT3 8 | ||
#define RT4 9 | ||
|
||
#define LM0 14 // left-middle row | ||
#define LM1 13 | ||
#define LM2 12 | ||
#define LM3 11 | ||
#define LM4 10 | ||
|
||
#define RM0 15 // right-middle row | ||
#define RM1 16 | ||
#define RM2 17 | ||
#define RM3 18 | ||
#define RM4 19 | ||
|
||
#define LB0 24 // left-bottom row | ||
#define LB1 23 | ||
#define LB2 22 | ||
#define LB3 21 | ||
#define LB4 20 | ||
|
||
#define RB0 25 // right-bottom row | ||
#define RB1 26 | ||
#define RB2 27 | ||
#define RB3 28 | ||
#define RB4 29 | ||
|
||
#define LH0 32 // left thumb keys | ||
#define LH1 31 | ||
#define LH2 30 | ||
|
||
#define RH0 33 // right thumb keys | ||
#define RH1 34 | ||
#define RH2 35 | ||
|
Oops, something went wrong.