feat: allow runtime changing of the gutter mode

This commit is contained in:
CJ van den Berg 2024-04-10 22:12:19 +02:00
parent f61701150d
commit 9aea1f54f5
7 changed files with 37 additions and 1 deletions

View file

@ -89,6 +89,8 @@ pub fn receive(self: *Self, _: tp.pid_ref, m: tp.message) error{Exit}!bool {
if (try m.match(.{ "B", nc.event_type.PRESS, nc.key.BUTTON1, tp.any, tp.any, tp.extract(&y), tp.any, tp.extract(&ypx) }))
return self.primary_click(y);
if (try m.match(.{ "B", nc.event_type.PRESS, nc.key.BUTTON3, tp.any, tp.any, tp.extract(&y), tp.any, tp.extract(&ypx) }))
return self.secondary_click();
if (try m.match(.{ "D", nc.event_type.PRESS, nc.key.BUTTON1, tp.any, tp.any, tp.extract(&y), tp.any, tp.extract(&ypx) }))
return self.primary_drag(y);
if (try m.match(.{ "B", nc.event_type.PRESS, nc.key.BUTTON4, tp.more }))
@ -232,6 +234,11 @@ fn primary_drag(_: *const Self, y: i32) error{Exit}!bool {
return true;
}
fn secondary_click(_: *Self) error{Exit}!bool {
try command.executeName("gutter_mode_next", .{});
return true;
}
fn mouse_click_button4(_: *Self) error{Exit}!bool {
try command.executeName("scroll_up_pageup", .{});
return true;