fix: Proper behavior metadata for key repeat/toggle
This commit is contained in:
parent
3694ff85a0
commit
f7ebf24fce
2 changed files with 2 additions and 24 deletions
|
@ -19,27 +19,6 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
|
|||
|
||||
#if DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT)
|
||||
|
||||
#if IS_ENABLED(CONFIG_ZMK_BEHAVIOR_METADATA)
|
||||
|
||||
static const struct behavior_parameter_value_metadata param_values[] = {
|
||||
{
|
||||
.display_name = "Key",
|
||||
.type = BEHAVIOR_PARAMETER_VALUE_TYPE_HID_USAGE,
|
||||
},
|
||||
};
|
||||
|
||||
static const struct behavior_parameter_metadata_set param_metadata_set[] = {{
|
||||
.param1_values = param_values,
|
||||
.param1_values_len = ARRAY_SIZE(param_values),
|
||||
}};
|
||||
|
||||
static const struct behavior_parameter_metadata metadata = {
|
||||
.sets_len = ARRAY_SIZE(param_metadata_set),
|
||||
.sets = param_metadata_set,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
struct behavior_key_repeat_config {
|
||||
uint8_t index;
|
||||
uint8_t usage_pages_count;
|
||||
|
@ -89,7 +68,7 @@ static const struct behavior_driver_api behavior_key_repeat_driver_api = {
|
|||
.binding_pressed = on_key_repeat_binding_pressed,
|
||||
.binding_released = on_key_repeat_binding_released,
|
||||
#if IS_ENABLED(CONFIG_ZMK_BEHAVIOR_METADATA)
|
||||
.parameter_metadata = &metadata,
|
||||
.get_parameter_metadata = zmk_behavior_get_empty_param_metadata,
|
||||
#endif // IS_ENABLED(CONFIG_ZMK_BEHAVIOR_METADATA)
|
||||
};
|
||||
|
||||
|
|
|
@ -36,8 +36,7 @@ static int on_keymap_binding_released(struct zmk_behavior_binding *binding,
|
|||
static const struct behavior_parameter_value_metadata param_values[] = {
|
||||
{
|
||||
.display_name = "Key",
|
||||
.type = BEHAVIOR_PARAMETER_VALUE_TYPE_STANDARD,
|
||||
.standard = BEHAVIOR_PARAMETER_STANDARD_DOMAIN_HID_USAGE,
|
||||
.type = BEHAVIOR_PARAMETER_VALUE_TYPE_HID_USAGE,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue