aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/action.c10
-rw-r--r--common/action_code.h3
-rw-r--r--doc/keymap.md7
3 files changed, 19 insertions, 1 deletions
diff --git a/common/action.c b/common/action.c
index fddb97c50..83bc8a618 100644
--- a/common/action.c
+++ b/common/action.c
@@ -237,6 +237,16 @@ void process_action(keyrecord_t *record)
237 case ACT_LAYER_TAP: 237 case ACT_LAYER_TAP:
238 case ACT_LAYER_TAP_EXT: 238 case ACT_LAYER_TAP_EXT:
239 switch (action.layer_tap.code) { 239 switch (action.layer_tap.code) {
240 case 0xe0 ... 0xef:
241 /* layer On/Off with modifiers(left only) */
242 if (event.pressed) {
243 layer_on(action.layer_tap.val);
244 register_mods(action.layer_tap.code & 0x0f);
245 } else {
246 layer_off(action.layer_tap.val);
247 unregister_mods(action.layer_tap.code & 0x0f);
248 }
249 break;
240 case OP_TAP_TOGGLE: 250 case OP_TAP_TOGGLE:
241 /* tap toggle */ 251 /* tap toggle */
242 if (event.pressed) { 252 if (event.pressed) {
diff --git a/common/action_code.h b/common/action_code.h
index 50112d4d2..bc40e2c6f 100644
--- a/common/action_code.h
+++ b/common/action_code.h
@@ -71,7 +71,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
71 * 71 *
72 * ACT_LAYER_TAP(101x): 72 * ACT_LAYER_TAP(101x):
73 * 101E|LLLL| keycode On/Off with tap key 73 * 101E|LLLL| keycode On/Off with tap key
74 * 101E|LLLL|1110 xxxx Reserved(0xE0-EF) 74 * 101E|LLLL|1110 mods On/Off with modifiers(0xE0-EF)
75 * 101E|LLLL|1111 0000 Invert with tap toggle(0xF0) 75 * 101E|LLLL|1111 0000 Invert with tap toggle(0xF0)
76 * 101E|LLLL|1111 0001 On/Off 76 * 101E|LLLL|1111 0001 On/Off
77 * 101E|LLLL|1111 0010 Off/On 77 * 101E|LLLL|1111 0010 Off/On
@@ -266,6 +266,7 @@ enum layer_pram_tap_op {
266#define ACTION_LAYER_ON_OFF(layer) ACTION_LAYER_TAP((layer), OP_ON_OFF) 266#define ACTION_LAYER_ON_OFF(layer) ACTION_LAYER_TAP((layer), OP_ON_OFF)
267#define ACTION_LAYER_OFF_ON(layer) ACTION_LAYER_TAP((layer), OP_OFF_ON) 267#define ACTION_LAYER_OFF_ON(layer) ACTION_LAYER_TAP((layer), OP_OFF_ON)
268#define ACTION_LAYER_SET_CLEAR(layer) ACTION_LAYER_TAP((layer), OP_SET_CLEAR) 268#define ACTION_LAYER_SET_CLEAR(layer) ACTION_LAYER_TAP((layer), OP_SET_CLEAR)
269#define ACTION_LAYER_MODS(layer, mods) ACTION_LAYER_TAP((layer), 0xe0 | (mods)&0x0f)
269/* With Tapping */ 270/* With Tapping */
270#define ACTION_LAYER_TAP_KEY(layer, key) ACTION_LAYER_TAP((layer), (key)) 271#define ACTION_LAYER_TAP_KEY(layer, key) ACTION_LAYER_TAP((layer), (key))
271#define ACTION_LAYER_TAP_TOGGLE(layer) ACTION_LAYER_TAP((layer), OP_TAP_TOGGLE) 272#define ACTION_LAYER_TAP_TOGGLE(layer) ACTION_LAYER_TAP((layer), OP_TAP_TOGGLE)
diff --git a/doc/keymap.md b/doc/keymap.md
index 11feeac21..9d986a8c5 100644
--- a/doc/keymap.md
+++ b/doc/keymap.md
@@ -497,6 +497,13 @@ Number of taps can be configured with `TAPPING_TOGGLE` in `config.h`, `5` by def
497 497
498 498
499 499
500### 3.5 Momentary switching with Modifiers
501This registers modifier key(s) simultaneously with layer switching.
502
503 ACTION_LAYER_MODS(2, MOD_LSFT | MOD_LALT)
504
505
506
500## 4. Tapping 507## 4. Tapping
501Tapping is to press and release a key quickly. Tapping speed is determined with setting of `TAPPING_TERM`, which can be defined in `config.h`, 200ms by default. 508Tapping is to press and release a key quickly. Tapping speed is determined with setting of `TAPPING_TERM`, which can be defined in `config.h`, 200ms by default.
502 509