aboutsummaryrefslogtreecommitdiff
path: root/common/action.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/action.c')
-rw-r--r--common/action.c14
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/>.
26#include "action.h" 26#include "action.h"
27 27
28 28
29/* default layer indicates base layer */
30uint8_t default_layer = 0;
31/* current layer indicates active layer at this time */
32uint8_t current_layer = 0;
33
34
29static void process_action(keyrecord_t *record); 35static void process_action(keyrecord_t *record);
30static bool process_tapping(keyrecord_t *record); 36static bool process_tapping(keyrecord_t *record);
31static void waiting_buffer_scan_tap(void); 37static void waiting_buffer_scan_tap(void);
@@ -203,12 +209,12 @@ void action_exec(keyevent_t event)
203 209
204static action_t get_action(key_t key) 210static action_t get_action(key_t key)
205{ 211{
206 action_t action = keymap_get_action(current_layer, key.pos.row, key.pos.col); 212 action_t action = action_for_key(current_layer, key);
207 213
208 /* Transparently use default layer */ 214 /* Transparently use default layer */
209 if (action.code == ACTION_TRANSPARENT) { 215 if (action.code == ACTION_TRANSPARENT) {
210 // TODO: layer stacking 216 // TODO: layer stacking
211 action = keymap_get_action(default_layer, key.pos.row, key.pos.col); 217 action = action_for_key(default_layer, key);
212 debug("TRNASPARENT: "); debug_hex16(action.code); debug("\n"); 218 debug("TRNASPARENT: "); debug_hex16(action.code); debug("\n");
213 } 219 }
214 return action; 220 return action;
@@ -509,12 +515,12 @@ static void process_action(keyrecord_t *record)
509 515
510 /* Extentions */ 516 /* Extentions */
511 case ACT_MACRO: 517 case ACT_MACRO:
518 // TODO
512 break; 519 break;
513 case ACT_COMMAND: 520 case ACT_COMMAND:
514 break; 521 break;
515 case ACT_FUNCTION: 522 case ACT_FUNCTION:
516 // TODO 523 action_function(record, action.func.id, action.func.opt);
517 keymap_call_function(record, action.func.id, action.func.opt);
518 break; 524 break;
519 default: 525 default:
520 break; 526 break;