summaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
authorDan McGregor <dan.mcgregor@usask.ca>2015-05-19 11:29:28 -0700
committerDan McGregor <dan.mcgregor@usask.ca>2015-05-19 11:29:28 -0700
commitc17b8a599e3ec3b0a327bcd66082541f2517ab30 (patch)
treebe5c1ab9fee70948bdd4d5ef1f933f0d08a53247 /tmk_core
parent81137b7a61ef11df023e1f542840a80bfc1ca090 (diff)
downloadqmk_firmware-c17b8a599e3ec3b0a327bcd66082541f2517ab30.tar.gz
qmk_firmware-c17b8a599e3ec3b0a327bcd66082541f2517ab30.zip
Make action_for_key a weak symbol
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/common/action.h1
-rw-r--r--tmk_core/common/keymap.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/tmk_core/common/action.h b/tmk_core/common/action.h
index 8a4736d7bc..e76161c17f 100644
--- a/tmk_core/common/action.h
+++ b/tmk_core/common/action.h
@@ -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);
diff --git a/tmk_core/common/keymap.c b/tmk_core/common/keymap.c
index 9f4fab5216..a43ca460f2 100644
--- a/tmk_core/common/keymap.c
+++ b/tmk_core/common/keymap.c
@@ -27,8 +27,13 @@ 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) {
case KC_FN0 ... KC_FN31: