diff options
author | tmk <nobody@nowhere> | 2013-02-13 11:47:19 +0900 |
---|---|---|
committer | tmk <nobody@nowhere> | 2013-02-13 11:47:19 +0900 |
commit | 9bc82bf61c342ca96e6f942b169b7c88b6bf95cf (patch) | |
tree | 5ef3904f124fdb75eb69e2e0418a3c120f02ffb8 /common/action.c | |
parent | 7054203e16af627a921b503a9508ce789913471d (diff) | |
download | firmware-9bc82bf61c342ca96e6f942b169b7c88b6bf95cf.tar.gz firmware-9bc82bf61c342ca96e6f942b169b7c88b6bf95cf.tar.bz2 firmware-9bc82bf61c342ca96e6f942b169b7c88b6bf95cf.zip |
Change action API
Diffstat (limited to 'common/action.c')
-rw-r--r-- | common/action.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/common/action.c b/common/action.c index 710300eb3..840d70f34 100644 --- a/common/action.c +++ b/common/action.c @@ -26,6 +26,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "action.h" +/* default layer indicates base layer */ +uint8_t default_layer = 0; +/* current layer indicates active layer at this time */ +uint8_t current_layer = 0; + + static void process_action(keyrecord_t *record); static bool process_tapping(keyrecord_t *record); static void waiting_buffer_scan_tap(void); @@ -203,12 +209,12 @@ void action_exec(keyevent_t event) static action_t get_action(key_t key) { - action_t action = keymap_get_action(current_layer, key.pos.row, key.pos.col); + action_t action = action_for_key(current_layer, key); /* Transparently use default layer */ if (action.code == ACTION_TRANSPARENT) { // TODO: layer stacking - action = keymap_get_action(default_layer, key.pos.row, key.pos.col); + action = action_for_key(default_layer, key); debug("TRNASPARENT: "); debug_hex16(action.code); debug("\n"); } return action; @@ -509,12 +515,12 @@ static void process_action(keyrecord_t *record) /* Extentions */ case ACT_MACRO: + // TODO break; case ACT_COMMAND: break; case ACT_FUNCTION: - // TODO - keymap_call_function(record, action.func.id, action.func.opt); + action_function(record, action.func.id, action.func.opt); break; default: break; |