Add suspend

This commit is contained in:
Manna Harbour 2022-10-09 22:21:28 +11:00
parent 84adeeb776
commit f62a214f7c
4 changed files with 55 additions and 22 deletions

View File

@ -0,0 +1,14 @@
# Copyright 2022 Manna Harbour
# https://github.com/manna-harbour/miryoku
name: 'Build Example suspend'
on: workflow_dispatch
jobs:
build:
uses: ./.github/workflows/main.yml
secrets: inherit
with:
board: '["nice_nano"]'
shield: '["corne_left","corne_right"]'
custom_config: '["#define MIRYOKU_KLUDGE_SUSPEND"]'
branches: '["zmkfirmware/zmk/main manna-harbour/zmk/suspend-test"]'

View File

@ -249,132 +249,132 @@ U_NP, U_NP, &kp ESC, &kp SPC, &kp
#define MIRYOKU_ALTERNATIVES_NAV_INVERTEDT_FLIP \
&kp PG_UP, &kp HOME, &kp UP, &kp END, &kp INS, U_NA, &to U_BASE, &to U_EXTRA, &to U_TAP, &bootloader, \
&kp PG_UP, &kp HOME, &kp UP, &kp END, &kp INS, U_NA, &to U_BASE, &to U_EXTRA, &to U_TAP, &u_bootloader, \
&kp PG_DN, &kp LEFT, &kp DOWN, &kp RIGHT, &u_caps_word, U_NA, &kp LSHFT, &kp LCTRL, &kp LALT, &kp LGUI, \
U_UND, U_CUT, U_CPY, U_PST, U_RDO, U_NA, &to U_NAV, &to U_NUM, &kp RALT, U_NA, \
U_NP, U_NP, &kp DEL, &kp BSPC, &kp RET, U_NA, U_NA, U_NA, U_NP, U_NP
#define MIRYOKU_ALTERNATIVES_NAV_FLIP \
&kp HOME, &kp PG_DN, &kp PG_UP, &kp END, &kp INS, U_NA, &to U_BASE, &to U_EXTRA, &to U_TAP, &bootloader, \
&kp HOME, &kp PG_DN, &kp PG_UP, &kp END, &kp INS, U_NA, &to U_BASE, &to U_EXTRA, &to U_TAP, &u_bootloader, \
&kp LEFT, &kp DOWN, &kp UP, &kp RIGHT, &u_caps_word, U_NA, &kp LSHFT, &kp LCTRL, &kp LALT, &kp LGUI, \
U_UND, U_CUT, U_CPY, U_PST, U_RDO, U_NA, &to U_NAV, &to U_NUM, &kp RALT, U_NA, \
U_NP, U_NP, &kp DEL, &kp BSPC, &kp RET, U_NA, U_NA, U_NA, U_NP, U_NP
#define MIRYOKU_ALTERNATIVES_NAV_INVERTEDT \
&bootloader, &to U_TAP, &to U_EXTRA, &to U_BASE, U_NA, &kp INS, &kp HOME, &kp UP, &kp END, &kp PG_UP, \
&u_bootloader, &to U_TAP, &to U_EXTRA, &to U_BASE, U_NA, &kp INS, &kp HOME, &kp UP, &kp END, &kp PG_UP, \
&kp LGUI, &kp LALT, &kp LCTRL, &kp LSHFT, U_NA, &u_caps_word, &kp LEFT, &kp DOWN, &kp RIGHT, &kp PG_DN, \
U_NA, &kp RALT, &to U_NUM, &to U_NAV, U_NA, U_RDO, U_PST, U_CPY, U_CUT, U_UND, \
U_NP, U_NP, U_NA, U_NA, U_NA, &kp RET, &kp BSPC, &kp DEL, U_NP, U_NP
#define MIRYOKU_ALTERNATIVES_NAV_VI \
&bootloader, &to U_TAP, &to U_EXTRA, &to U_BASE, U_NA, U_RDO, U_PST, U_CPY, U_CUT, U_UND, \
&u_bootloader, &to U_TAP, &to U_EXTRA, &to U_BASE, U_NA, U_RDO, U_PST, U_CPY, U_CUT, U_UND, \
&kp LGUI, &kp LALT, &kp LCTRL, &kp LSHFT, U_NA, &kp LEFT, &kp DOWN, &kp UP, &kp RIGHT, &u_caps_word, \
U_NA, &kp RALT, &to U_NUM, &to U_NAV, U_NA, &kp HOME, &kp PG_DN, &kp PG_UP, &kp END, &kp INS, \
U_NP, U_NP, U_NA, U_NA, U_NA, &kp RET, &kp BSPC, &kp DEL, U_NP, U_NP
#define MIRYOKU_ALTERNATIVES_NAV \
&bootloader, &to U_TAP, &to U_EXTRA, &to U_BASE, U_NA, U_RDO, U_PST, U_CPY, U_CUT, U_UND, \
&u_bootloader, &to U_TAP, &to U_EXTRA, &to U_BASE, U_NA, U_RDO, U_PST, U_CPY, U_CUT, U_UND, \
&kp LGUI, &kp LALT, &kp LCTRL, &kp LSHFT, U_NA, &u_caps_word, &kp LEFT, &kp DOWN, &kp UP, &kp RIGHT, \
U_NA, &kp RALT, &to U_NUM, &to U_NAV, U_NA, &kp INS, &kp HOME, &kp PG_DN, &kp PG_UP, &kp END, \
U_NP, U_NP, U_NA, U_NA, U_NA, &kp RET, &kp BSPC, &kp DEL, U_NP, U_NP
#define MIRYOKU_ALTERNATIVES_MOUSE_INVERTEDT_FLIP \
U_WH_U, U_WH_L, U_MS_U, U_WH_R, U_NU, U_NA, &to U_BASE, &to U_EXTRA, &to U_TAP, &bootloader, \
U_WH_U, U_WH_L, U_MS_U, U_WH_R, U_NU, U_NA, &to U_BASE, &to U_EXTRA, &to U_TAP, &u_bootloader, \
U_WH_D, U_MS_L, U_MS_D, U_MS_R, U_NU, U_NA, &kp LSHFT, &kp LCTRL, &kp LALT, &kp LGUI, \
U_UND, U_CUT, U_CPY, U_PST, U_RDO, U_NA, &to U_MOUSE, &to U_SYM, &kp RALT, U_NA, \
U_NP, U_NP, U_BTN3, U_BTN1, U_BTN2, U_NA, U_NA, U_NA, U_NP, U_NP
#define MIRYOKU_ALTERNATIVES_MOUSE_FLIP \
U_WH_L, U_WH_D, U_WH_U, U_WH_R, U_NU, U_NA, &to U_BASE, &to U_EXTRA, &to U_TAP, &bootloader, \
U_WH_L, U_WH_D, U_WH_U, U_WH_R, U_NU, U_NA, &to U_BASE, &to U_EXTRA, &to U_TAP, &u_bootloader, \
U_MS_L, U_MS_D, U_MS_U, U_MS_R, U_NU, U_NA, &kp LSHFT, &kp LCTRL, &kp LALT, &kp LGUI, \
U_UND, U_CUT, U_CPY, U_PST, U_RDO, U_NA, &to U_MOUSE, &to U_SYM, &kp RALT, U_NA, \
U_NP, U_NP, U_BTN3, U_BTN1, U_BTN2, U_NA, U_NA, U_NA, U_NP, U_NP
#define MIRYOKU_ALTERNATIVES_MOUSE_INVERTEDT \
&bootloader, &to U_TAP, &to U_EXTRA, &to U_BASE, U_NA, U_NU, U_WH_L, U_MS_U, U_WH_R, U_WH_U, \
&u_bootloader, &to U_TAP, &to U_EXTRA, &to U_BASE, U_NA, U_NU, U_WH_L, U_MS_U, U_WH_R, U_WH_U, \
&kp LGUI, &kp LALT, &kp LCTRL, &kp LSHFT, U_NA, U_NU, U_MS_L, U_MS_D, U_MS_R, U_WH_D, \
U_NA, &kp RALT, &to U_SYM, &to U_MOUSE, U_NA, U_RDO, U_PST, U_CPY, U_CUT, U_UND, \
U_NP, U_NP, U_NA, U_NA, U_NA, U_BTN2, U_BTN1, U_BTN3, U_NP, U_NP
#define MIRYOKU_ALTERNATIVES_MOUSE_VI \
&bootloader, &to U_TAP, &to U_EXTRA, &to U_BASE, U_NA, U_RDO, U_PST, U_CPY, U_CUT, U_UND, \
&u_bootloader, &to U_TAP, &to U_EXTRA, &to U_BASE, U_NA, U_RDO, U_PST, U_CPY, U_CUT, U_UND, \
&kp LGUI, &kp LALT, &kp LCTRL, &kp LSHFT, U_NA, U_MS_L, U_MS_D, U_MS_U, U_MS_R, U_NU, \
U_NA, &kp RALT, &to U_SYM, &to U_MOUSE, U_NA, U_WH_L, U_WH_D, U_WH_U, U_WH_R, U_NU, \
U_NP, U_NP, U_NA, U_NA, U_NA, U_BTN2, U_BTN1, U_BTN3, U_NP, U_NP
#define MIRYOKU_ALTERNATIVES_MOUSE \
&bootloader, &to U_TAP, &to U_EXTRA, &to U_BASE, U_NA, U_RDO, U_PST, U_CPY, U_CUT, U_UND, \
&u_bootloader, &to U_TAP, &to U_EXTRA, &to U_BASE, U_NA, U_RDO, U_PST, U_CPY, U_CUT, U_UND, \
&kp LGUI, &kp LALT, &kp LCTRL, &kp LSHFT, U_NA, U_NU, U_MS_L, U_MS_D, U_MS_U, U_MS_R, \
U_NA, &kp RALT, &to U_SYM, &to U_MOUSE, U_NA, U_NU, U_WH_L, U_WH_D, U_WH_U, U_WH_R, \
U_NP, U_NP, U_NA, U_NA, U_NA, U_BTN2, U_BTN1, U_BTN3, U_NP, U_NP
#define MIRYOKU_ALTERNATIVES_MEDIA_INVERTEDT_FLIP \
&u_rgb_hui, &u_rgb_sai, &kp C_VOL_UP, &u_rgb_bri, &u_rgb_tog, U_NA, &to U_BASE, &to U_EXTRA, &to U_TAP, &bootloader, \
&u_rgb_hui, &u_rgb_sai, &kp C_VOL_UP, &u_rgb_bri, &u_rgb_tog, U_NA, &to U_BASE, &to U_EXTRA, &to U_TAP, &u_bootloader, \
&u_rgb_eff, &kp C_PREV, &kp C_VOL_DN, &kp C_NEXT, &u_ep_tog, U_NA, &kp LSHFT, &kp LCTRL, &kp LALT, &kp LGUI, \
&u_bt_sel_0, &u_bt_sel_1, &u_bt_sel_2, &u_bt_sel_3, &u_out_tog, U_NA, &to U_MEDIA, &to U_FUN, &kp RALT, U_NA, \
U_NP, U_NP, &kp C_MUTE, &kp C_PP, &kp C_STOP, U_NA, U_NA, U_NA, U_NP, U_NP
#define MIRYOKU_ALTERNATIVES_MEDIA_FLIP \
&u_rgb_eff, &u_rgb_hui, &u_rgb_sai, &u_rgb_bri, &u_rgb_tog, U_NA, &to U_BASE, &to U_EXTRA, &to U_TAP, &bootloader, \
&u_rgb_eff, &u_rgb_hui, &u_rgb_sai, &u_rgb_bri, &u_rgb_tog, U_NA, &to U_BASE, &to U_EXTRA, &to U_TAP, &u_bootloader, \
&kp C_PREV, &kp C_VOL_DN, &kp C_VOL_UP, &kp C_NEXT, &u_ep_tog, U_NA, &kp LSHFT, &kp LCTRL, &kp LALT, &kp LGUI, \
&u_bt_sel_0, &u_bt_sel_1, &u_bt_sel_2, &u_bt_sel_3, &u_out_tog, U_NA, &to U_MEDIA, &to U_FUN, &kp RALT, U_NA, \
U_NP, U_NP, &kp C_MUTE, &kp C_PP, &kp C_STOP, U_NA, U_NA, U_NA, U_NP, U_NP
#define MIRYOKU_ALTERNATIVES_MEDIA_INVERTEDT \
&bootloader, &to U_TAP, &to U_EXTRA, &to U_BASE, U_NA, &u_rgb_tog, &u_rgb_eff, &kp C_VOL_UP, &u_rgb_hui, &u_rgb_sai, \
&u_bootloader, &to U_TAP, &to U_EXTRA, &to U_BASE, U_NA, &u_rgb_tog, &u_rgb_eff, &kp C_VOL_UP, &u_rgb_hui, &u_rgb_sai, \
&kp LGUI, &kp LALT, &kp LCTRL, &kp LSHFT, U_NA, &u_ep_tog, &kp C_PREV, &kp C_VOL_DN, &kp C_NEXT, &u_rgb_bri, \
U_NA, &kp RALT, &to U_FUN, &to U_MEDIA, U_NA, &u_out_tog, &u_bt_sel_0, &u_bt_sel_1, &u_bt_sel_2, &u_bt_sel_3, \
U_NP, U_NP, U_NA, U_NA, U_NA, &kp C_STOP, &kp C_PP, &kp C_MUTE, U_NP, U_NP
#define MIRYOKU_ALTERNATIVES_MEDIA_VI \
&bootloader, &to U_TAP, &to U_EXTRA, &to U_BASE, U_NA, &u_rgb_eff, &u_rgb_hui, &u_rgb_sai, &u_rgb_bri, &u_rgb_tog, \
&u_bootloader, &to U_TAP, &to U_EXTRA, &to U_BASE, U_NA, &u_rgb_eff, &u_rgb_hui, &u_rgb_sai, &u_rgb_bri, &u_rgb_tog, \
&kp LGUI, &kp LALT, &kp LCTRL, &kp LSHFT, U_NA, &kp C_PREV, &kp C_VOL_DN, &kp C_VOL_UP, &kp C_NEXT, &u_ep_tog, \
U_NA, &kp RALT, &to U_FUN, &to U_MEDIA, U_NA, &u_bt_sel_0, &u_bt_sel_1, &u_bt_sel_2, &u_bt_sel_3, &u_out_tog, \
U_NP, U_NP, U_NA, U_NA, U_NA, &kp C_STOP, &kp C_PP, &kp C_MUTE, U_NP, U_NP
#define MIRYOKU_ALTERNATIVES_MEDIA \
&bootloader, &to U_TAP, &to U_EXTRA, &to U_BASE, U_NA, &u_rgb_tog, &u_rgb_eff, &u_rgb_hui, &u_rgb_sai, &u_rgb_bri, \
&u_bootloader, &to U_TAP, &to U_EXTRA, &to U_BASE, U_NA, &u_rgb_tog, &u_rgb_eff, &u_rgb_hui, &u_rgb_sai, &u_rgb_bri, \
&kp LGUI, &kp LALT, &kp LCTRL, &kp LSHFT, U_NA, &u_ep_tog, &kp C_PREV, &kp C_VOL_DN, &kp C_VOL_UP, &kp C_NEXT, \
U_NA, &kp RALT, &to U_FUN, &to U_MEDIA, U_NA, &u_out_tog, &u_bt_sel_0, &u_bt_sel_1, &u_bt_sel_2, &u_bt_sel_3, \
U_NP, U_NP, U_NA, U_NA, U_NA, &kp C_STOP, &kp C_PP, &kp C_MUTE, U_NP, U_NP
#define MIRYOKU_ALTERNATIVES_NUM_FLIP \
&bootloader, &to U_TAP, &to U_EXTRA, &to U_BASE, U_NA, &kp LBKT, &kp NUM_7, &kp NUM_8, &kp NUM_9, &kp RBKT, \
&u_bootloader, &to U_TAP, &to U_EXTRA, &to U_BASE, U_NA, &kp LBKT, &kp NUM_7, &kp NUM_8, &kp NUM_9, &kp RBKT, \
&kp LGUI, &kp LALT, &kp LCTRL, &kp LSHFT, U_NA, &kp EQL, &kp NUM_4, &kp NUM_5, &kp NUM_6, &kp SEMI, \
U_NA, &kp RALT, &to U_NAV, &to U_NUM, U_NA, &kp BSLH, &kp NUM_1, &kp NUM_2, &kp NUM_3, &kp GRAVE, \
U_NP, U_NP, U_NA, U_NA, U_NA, &kp MINUS, &kp NUM_0, &kp DOT, U_NP, U_NP
#define MIRYOKU_ALTERNATIVES_NUM \
&kp LBKT, &kp NUM_7, &kp NUM_8, &kp NUM_9, &kp RBKT, U_NA, &to U_BASE, &to U_EXTRA, &to U_TAP, &bootloader, \
&kp LBKT, &kp NUM_7, &kp NUM_8, &kp NUM_9, &kp RBKT, U_NA, &to U_BASE, &to U_EXTRA, &to U_TAP, &u_bootloader, \
&kp SEMI, &kp NUM_4, &kp NUM_5, &kp NUM_6, &kp EQL, U_NA, &kp LSHFT, &kp LCTRL, &kp LALT, &kp LGUI, \
&kp GRAVE, &kp NUM_1, &kp NUM_2, &kp NUM_3, &kp BSLH, U_NA, &to U_NUM, &to U_NAV, &kp RALT, U_NA, \
U_NP, U_NP, &kp DOT, &kp NUM_0, &kp MINUS, U_NA, U_NA, U_NA, U_NP, U_NP
#define MIRYOKU_ALTERNATIVES_SYM_FLIP \
&bootloader, &to U_TAP, &to U_EXTRA, &to U_BASE, U_NA, &kp LBRC, &kp AMPS, &kp ASTRK, &kp LPAR, &kp RBRC, \
&u_bootloader, &to U_TAP, &to U_EXTRA, &to U_BASE, U_NA, &kp LBRC, &kp AMPS, &kp ASTRK, &kp LPAR, &kp RBRC, \
&kp LGUI, &kp LALT, &kp LCTRL, &kp LSHFT, U_NA, &kp PLUS, &kp DLLR, &kp PRCT, &kp CRRT, &kp COLON, \
U_NA, &kp RALT, &to U_MOUSE, &to U_SYM, U_NA, &kp PIPE, &kp EXCL, &kp AT, &kp HASH, &kp TILDE, \
U_NP, U_NP, U_NA, U_NA, U_NA, &kp UNDER, &kp LPAR, &kp RPAR, U_NP, U_NP
#define MIRYOKU_ALTERNATIVES_SYM \
&kp LBRC, &kp AMPS, &kp ASTRK, &kp LPAR, &kp RBRC, U_NA, &to U_BASE, &to U_EXTRA, &to U_TAP, &bootloader, \
&kp LBRC, &kp AMPS, &kp ASTRK, &kp LPAR, &kp RBRC, U_NA, &to U_BASE, &to U_EXTRA, &to U_TAP, &u_bootloader, \
&kp COLON, &kp DLLR, &kp PRCT, &kp CRRT, &kp PLUS, U_NA, &kp LSHFT, &kp LCTRL, &kp LALT, &kp LGUI, \
&kp TILDE, &kp EXCL, &kp AT, &kp HASH, &kp PIPE, U_NA, &to U_SYM, &to U_MOUSE, &kp RALT, U_NA, \
U_NP, U_NP, &kp LPAR, &kp RPAR, &kp UNDER, U_NA, U_NA, U_NA, U_NP, U_NP
#define MIRYOKU_ALTERNATIVES_FUN_FLIP \
&bootloader, &to U_TAP, &to U_EXTRA, &to U_BASE, U_NA, &kp PSCRN, &kp F7, &kp F8, &kp F9, &kp F12, \
&u_bootloader, &to U_TAP, &to U_EXTRA, &to U_BASE, U_NA, &kp PSCRN, &kp F7, &kp F8, &kp F9, &kp F12, \
&kp LGUI, &kp LALT, &kp LCTRL, &kp LSHFT, U_NA, &kp SLCK, &kp F4, &kp F5, &kp F6, &kp F11, \
U_NA, &kp RALT, &to U_MEDIA, &to U_FUN, U_NA, &kp PAUSE_BREAK, &kp F1, &kp F2, &kp F3, &kp F10, \
U_NP, U_NP, U_NA, U_NA, U_NA, &kp TAB, &kp SPC, &kp K_APP, U_NP, U_NP
#define MIRYOKU_ALTERNATIVES_FUN \
&kp F12, &kp F7, &kp F8, &kp F9, &kp PSCRN, U_NA, &to U_BASE, &to U_EXTRA, &to U_TAP, &bootloader, \
&kp F12, &kp F7, &kp F8, &kp F9, &kp PSCRN, U_NA, &to U_BASE, &to U_EXTRA, &to U_TAP, &u_bootloader, \
&kp F11, &kp F4, &kp F5, &kp F6, &kp SLCK, U_NA, &kp LSHFT, &kp LCTRL, &kp LALT, &kp LGUI, \
&kp F10, &kp F1, &kp F2, &kp F3, &kp PAUSE_BREAK, U_NA, &to U_FUN, &to U_MEDIA, &kp RALT, U_NA, \
U_NP, U_NP, &kp K_APP, &kp SPC, &kp TAB, U_NA, U_NA, U_NA, U_NP, U_NP

