mirror of
https://github.com/qmk/qmk_firmware.git
synced 2024-11-25 04:43:02 +00:00
Add keycode parameter to leader_add_user callback
This commit is contained in:
parent
0de31e3318
commit
6a54422a41
@ -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.
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user