X-Git-Url: https://git.gir.st/tmk_keyboard.git/blobdiff_plain/71381457fa1311dfa0b58ba882a96db740640871..20b787fc1284176834cbe7ca2134e4b36bec5828:/common/hook.h diff --git a/common/hook.h b/common/hook.h index ff569d49..56fe5677 100644 --- a/common/hook.h +++ b/common/hook.h @@ -22,14 +22,14 @@ along with this program. If not, see . #include "led.h" /* ------------------------------------- - * Hardware / one-off hooks + * Protocol hooks * ------------------------------------- */ -/* Called once, before initialising USB. */ +/* Called once, very early stage of initialization, just after processor startup. */ /* Default behaviour: do nothing. */ void hook_early_init(void); -/* Called once, after USB is connected and keyboard initialised. */ +/* Called once, very last stage of initialization, just before keyboard loop. */ /* Default behaviour: do nothing. */ void hook_late_init(void); @@ -47,12 +47,9 @@ void hook_usb_suspend_loop(void); * the "normal" indicator LED status by default. */ void hook_usb_wakeup(void); -/* Called once, on checking the bootmagic combos. */ -/* Default behaviour: do nothing. */ -void hook_bootmagic(void); /* ------------------------------------- - * Keyboard / periodic hooks + * Keyboard hooks * ------------------------------------- */ /* Called periodically from the keyboard loop (very often!) */ @@ -63,12 +60,21 @@ void hook_keyboard_loop(void); /* Default behaviour: do nothing. */ void hook_matrix_change(keyevent_t event); +/* Called on default layer state change event. */ +/* Default behaviour: do nothing. */ +void hook_default_layer_change(uint32_t default_layer_state); + /* Called on layer state change event. */ /* Default behaviour: do nothing. */ -void hook_layer_change(uint8_t layer_state); +void hook_layer_change(uint32_t layer_state); /* Called on indicator LED update event (when reported from host). */ -/* Default behaviour: calls keyboard_set_leds (for compatibility). */ +/* Default behaviour: calls keyboard_set_leds. */ void hook_keyboard_leds_change(uint8_t led_status); +/* Called once, on checking the bootmagic combos. */ +/* Default behaviour: do nothing. */ +void hook_bootmagic(void); + + #endif /* _HOOKS_H_ */