Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix up layer metadata, move to layer IDs. #2364

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/include/drivers/behavior.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct behavior_parameter_value_metadata {
BEHAVIOR_PARAMETER_VALUE_TYPE_VALUE = 1,
BEHAVIOR_PARAMETER_VALUE_TYPE_RANGE = 2,
BEHAVIOR_PARAMETER_VALUE_TYPE_HID_USAGE = 3,
BEHAVIOR_PARAMETER_VALUE_TYPE_LAYER_INDEX = 4,
BEHAVIOR_PARAMETER_VALUE_TYPE_LAYER_ID = 4,
} type;
};

Expand Down
2 changes: 1 addition & 1 deletion app/src/behavior.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static int check_param_matches_value(const struct behavior_parameter_value_metad
}

break;
case BEHAVIOR_PARAMETER_VALUE_TYPE_LAYER_INDEX:
case BEHAVIOR_PARAMETER_VALUE_TYPE_LAYER_ID:
if (param >= 0 && param < ZMK_KEYMAP_LEN) {
return PARAM_MATCHES;
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/behaviors/behavior_momentary_layer.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
static const struct behavior_parameter_value_metadata param_values[] = {
{
.display_name = "Layer",
.type = BEHAVIOR_PARAMETER_VALUE_TYPE_LAYER_INDEX,
.type = BEHAVIOR_PARAMETER_VALUE_TYPE_LAYER_ID,
},
};

Expand Down
3 changes: 1 addition & 2 deletions app/src/behaviors/behavior_to_layer.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ static int to_keymap_binding_released(struct zmk_behavior_binding *binding,
static const struct behavior_parameter_value_metadata param_values[] = {
{
.display_name = "Layer",
.type = BEHAVIOR_PARAMETER_VALUE_TYPE_STANDARD,
.standard = BEHAVIOR_PARAMETER_STANDARD_DOMAIN_LAYER_INDEX,
.type = BEHAVIOR_PARAMETER_VALUE_TYPE_LAYER_ID,
},
};

Expand Down
3 changes: 1 addition & 2 deletions app/src/behaviors/behavior_toggle_layer.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ static int tog_keymap_binding_released(struct zmk_behavior_binding *binding,
static const struct behavior_parameter_value_metadata param_values[] = {
{
.display_name = "Layer",
.type = BEHAVIOR_PARAMETER_VALUE_TYPE_STANDARD,
.standard = BEHAVIOR_PARAMETER_STANDARD_DOMAIN_LAYER_INDEX,
.type = BEHAVIOR_PARAMETER_VALUE_TYPE_LAYER_ID,
},
};

Expand Down