diff --git a/miryoku/miryoku.dtsi b/miryoku/miryoku.dtsi index ef8047f..7b828dc 100644 --- a/miryoku/miryoku.dtsi +++ b/miryoku/miryoku.dtsi @@ -7,9 +7,6 @@ #include #include #include -#if defined (MIRYOKU_KLUDGE_MOUSEKEYSPR) - #include -#endif #include "miryoku.h" @@ -76,6 +73,8 @@ #if defined (MIRYOKU_KLUDGE_MOUSEKEYSPR) #include "miryoku_kludge_mousekeyspr.dtsi" +#else + #include "miryoku_mousekeys.dtsi" #endif #if defined (MIRYOKU_KLUDGE_THUMBCOMBOS) diff --git a/miryoku/miryoku.h b/miryoku/miryoku.h index db18bd2..c10da69 100644 --- a/miryoku/miryoku.h +++ b/miryoku/miryoku.h @@ -15,44 +15,10 @@ #define U_TAPPING_TERM 200 -#if defined (MIRYOKU_CLIPBOARD_FUN) - #define U_RDO &kp K_AGAIN - #define U_PST &kp K_PASTE - #define U_CPY &kp K_COPY - #define U_CUT &kp K_CUT - #define U_UND &kp K_UNDO -#elif defined (MIRYOKU_CLIPBOARD_MAC) - #define U_RDO &kp LS(LG(Z)) - #define U_PST &kp LG(V) - #define U_CPY &kp LG(C) - #define U_CUT &kp LG(X) - #define U_UND &kp LG(Z) -#elif defined (MIRYOKU_CLIPBOARD_WIN) - #define U_RDO &kp LC(Y) - #define U_PST &kp LC(V) - #define U_CPY &kp LC(C) - #define U_CUT &kp LC(X) - #define U_UND &kp LC(Z) -#else - #define U_RDO &kp K_AGAIN - #define U_PST &kp LS(INS) - #define U_CPY &kp LC(INS) - #define U_CUT &kp LS(DEL) - #define U_UND &kp K_UNDO -#endif +#include "miryoku_clipboard.h" #if defined (MIRYOKU_KLUDGE_MOUSEKEYSPR) #include "miryoku_kludge_mousekeyspr.h" #else - #define U_BTN1 &kp KP_N5 - #define U_BTN2 U_NU - #define U_BTN3 U_NU - #define U_MS_D &kp KP_N2 - #define U_MS_L &kp KP_N4 - #define U_MS_R &kp KP_N6 - #define U_MS_U &kp KP_N8 - #define U_WH_D U_NU - #define U_WH_L U_NU - #define U_WH_R U_NU - #define U_WH_U U_NU + #include "miryoku_mousekeys.h" #endif diff --git a/miryoku/miryoku_clipboard.h b/miryoku/miryoku_clipboard.h new file mode 100644 index 0000000..de932ad --- /dev/null +++ b/miryoku/miryoku_clipboard.h @@ -0,0 +1,30 @@ +// Copyright 2022 Manna Harbour +// https://github.com/manna-harbour/miryoku + +#pragma once + +#if defined (MIRYOKU_CLIPBOARD_FUN) + #define U_RDO &kp K_AGAIN + #define U_PST &kp K_PASTE + #define U_CPY &kp K_COPY + #define U_CUT &kp K_CUT + #define U_UND &kp K_UNDO +#elif defined (MIRYOKU_CLIPBOARD_MAC) + #define U_RDO &kp LS(LG(Z)) + #define U_PST &kp LG(V) + #define U_CPY &kp LG(C) + #define U_CUT &kp LG(X) + #define U_UND &kp LG(Z) +#elif defined (MIRYOKU_CLIPBOARD_WIN) + #define U_RDO &kp LC(Y) + #define U_PST &kp LC(V) + #define U_CPY &kp LC(C) + #define U_CUT &kp LC(X) + #define U_UND &kp LC(Z) +#else + #define U_RDO &kp K_AGAIN + #define U_PST &kp LS(INS) + #define U_CPY &kp LC(INS) + #define U_CUT &kp LS(DEL) + #define U_UND &kp K_UNDO +#endif diff --git a/miryoku/miryoku_kludge_mousekeyspr.h b/miryoku/miryoku_kludge_mousekeyspr.h index e171231..8350441 100644 --- a/miryoku/miryoku_kludge_mousekeyspr.h +++ b/miryoku/miryoku_kludge_mousekeyspr.h @@ -1,6 +1,10 @@ // Copyright 2022 Manna Harbour // https://github.com/manna-harbour/miryoku +#pragma once + +#include + #define U_MOUSE_MOVE_MAX 1250 #define U_MOUSE_MOVE_EXPONENT 1 #define U_MOUSE_MOVE_TIME 1500 diff --git a/miryoku/miryoku_mousekeys.dtsi b/miryoku/miryoku_mousekeys.dtsi new file mode 100644 index 0000000..b09ce6d --- /dev/null +++ b/miryoku/miryoku_mousekeys.dtsi @@ -0,0 +1,10 @@ +// Copyright 2022 Manna Harbour +// https://github.com/manna-harbour/miryoku + +/ { + macros { + ZMK_MACRO(u_macro_btn1, wait-ms = <0>; bindings = <&kp KP_SLASH &kp KP_N5>;) + ZMK_MACRO(u_macro_btn2, wait-ms = <0>; bindings = <&kp KP_MINUS &kp KP_N5>;) + ZMK_MACRO(u_macro_btn3, wait-ms = <0>; bindings = <&kp KP_ASTERISK &kp KP_N5>;) + }; +}; diff --git a/miryoku/miryoku_mousekeys.h b/miryoku/miryoku_mousekeys.h new file mode 100644 index 0000000..79f621e --- /dev/null +++ b/miryoku/miryoku_mousekeys.h @@ -0,0 +1,16 @@ +// Copyright 2022 Manna Harbour +// https://github.com/manna-harbour/miryoku + +#pragma once + +#define U_BTN1 &u_macro_btn1 +#define U_BTN2 &u_macro_btn2 +#define U_BTN3 &u_macro_btn3 +#define U_MS_D &kp KP_N2 +#define U_MS_L &kp KP_N4 +#define U_MS_R &kp KP_N6 +#define U_MS_U &kp KP_N8 +#define U_WH_D U_NU +#define U_WH_L U_NU +#define U_WH_R U_NU +#define U_WH_U U_NU diff --git a/readme.org b/readme.org index 7569176..6fc5a0d 100644 --- a/readme.org +++ b/readme.org @@ -344,7 +344,7 @@ Examples include ~CONFIG_ZMK_SLEEP=y~, ~CONFIG_ZMK_DISPLAY=y~, ~CONFIG_BT_CTLR_T **** Mouse Keys on Host -The Mouse and Button layers use [[https://en.wikipedia.org/wiki/Mouse_keys][mouse keys on the host]]. Middle button, right button, and scroll are not supported. +The Mouse and Button layers use [[https://en.wikipedia.org/wiki/Mouse_keys][mouse keys on the host]]. Scroll is not supported. - [[https://linuxreviews.org/HOWTO_use_the_numeric_keyboard_keys_as_mouse_in_XOrg][X11]] - [[https://support.apple.com/en-au/guide/mac-help/mh27469/mac][Mac]]