Skip to content

Commit

Permalink
Oneshot locked mods split transaction (qmk#23434)
Browse files Browse the repository at this point in the history
  • Loading branch information
NoOne2246 authored and nuess0r committed Sep 8, 2024
1 parent 7fc773d commit 094787d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/feature_split_keyboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions quantum/split_common/transactions.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
}

Expand Down
1 change: 1 addition & 0 deletions quantum/split_common/transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 094787d

Please sign in to comment.