Moved commands out to the outer event loop.

This commit is contained in:
Adam Harrison
2021-11-14 15:41:28 -05:00
parent 6f53ee1b69
commit ce2ec9f442
6 changed files with 21 additions and 7 deletions
+1 -3
View File
@@ -3,7 +3,7 @@ local config = require "core.config"
local style = require "core.style"
local common = require "core.common"
local Object = require "core.object"
local keymap = require "core.keymap"
local View = Object:extend()
@@ -76,13 +76,11 @@ 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(click_prefixes[((clicks - 1) % 3) + 1] .. button:sub(1,1) .. "click", x, y, clicks)
end