Skip to content

Commit

Permalink
Make action_for_key a weak symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
dankm committed Mar 14, 2017
1 parent 1972b40 commit f54a7d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions tmk_core/common/action.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ void action_exec(keyevent_t event);

/* action for key */
action_t action_for_key(uint8_t layer, keypos_t key);
action_t action_for_key_default(uint8_t layer, keypos_t key);

/* macro */
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt);
Expand Down
5 changes: 5 additions & 0 deletions tmk_core/common/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ static action_t keycode_to_action(uint8_t keycode);
/* converts key to action */
__attribute__ ((weak))
action_t action_for_key(uint8_t layer, keypos_t key)
{
return action_for_key_default(layer, key);
}

action_t action_for_key_default(uint8_t layer, keypos_t key)
{
uint8_t keycode = keymap_key_to_keycode(layer, key);
switch (keycode) {
Expand Down

0 comments on commit f54a7d4

Please sign in to comment.