View File

@ -42,3 +42,9 @@ MIRYOKU_SHIFT_FUNCTION(u_ep_tog, &ext_power EP_TOG, &ext_power EP_OFF)
MIRYOKU_SHIFT_FUNCTION(u_caps_word, &caps_word, &kp CAPS)
#if defined(MIRYOKU_KLUDGE_SUSPEND)
MIRYOKU_SHIFT_FUNCTION(u_bootloader, &bootloader, &suspend)
#else
MIRYOKU_SHIFT_FUNCTION(u_bootloader, &bootloader, &reset)
#endif

View File

@ -448,7 +448,20 @@ For [[#workflow-builds][workflow builds]] using the [[#build-inputs][Build Input
For local builds, make the changes locally.
**** 𝑥MK
*** Suspend
Support for https://github.com/zmkfirmware/zmk/issues/1292#issuecomment-1264603539 is included using https://github.com/manna-harbour/zmk/tree/suspend-test and https://github.com/manna-harbour/zephyr/tree/v3.0.0+zmk-fixes-suspend-test.
To suspend, hold shift and tap the [[https://github.com/manna-harbour/miryoku/tree/master/docs/reference#additional-features][boot]] key. For split keyboards, use the boot key on each side, and suspend the peripheral side first.
To build, add ~#define MIRYOKU_KLUDGE_SUSPEND~ to the [[#config-file][config file]] and merge https://github.com/manna-harbour/zmk/tree/suspend-test.
For [[#workflow-builds][workflow builds]] using the [[#build-inputs][Build Inputs]] workflow, use ~#define MIRYOKU_KLUDGE_SUSPEND~ with the ~custom_config~ option, and ~zmkfirmware/zmk/main manna-harbour/zmk/suspend-test~ with the ~branches~ option. For workflow builds using [[#build-examples][Build Example]] workflows, see the [[.github/workflows/build-example-suspend.yml][Build Example suspend]] workflow.
For local builds, make the changes locally.
*** 𝑥MK
Use Miryoku ZMK with any keyboard with [[https://github.com/manna-harbour/xmk][𝑥MK]].