1
0
Fork 0

Merge pull request #214 from cdlm/action-hook

Add per-event user hook function
This commit is contained in:
Jack Humbert 2016-03-28 11:55:19 -04:00
commit fd9e5d1510
6 changed files with 45 additions and 21 deletions

View file

@ -53,6 +53,9 @@ void action_exec(keyevent_t event)
#endif
}
__attribute__ ((weak))
void process_action_kb(keyrecord_t *record) {}
void process_action(keyrecord_t *record)
{
keyevent_t event = record->event;
@ -62,6 +65,8 @@ void process_action(keyrecord_t *record)
if (IS_NOEVENT(event)) { return; }
process_action_kb(record);
action_t action = layer_switch_get_action(event.key);
dprint("ACTION: "); debug_action(action);
#ifndef NO_ACTION_LAYER

View file

@ -58,6 +58,9 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt);
/* user defined special function */
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt);
/* keyboard-specific key event (pre)processing */
void process_action_kb(keyrecord_t *record);
/* Utilities for actions. */
void process_action(keyrecord_t *record);
void register_code(uint8_t code);