aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/action.c3
-rw-r--r--common/action.h17
2 files changed, 11 insertions, 9 deletions
diff --git a/common/action.c b/common/action.c
index 6d5336752..aadf5e16e 100644
--- a/common/action.c
+++ b/common/action.c
@@ -358,6 +358,7 @@ static void process_action(keyrecord_t *record)
358 layer_switch(action.layer.val); 358 layer_switch(action.layer.val);
359 } 359 }
360 else { 360 else {
361 // NOTE: This is needed by legacy keymap support
361 layer_switch(default_layer); 362 layer_switch(default_layer);
362 } 363 }
363 break; 364 break;
@@ -421,7 +422,7 @@ static void process_action(keyrecord_t *record)
421 unregister_code(action.layer.code); 422 unregister_code(action.layer.code);
422 } else { 423 } else {
423 //debug("LAYER_PRESSED: No tap: NO ACTION\n"); 424 //debug("LAYER_PRESSED: No tap: NO ACTION\n");
424//TODO: this is ok? 425 // NOTE: This is needed by legacy keymap support
425 debug("LAYER_PRESSED: No tap: return to default layer\n"); 426 debug("LAYER_PRESSED: No tap: return to default layer\n");
426 layer_switch(default_layer); 427 layer_switch(default_layer);
427 } 428 }
diff --git a/common/action.h b/common/action.h
index 9b559cb18..ac44b1a79 100644
--- a/common/action.h
+++ b/common/action.h
@@ -157,7 +157,7 @@ ACT_LAYER_BIT(1001): Bit-op layer
1571000|LLLL|0000 0001 set L to layer on press 1571000|LLLL|0000 0001 set L to layer on press
1581000|LLLL|0000 0010 set L to layer on release 1581000|LLLL|0000 0010 set L to layer on release
1591000|----|0000 0011 set default to layer on both(return to default layer) 1591000|----|0000 0011 set default to layer on both(return to default layer)
1601000|LLLL|xxxx xxxx set L to layer while hold and send key on tap 1601000|LLLL| keycode set L to layer while hold and send key on tap
1611000|LLLL|1111 0000 set L to layer while hold and toggle on several taps 1611000|LLLL|1111 0000 set L to layer while hold and toggle on several taps
1621000|LLLL|1111 1111 set L to default and layer(on press) 1621000|LLLL|1111 1111 set L to default and layer(on press)
163 163
@@ -165,7 +165,7 @@ ACT_LAYER_BIT(1001): Bit-op layer
1651001|BBBB|0000 0001 bit-xor layer with B on press 1651001|BBBB|0000 0001 bit-xor layer with B on press
1661001|BBBB|0000 0010 bit-xor layer with B on release 1661001|BBBB|0000 0010 bit-xor layer with B on release
1671001|BBBB|0000 0011 bit-xor layer with B on both(momentary) 1671001|BBBB|0000 0011 bit-xor layer with B on both(momentary)
1681001|BBBB|xxxx xxxx bit-xor layer with B while hold and send key on tap 1681001|BBBB| keycode bit-xor layer with B while hold and send key on tap
1691001|BBBB|1111 0000 bit-xor layer with B while hold and toggle on several taps 1691001|BBBB|1111 0000 bit-xor layer with B while hold and toggle on several taps
1701001|BBBB|1111 1111 bit-xor default with B and set layer(on press) 1701001|BBBB|1111 1111 bit-xor default with B and set layer(on press)
171 171
@@ -213,10 +213,10 @@ enum action_kind_id {
213/* Key */ 213/* Key */
214#define ACTION_KEY(key) ACTION(ACT_LMODS, key) 214#define ACTION_KEY(key) ACTION(ACT_LMODS, key)
215/* Mods & key */ 215/* Mods & key */
216#define ACTION_LMODS(mods) ACTION(ACT_LMODS, (mods)<<8 | 0x00) 216#define ACTION_LMODS(mods) ACTION(ACT_LMODS, MODS4(mods)<<8 | 0x00)
217#define ACTION_LMODS_KEY(mods, key) ACTION(ACT_LMODS, (mods)<<8 | (key)) 217#define ACTION_LMODS_KEY(mods, key) ACTION(ACT_LMODS, MODS4(mods)<<8 | (key))
218#define ACTION_RMODS(mods) ACTION(ACT_RMODS, (mods)<<8 | 0x00) 218#define ACTION_RMODS(mods) ACTION(ACT_RMODS, MODS4(mods)<<8 | 0x00)
219#define ACTION_RMODS_KEY(mods, key) ACTION(ACT_RMODS, (mods)<<8 | (key)) 219#define ACTION_RMODS_KEY(mods, key) ACTION(ACT_RMODS, MODS4(mods)<<8 | (key))
220/* Mod & key */ 220/* Mod & key */
221#define ACTION_LMOD(mod) ACTION(ACT_LMODS, MODS4(MOD_BIT(mod))<<8 | 0x00) 221#define ACTION_LMOD(mod) ACTION(ACT_LMODS, MODS4(MOD_BIT(mod))<<8 | 0x00)
222#define ACTION_LMOD_KEY(mod, key) ACTION(ACT_LMODS, MODS4(MOD_BIT(mod))<<8 | (key)) 222#define ACTION_LMOD_KEY(mod, key) ACTION(ACT_LMODS, MODS4(MOD_BIT(mod))<<8 | (key))
@@ -268,8 +268,9 @@ enum layer_vals_default {
268/* 268/*
269 * Set layer 269 * Set layer
270 */ 270 */
271/* set layer on press and set default on release */ 271/* set layer on press and none on release */
272#define ACTION_LAYER_SET(layer) ACTION_LAYER_SET_MOMENTARY(layer) 272#define ACTION_LAYER_SET(layer) ACTION_LAYER_SET_P(layer)
273/* set layer on press and set default on release (This is needed by legacy keymap support.) */
273#define ACTION_LAYER_SET_MOMENTARY(layer) ACTION(ACT_LAYER, (layer)<<8 | LAYER_MOMENTARY) 274#define ACTION_LAYER_SET_MOMENTARY(layer) ACTION(ACT_LAYER, (layer)<<8 | LAYER_MOMENTARY)
274/* set layer on press and none on release */ 275/* set layer on press and none on release */
275#define ACTION_LAYER_SET_TOGGLE(layer) ACTION_LAYER_SET_R(layer) 276#define ACTION_LAYER_SET_TOGGLE(layer) ACTION_LAYER_SET_R(layer)