Add MIRYOKU_KLUDGE_GLOBALSHIFTFUNCTIONS

This commit is contained in:
Manna Harbour 2022-11-18 12:01:31 +11:00
parent d447f5b713
commit 692a9d9025
5 changed files with 49 additions and 16 deletions

View File

@ -19,6 +19,8 @@
#include "miryoku_double_tap_guard.h"
#include "miryoku_shift_functions.h"
#if defined (MIRYOKU_KLUDGE_MOUSEKEYSPR)
#include "miryoku_kludge_mousekeyspr.h"
#else

View File

@ -311,32 +311,32 @@ U_NP, U_NP, U_NA, U_NA, U_NA
#define MIRYOKU_ALTERNATIVES_MEDIA_INVERTEDT_FLIP \
&u_rgb_hui, &u_rgb_sai, &kp C_VOL_UP, &u_rgb_bri, &u_rgb_tog, U_NA, &u_to_U_BASE, &u_to_U_EXTRA, &u_to_U_TAP, U_BOOT, \
&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_RGB_HUI, U_RGB_SAI, &kp C_VOL_UP, U_RGB_BRI, U_RGB_TOG, U_NA, &u_to_U_BASE, &u_to_U_EXTRA, &u_to_U_TAP, U_BOOT, \
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, &u_to_U_MEDIA, &u_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, &u_to_U_BASE, &u_to_U_EXTRA, &u_to_U_TAP, U_BOOT, \
&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_RGB_EFF, U_RGB_HUI, U_RGB_SAI, U_RGB_BRI, U_RGB_TOG, U_NA, &u_to_U_BASE, &u_to_U_EXTRA, &u_to_U_TAP, U_BOOT, \
&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, &u_to_U_MEDIA, &u_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 \
U_BOOT, &u_to_U_TAP, &u_to_U_EXTRA, &u_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_BOOT, &u_to_U_TAP, &u_to_U_EXTRA, &u_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, &u_to_U_FUN, &u_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 \
U_BOOT, &u_to_U_TAP, &u_to_U_EXTRA, &u_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_BOOT, &u_to_U_TAP, &u_to_U_EXTRA, &u_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, &u_to_U_FUN, &u_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 \
U_BOOT, &u_to_U_TAP, &u_to_U_EXTRA, &u_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_BOOT, &u_to_U_TAP, &u_to_U_EXTRA, &u_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, &u_to_U_FUN, &u_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

View File

