Fix SET_DEFAULT_LAYER action and keymap of gh60
This commit is contained in:
parent
71bd9a72fb
commit
d193a6d2ef
@ -470,7 +470,7 @@ See `keyboard/hhkb/keymap.c` for sample.
|
|||||||
### 3. Layer
|
### 3. Layer
|
||||||
Layer is key-action map to assign action to every physical key. You can define multiple layers in keymap and make layers active out of keymap during operation at will.
|
Layer is key-action map to assign action to every physical key. You can define multiple layers in keymap and make layers active out of keymap during operation at will.
|
||||||
|
|
||||||
First layer is indexed by `0` which usually become **`default layer`** and active in initial state.
|
First layer is indexed by `0` which usually become `default layer` and active in initial state.
|
||||||
|
|
||||||
You can define **16 layers** at most in each keymaps[] and overlays[].
|
You can define **16 layers** at most in each keymaps[] and overlays[].
|
||||||
|
|
||||||
|
@ -384,21 +384,15 @@ static void process_action(keyrecord_t *record)
|
|||||||
/* Keymap Reset default layer */
|
/* Keymap Reset default layer */
|
||||||
case (OP_RESET | ON_PRESS):
|
case (OP_RESET | ON_PRESS):
|
||||||
if (event.pressed) {
|
if (event.pressed) {
|
||||||
overlay_clear();
|
|
||||||
keymap_clear();
|
|
||||||
default_layer_set(action.layer.val);
|
default_layer_set(action.layer.val);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case (OP_RESET | ON_RELEASE):
|
case (OP_RESET | ON_RELEASE):
|
||||||
if (!event.pressed) {
|
if (!event.pressed) {
|
||||||
overlay_clear();
|
|
||||||
keymap_clear();
|
|
||||||
default_layer_set(action.layer.val);
|
default_layer_set(action.layer.val);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case (OP_RESET | ON_BOTH):
|
case (OP_RESET | ON_BOTH):
|
||||||
overlay_clear();
|
|
||||||
keymap_clear();
|
|
||||||
default_layer_set(action.layer.val);
|
default_layer_set(action.layer.val);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user