diff --git a/docs/features/leader_key.md b/docs/features/leader_key.md index 423f55b7e84..9f9086e1ae0 100644 --- a/docs/features/leader_key.md +++ b/docs/features/leader_key.md @@ -154,11 +154,16 @@ User callback, invoked when the leader sequence ends. --- -### `bool leader_add_user(void)` {#api-leader-add-user} +### `bool leader_add_user(uint16_t keycode)` {#api-leader-add-user} User callback, invoked when a keycode is added to the leader sequence. -#### Return Value {#api-leader-sequence-add-return} +#### Arguments {#api-leader-add-user-arguments} + + - `uint16_t keycode` + The keycode to added to the leader sequence. + +#### Return Value {#api-leader-add-user-return} `true` to finish the key sequence, `false` to continue. diff --git a/quantum/leader.c b/quantum/leader.c index 2f24ebfe805..4016c934cc0 100644 --- a/quantum/leader.c +++ b/quantum/leader.c @@ -21,7 +21,7 @@ __attribute__((weak)) void leader_start_user(void) {} __attribute__((weak)) void leader_end_user(void) {} -__attribute__((weak)) bool leader_add_user(void) { return false; } +__attribute__((weak)) bool leader_add_user(uint16_t keycode) { return false; } void leader_start(void) { if (leading) { @@ -63,7 +63,7 @@ bool leader_sequence_add(uint16_t keycode) { leader_sequence[leader_sequence_size] = keycode; leader_sequence_size++; - if (leader_add_user()) { + if (leader_add_user(keycode)) { leader_end(); } return true; diff --git a/quantum/leader.h b/quantum/leader.h index c54364030fe..fba6b287ba3 100644 --- a/quantum/leader.h +++ b/quantum/leader.h @@ -24,9 +24,11 @@ void leader_end_user(void); /** * \brief User callback, invoked when a keycode is added to the leader sequence. * + * \param keycode The keycode added to the leader sequence. + * * \return `true` to finish the key sequence, `false` to continue. */ -bool leader_add_user(void); +bool leader_add_user(uint16_t keycode); /** * Begin the leader sequence, resetting the buffer and timer.