@ -22,7 +22,6 @@
}; \
MIRYOKU_SHIFT_FUNCTION(NAME, BINDING, &u_macro_ ## NAME)
MIRYOKU_SHIFT_MACRO(u_bt_sel_0, &bt BT_SEL 0, &bt BT_SEL 0 &bt BT_CLR)
MIRYOKU_SHIFT_MACRO(u_bt_sel_1, &bt BT_SEL 1, &bt BT_SEL 1 &bt BT_CLR)
MIRYOKU_SHIFT_MACRO(u_bt_sel_2, &bt BT_SEL 2, &bt BT_SEL 2 &bt BT_CLR)
@ -31,6 +30,10 @@ MIRYOKU_SHIFT_MACRO(u_bt_sel_4, &bt BT_SEL 4, &bt BT_SEL 4 &bt BT_CLR)
MIRYOKU_SHIFT_FUNCTION(u_out_tog, &out OUT_TOG, &out OUT_USB)
MIRYOKU_SHIFT_FUNCTION(u_caps_word, &caps_word, &kp CAPS)
#if defined (MIRYOKU_KLUDGE_GLOBALSHIFTFUNCTIONS)
MIRYOKU_SHIFT_FUNCTION(u_rgb_tog, &rgb_ug RGB_TOG, &rgb_ug RGB_OFF)
MIRYOKU_SHIFT_FUNCTION(u_rgb_eff, &rgb_ug RGB_EFF, &rgb_ug RGB_EFR)
@ -40,5 +43,4 @@ MIRYOKU_SHIFT_FUNCTION(u_rgb_bri, &rgb_ug RGB_BRI, &rgb_ug RGB_BRD)
MIRYOKU_SHIFT_FUNCTION(u_ep_tog, &ext_power EP_TOG, &ext_power EP_OFF)
MIRYOKU_SHIFT_FUNCTION(u_caps_word, &caps_word, &kp CAPS)
#endif

View File

@ -0,0 +1,20 @@
// Copyright 2022 Manna Harbour
// https://github.com/manna-harbour/miryoku
#pragma once
#if defined (MIRYOKU_KLUDGE_GLOBALSHIFTFUNCTIONS)
#define U_RGB_TOG &u_rgb_tog
#define U_RGB_EFF &u_rgb_eff
#define U_RGB_HUI &u_rgb_hui
#define U_RGB_SAI &u_rgb_sai
#define U_RGB_BRI &u_rgb_bri
#define U_EP_TOG &u_ep_tog
#else
#define U_RGB_TOG &rgb_ug RGB_TOG
#define U_RGB_EFF &rgb_ug RGB_EFF
#define U_RGB_HUI &rgb_ug RGB_HUI
#define U_RGB_SAI &rgb_ug RGB_SAI
#define U_RGB_BRI &rgb_ug RGB_BRI
#define U_EP_TOG &ext_power EP_TOG
#endif

View File

@ -23,6 +23,7 @@ The [[#keyboard-keymaps][keyboard keymaps]] are composed of the config file, a [
[[#caps-word][caps word]],
[[#customisation][customisation]],
[[#double-tap-boot][double tap boot]],
[[#global-shift-functions][global shift functions]],
[[#key-emulation-combos][key emulation combos]],
[[#mouse-keys][mouse keys]],
[[#suspend][suspend]],
@ -443,13 +444,21 @@ See https://github.com/manna-harbour/miryoku/discussions/85.
*** Double Tap Boot
[[https://github.com/manna-harbour/miryoku/tree/master/docs/reference#additional-features][Additional features]] require a double tap to prevent accidental activation. This not supported in ZMK for the bootloader behavior on split keyboards. Use a single tap instead. See https://github.com/zmkfirmware/zmk/issues/1494.
Double tap is used with [[https://github.com/manna-harbour/miryoku/tree/master/docs/reference#additional-features][Additional features]]. Double tap for the bootloader behavior is not supported in ZMK on split keyboards. See https://github.com/zmkfirmware/zmk/issues/1494. By default, double tap for bootloader is disabled. Use a single tap instead.
Requiring double tap to activate the bootloader can be enabled for use with non-split keyboards. Use with split keyboards will require use of the reset button to enter the bootloader on the peripheral side.
Double tap for bootloader can be enabled for use with non-split keyboards. For [[#local-builds][local builds]], add ~#define MIRYOKU_KLUDGE_DOUBLETAPBOOT~ to the [[#config-file][config file]]. For [[#workflow-builds][workflow builds]], use ~#define MIRYOKU_KLUDGE_DOUBLETAPBOOT~ with the ~custom_config~ option.
For [[#local-builds][local builds]], add ~#define MIRYOKU_KLUDGE_DOUBLETAPBOOT~ to the [[#config-file][config file]]. For [[#workflow-builds][workflow builds]], use ~#define MIRYOKU_KLUDGE_DOUBLETAPBOOT~ with the ~custom_config~ option.
Use with split keyboards will result in the bootloader function only taking effect on the central side. Use a reset button to enter the bootloader on the peripheral side.
*** Global Shift Functions
Shift functions are used on [[https://github.com/manna-harbour/miryoku/tree/master/docs/reference#media][Media]]. Shift functions are not supported in ZMK for RGB and EP behaviors on split keyboards. See https://github.com/zmkfirmware/zmk/issues/1494. By default, shift functions for RGB and EP are disabled. Only the unshifted functions are available.
Shift functions for RGB and EP can be enabled for use with non-split keyboards. For [[#local-builds][local builds]], add ~#define MIRYOKU_KLUDGE_GLOBALSHIFTFUNCTIONS~ to the [[#config-file][config file]]. For [[#workflow-builds][workflow builds]], use ~#define MIRYOKU_KLUDGE_GLOBALSHIFTFUNCTIONS~ with the ~custom_config~ option.
Use with split keyboards will result in the shifted as well as the unshifted functions for RGB and EP only taking effect on the central side.
*** Key Emulation Combos
Emulate a key with a combo of two other keys. Enabled automatically on keyboards with a missing key. Can be enabled on other keyboards for use with hard to reach keys, or for compatibility.