2 Copyright 2016 Jun Wako <wakojun@gmail.com>
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
29 /* -------------------------------------
31 * ------------------------------------- */
33 /* Called once, very early stage of initialization, just after processor startup. */
34 /* Default behaviour: do nothing. */
35 void hook_early_init(void);
37 /* Called once, very last stage of initialization, just before keyboard loop. */
38 /* Default behaviour: do nothing. */
39 void hook_late_init(void);
41 /* Called once, on getting SUSPEND event from USB. */
42 /* Default behaviour: do nothing. */
43 void hook_usb_suspend_entry(void);
45 /* Called repeatedly during the SUSPENDed state. */
46 /* Default behaviour: power down and periodically check
47 * the matrix, cause wakeup if needed. */
48 void hook_usb_suspend_loop(void);
50 /* Called once, on getting WAKE event from USB. */
51 /* Default behaviour: disables sleep LED breathing and restores
52 * the "normal" indicator LED status by default. */
53 void hook_usb_wakeup(void);
55 /* Called repeatedly until getting to CONFIGURED state */
56 /* Default behaviour: do nothing. */
57 void hook_usb_startup_wait_loop(void);
60 /* -------------------------------------
62 * ------------------------------------- */
64 /* Called periodically from the keyboard loop (very often!) */
65 /* Default behaviour: do nothing. */
66 void hook_keyboard_loop(void);
68 /* Called on matrix state change event (every keypress => often!) */
69 /* Default behaviour: do nothing. */
70 void hook_matrix_change(keyevent_t event);
72 /* Called on default layer state change event. */
73 /* Default behaviour: do nothing. */
74 void hook_default_layer_change(uint32_t default_layer_state);
76 /* Called on layer state change event. */
77 /* Default behaviour: do nothing. */
78 void hook_layer_change(uint32_t layer_state);
80 /* Called on indicator LED update event (when reported from host). */
81 /* Default behaviour: calls keyboard_set_leds. */
82 void hook_keyboard_leds_change(uint8_t led_status);
84 /* Called once, on checking the bootmagic combos. */
85 /* Default behaviour: do nothing. */
86 void hook_bootmagic(void);
88 /* Called on before processing key event */
89 /* returns true if the event is consumed and default action is not needed. */
90 bool hook_process_action(keyrecord_t *record);
96 #endif /* _HOOKS_H_ */