From b99143fdd2637f573bb8c2632a38b84acc1945a0 Mon Sep 17 00:00:00 2001 From: NoOne2246 Date: Tue, 9 Apr 2024 04:55:42 +1000 Subject: [PATCH] Oneshot locked mods split transaction (#23434) --- docs/feature_split_keyboard.md | 2 +- quantum/split_common/transactions.c | 5 +++++ quantum/split_common/transport.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/feature_split_keyboard.md b/docs/feature_split_keyboard.md index 59159cb3fab849cda11e44949b53ca9dce547521..99c252d03ecf6e2bc6f4002395f9096525093f2d 100644 --- a/docs/feature_split_keyboard.md +++ b/docs/feature_split_keyboard.md @@ -266,7 +266,7 @@ This enables syncing of the Host LED status (caps lock, num lock, etc) between b #define SPLIT_MODS_ENABLE ``` -This enables transmitting modifier state (normal, weak and oneshot) to the non primary side of the split keyboard. The purpose of this feature is to support cosmetic use of modifer state (e.g. displaying status on an OLED screen). +This enables transmitting modifier state (normal, weak, oneshot and oneshot locked) to the non primary side of the split keyboard. The purpose of this feature is to support cosmetic use of modifer state (e.g. displaying status on an OLED screen). ```c #define SPLIT_WPM_ENABLE diff --git a/quantum/split_common/transactions.c b/quantum/split_common/transactions.c index 33bc9e9f575a97a2f2244f39d3b0af36c201a69c..decf5e5ede07b64dac8f2b402db5df62e4d87ec1 100644 --- a/quantum/split_common/transactions.c +++ b/quantum/split_common/transactions.c @@ -419,6 +419,10 @@ static bool mods_handlers_master(matrix_row_t master_matrix[], matrix_row_t slav if (!mods_need_sync && new_mods.oneshot_mods != split_shmem->mods.oneshot_mods) { mods_need_sync = true; } + new_mods.oneshot_locked_mods = get_oneshot_locked_mods(); + if (!mods_need_sync && new_mods.oneshot_locked_mods != split_shmem->mods.oneshot_locked_mods) { + mods_need_sync = true; + } # endif // NO_ACTION_ONESHOT bool okay = true; @@ -442,6 +446,7 @@ static void mods_handlers_slave(matrix_row_t master_matrix[], matrix_row_t slave set_weak_mods(mods.weak_mods); # ifndef NO_ACTION_ONESHOT set_oneshot_mods(mods.oneshot_mods); + set_oneshot_locked_mods(mods.oneshot_locked_mods); # endif } diff --git a/quantum/split_common/transport.h b/quantum/split_common/transport.h index 4f6b968fa8a0ddbaccc9ed456493eaeb74a608b2..fbd87ca3123a09cb1dc2f374455aad6ab81282d1 100644 --- a/quantum/split_common/transport.h +++ b/quantum/split_common/transport.h @@ -101,6 +101,7 @@ typedef struct _split_mods_sync_t { uint8_t weak_mods; # ifndef NO_ACTION_ONESHOT uint8_t oneshot_mods; + uint8_t oneshot_locked_mods; # endif // NO_ACTION_ONESHOT } split_mods_sync_t; #endif // SPLIT_MODS_ENABLE