Skip to content

Commit

Permalink
layer tap, mod tap
Browse files Browse the repository at this point in the history
  • Loading branch information
jackhumbert committed Oct 28, 2015
1 parent d9f08e6 commit 18da1e6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions quantum/keymap_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ action_t action_for_key(uint8_t layer, keypos_t key)
action_t action;
action.code = ACTION_MODS_TAP_KEY((keycode >> 0x8) & 0xF, keycode & 0xFF);
return action;
} else if (keycode >= 0x8000 && keycode < 0x9000) {
action_t action;
action.code = ACTION_LAYER_TAP_KEY((keycode >> 0x8) & 0xF, keycode & 0xFF);
return action;
#ifdef UNICODE_ENABLE
} else if (keycode >= 0x8000000) {
action_t action;
Expand Down
7 changes: 5 additions & 2 deletions quantum/keymap_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,16 @@ extern const uint16_t fn_actions[];

#define MIDI(n) (n | 0x6000)

// H-old, T-ap - 256 keycode max
#define HT(mod, kc) (kc | 0x7000 | ((mod & 0xF) << 8))
// M-od, T-ap - 256 keycode max
#define MT(mod, kc) (kc | 0x7000 | ((mod & 0xF) << 8))
#define CTL_T(kc) HT(0x1, kc)
#define SFT_T(kc) HT(0x2, kc)
#define ALT_T(kc) HT(0x4, kc)
#define GUI_T(kc) HT(0x8, kc)

// L-ayer, T-ap - 256 keycode max, 16 layer max
#define LT(layer, kc) (kc | 0x7000 | ((layer & 0xF) << 8))

// For sending unicode codes.
// You may not send codes over 1FFF -- this supports most of UTF8.
// To have a key that sends out Œ, go UC(0x0152)
Expand Down

0 comments on commit 18da1e6

Please sign in to comment.