Make combos invoke behaviors with locality
Currently the source is hardcoded to central for source local behaviors
This commit is contained in:
parent
950c2d48d7
commit
b19d3d2cbd
1 changed files with 4 additions and 2 deletions
|
@ -291,21 +291,23 @@ static int release_pressed_keys() {
|
||||||
static inline int press_combo_behavior(struct combo_cfg *combo, int32_t timestamp) {
|
static inline int press_combo_behavior(struct combo_cfg *combo, int32_t timestamp) {
|
||||||
struct zmk_behavior_binding_event event = {
|
struct zmk_behavior_binding_event event = {
|
||||||
.position = combo->virtual_key_position,
|
.position = combo->virtual_key_position,
|
||||||
|
.source = ZMK_POSITION_STATE_CHANGE_SOURCE_LOCAL,
|
||||||
.timestamp = timestamp,
|
.timestamp = timestamp,
|
||||||
};
|
};
|
||||||
|
|
||||||
last_combo_timestamp = timestamp;
|
last_combo_timestamp = timestamp;
|
||||||
|
|
||||||
return behavior_keymap_binding_pressed(&combo->behavior, event);
|
return zmk_invoke_behavior_binding(&combo->behavior, event, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int release_combo_behavior(struct combo_cfg *combo, int32_t timestamp) {
|
static inline int release_combo_behavior(struct combo_cfg *combo, int32_t timestamp) {
|
||||||
struct zmk_behavior_binding_event event = {
|
struct zmk_behavior_binding_event event = {
|
||||||
.position = combo->virtual_key_position,
|
.position = combo->virtual_key_position,
|
||||||
|
.source = ZMK_POSITION_STATE_CHANGE_SOURCE_LOCAL,
|
||||||
.timestamp = timestamp,
|
.timestamp = timestamp,
|
||||||
};
|
};
|
||||||
|
|
||||||
return behavior_keymap_binding_released(&combo->behavior, event);
|
return zmk_invoke_behavior_binding(&combo->behavior, event, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void move_pressed_keys_to_active_combo(struct active_combo *active_combo) {
|
static void move_pressed_keys_to_active_combo(struct active_combo *active_combo) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue