core: Add hook_process_action()
This commit is contained in:
parent
c25cdae5f2
commit
2b83b9a8f9
4 changed files with 25 additions and 13 deletions
|
|
@ -58,6 +58,8 @@ void action_exec(keyevent_t event)
|
|||
|
||||
void process_action(keyrecord_t *record)
|
||||
{
|
||||
if (hook_process_action(record)) return;
|
||||
|
||||
keyevent_t event = record->event;
|
||||
#ifndef NO_ACTION_TAPPING
|
||||
uint8_t tap_count = record->tap.count;
|
||||
|
|
|
|||
|
|
@ -47,3 +47,8 @@ void hook_keyboard_leds_change(uint8_t led_status) {
|
|||
|
||||
__attribute__((weak))
|
||||
void hook_bootmagic(void) {}
|
||||
|
||||
__attribute__((weak))
|
||||
bool hook_process_action(keyrecord_t *record) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include "keyboard.h"
|
||||
#include "led.h"
|
||||
#include "action.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
@ -84,6 +85,10 @@ void hook_keyboard_leds_change(uint8_t led_status);
|
|||
/* Default behaviour: do nothing. */
|
||||
void hook_bootmagic(void);
|
||||
|
||||
/* Called on before processing key event */
|
||||
/* returns true if the event is consumed and default action is not needed. */
|
||||
bool hook_process_action(keyrecord_t *record);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue