aboutsummaryrefslogtreecommitdiff
path: root/quantum/keymap_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/keymap_common.c')
-rw-r--r--quantum/keymap_common.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c
index eced3d2bb..6cf4f031f 100644
--- a/quantum/keymap_common.c
+++ b/quantum/keymap_common.c
@@ -1,5 +1,5 @@
1/* 1/*
2Copyright 2012,2013 Jun Wako <wakojun@gmail.com> 2Copyright 2012-2017 Jun Wako <wakojun@gmail.com>
3 3
4This program is free software: you can redistribute it and/or modify 4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by 5it under the terms of the GNU General Public License as published by
@@ -80,7 +80,10 @@ action_t action_for_key(uint8_t layer, keypos_t key)
80 action.code = keymap_function_id_to_action( (int)keycode & 0xFFF ); 80 action.code = keymap_function_id_to_action( (int)keycode & 0xFFF );
81 break; 81 break;
82 case QK_MACRO ... QK_MACRO_MAX: 82 case QK_MACRO ... QK_MACRO_MAX:
83 action.code = ACTION_MACRO(keycode & 0xFF); 83 if (keycode & 0x800) // tap macros have upper bit set
84 action.code = ACTION_MACRO_TAP(keycode & 0xFF);
85 else
86 action.code = ACTION_MACRO(keycode & 0xFF);
84 break; 87 break;
85 case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: 88 case QK_LAYER_TAP ... QK_LAYER_TAP_MAX:
86 action.code = ACTION_LAYER_TAP_KEY((keycode >> 0x8) & 0xF, keycode & 0xFF); 89 action.code = ACTION_LAYER_TAP_KEY((keycode >> 0x8) & 0xF, keycode & 0xFF);
@@ -116,8 +119,11 @@ action_t action_for_key(uint8_t layer, keypos_t key)
116 mod = keycode & 0xFF; 119 mod = keycode & 0xFF;
117 action.code = ACTION_MODS_ONESHOT(mod); 120 action.code = ACTION_MODS_ONESHOT(mod);
118 break; 121 break;
122 case QK_LAYER_TAP_TOGGLE ... QK_LAYER_TAP_TOGGLE_MAX:
123 action.code = ACTION_LAYER_TAP_TOGGLE(keycode & 0xFF);
124 break;
119 case QK_MOD_TAP ... QK_MOD_TAP_MAX: 125 case QK_MOD_TAP ... QK_MOD_TAP_MAX:
120 action.code = ACTION_MODS_TAP_KEY((keycode >> 0x8) & 0xF, keycode & 0xFF); 126 action.code = ACTION_MODS_TAP_KEY((keycode >> 0x8) & 0x1F, keycode & 0xFF);
121 break; 127 break;
122 #ifdef BACKLIGHT_ENABLE 128 #ifdef BACKLIGHT_ENABLE
123 case BL_0 ... BL_15: 129 case BL_0 ... BL_15: