Add the default key event handler in Keyboardio_::setup

Having the default handler in the list by default prevents other things
to hook up before it. Add it in Keyboardio_::setup instead, so that
others have a chance to add themselves first.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
pull/32/head
Gergely Nagy 8 years ago
parent 863dbeb328
commit 7396a8bd1d

@ -5,6 +5,7 @@ Keyboardio_::Keyboardio_(void) {
void void
Keyboardio_::setup(void) { Keyboardio_::setup(void) {
event_handler_hook_add (handle_key_event_default);
wdt_disable(); wdt_disable();
delay(100); delay(100);
Keyboard.begin(); Keyboard.begin();

@ -41,10 +41,7 @@ void handle_synthetic_key_event(Key mappedKey, uint8_t currentState, uint8_t pre
} }
} }
custom_handler_t eventHandlers[HOOK_MAX] = { custom_handler_t eventHandlers[HOOK_MAX] = {NULL};
handle_key_event_default,
(custom_handler_t) NULL
};
Key lookup_key(byte keymap, byte row, byte col) { Key lookup_key(byte keymap, byte row, byte col) {
Key mappedKey; Key mappedKey;

Loading…
Cancel
Save