Added in double, and triple clicking.

This commit is contained in:
Adam Harrison
2021-11-14 15:41:28 -05:00
parent 4a0d390a7c
commit 6f53ee1b69
4 changed files with 14 additions and 35 deletions
+2 -1
View File
@@ -76,12 +76,13 @@ function View:scrollbar_overlaps_point(x, y)
end
local click_prefixes = { "", "d", "t" }
function View:on_mouse_pressed(button, x, y, clicks)
if self:scrollbar_overlaps_point(x, y) then
self.dragging_scrollbar = true
return true
end
return keymap.on_key_pressed(button:sub(1,1) .. "click", x, y, clicks)
return keymap.on_key_pressed(click_prefixes[((clicks - 1) % 3) + 1] .. button:sub(1,1) .. "click", x, y, clicks)
end