Modify configuration to detect drag start using fast touchup-touchdown

This commit is contained in:
Vftdan 2024-08-19 21:41:28 +02:00
parent b64b7ebc39
commit 851788d562
1 changed files with 52 additions and 19 deletions

View File

@ -4,7 +4,7 @@ constants = {
}; };
enums = { enums = {
namespaces: ["clickpad"]; namespaces: ["clickpad", "window_terminator"];
}; };
predicates = { predicates = {
@ -101,10 +101,6 @@ predicates = {
} }
); );
}; };
quadtap_held = {
type = "accept";
inverted = 1;
};
bypass = { bypass = {
type = "or"; type = "or";
args = ["syn_event", "misc_timestamp"]; args = ["syn_event", "misc_timestamp"];
@ -119,6 +115,19 @@ predicates = {
min = 1; min = 1;
max = 1; max = 1;
}; };
is_window_terminator = {
type = "code_ns";
min = "namespaces.window_terminator";
max = "namespaces.window_terminator";
};
inside_drag_window = {
type = "accept";
inverted = 1;
};
drag_held = {
type = "accept";
inverted = 1;
};
}; };
nodes = { nodes = {
@ -173,14 +182,6 @@ nodes = {
properties = ["input_property.POINTER", "input_property.BUTTONPAD"]; properties = ["input_property.POINTER", "input_property.BUTTONPAD"];
}; };
}; };
update_quadtap_held = {
type = "modify_predicate";
options = {
target = "quadtap_held";
uninvert_on = "payload_one";
invert_on = "payload_zero";
};
};
differentiate_x = { differentiate_x = {
type = "differentiate"; type = "differentiate";
}; };
@ -194,10 +195,10 @@ nodes = {
// Preserve minor, because relative_axis.X = absolute_axis.X, relative_axis.Y = absolute_axis.Y // Preserve minor, because relative_axis.X = absolute_axis.X, relative_axis.Y = absolute_axis.Y
}; };
}; };
while_quadtap_held = { while_drag_held = {
type = "router"; type = "router";
options = { options = {
predicates = ["quadtap_held"]; predicates = ["drag_held"];
}; };
}; };
sensitivity_x = { sensitivity_x = {
@ -216,6 +217,32 @@ nodes = {
amortize_rounding_error = "true"; amortize_rounding_error = "true";
}; };
}; };
drag_start_window = {
type = "window";
options = {
max_length = 2;
max_milliseconds = 500;
terminator = {
namespace = "namespaces.window_terminator";
};
};
};
update_inside_drag_window = {
type = "modify_predicate";
options = {
target = "inside_drag_window";
uninvert_on = {type: "and"; args: ["is_evdev", "payload_zero"]};
invert_on = "is_window_terminator";
};
};
update_drag_held = {
type = "modify_predicate";
options = {
target = "drag_held";
uninvert_on = {type: "and"; args: ["inside_drag_window", "is_evdev", "payload_one"]};
invert_on = {type: "and"; args: ["is_evdev", "payload_zero"]};
};
};
}; };
channels = ({ channels = ({
@ -253,12 +280,12 @@ channels = ({
to: ("sensitivity_y", 0); to: ("sensitivity_y", 0);
}, { }, {
from: ("sensitivity_x", 0); from: ("sensitivity_x", 0);
to: ("while_quadtap_held", 0); to: ("while_drag_held", 0);
}, { }, {
from: ("sensitivity_y", 0); from: ("sensitivity_y", 0);
to: ("while_quadtap_held", 1); to: ("while_drag_held", 1);
}, { }, {
from: ("while_quadtap_held", 0); from: ("while_drag_held", 0);
to: ("morph_rel", 0); to: ("morph_rel", 0);
}, { }, {
from: ("morph_rel", 0); from: ("morph_rel", 0);
@ -268,7 +295,13 @@ channels = ({
to: ("virtual_out", 0); to: ("virtual_out", 0);
}, { }, {
from: ("quadtap_subst_seq", 4); from: ("quadtap_subst_seq", 4);
to: ("update_quadtap_held", 0); to: ("drag_start_window", 0);
}, {
from: ("drag_start_window", 0);
to: ("update_inside_drag_window", 0);
}, {
from: ("drag_start_window", 1);
to: ("update_drag_held", 0);
}); });
// vim: ft=libconfig // vim: ft=libconfig