Add ability to use tap macros without using functions

This commit is contained in:
Luke Silva 2017-01-27 10:28:42 +11:00
parent 87bc36253d
commit cfc4149712
2 changed files with 5 additions and 1 deletions

View File

@ -80,7 +80,10 @@ action_t action_for_key(uint8_t layer, keypos_t key)
action.code = keymap_function_id_to_action( (int)keycode & 0xFFF );
break;
case QK_MACRO ... QK_MACRO_MAX:
action.code = ACTION_MACRO(keycode & 0xFF);
if (keycode & 0x800) // tap macros have upper bit set
action.code = ACTION_MACRO_TAP(keycode & 0xFF);
else
action.code = ACTION_MACRO(keycode & 0xFF);
break;
case QK_LAYER_TAP ... QK_LAYER_TAP_MAX:
action.code = ACTION_LAYER_TAP_KEY((keycode >> 0x8) & 0xF, keycode & 0xFF);

View File

@ -246,6 +246,7 @@ enum quantum_keycodes {
#define M(kc) (kc | QK_MACRO)
#define MACROTAP(kc) (kc | QK_MACRO | FUNC_TAP<<8)
#define MACRODOWN(...) (record->event.pressed ? MACRO(__VA_ARGS__) : MACRO_NONE)
// L-ayer, T-ap - 256 keycode max, 16 layer max