Added in mousewheel as part of this.

This commit is contained in:
Adam Harrison
2021-11-14 15:41:28 -05:00
parent c04dc648de
commit 7a3e8ed86a
3 changed files with 10 additions and 12 deletions
+5
View File
@@ -85,6 +85,11 @@ function keymap.on_key_pressed(k, ...)
return false
end
function keymap.on_mouse_wheel(delta, ...)
return not keymap.on_key_pressed("wheel" .. (delta > 0 and "up" or "down"), delta, ...)
and keymap.on_key_pressed("wheel", delta, ...)
end
local click_prefixes = { "", "d", "t" }
function keymap.on_mouse_pressed(button, x, y, clicks)
return keymap.on_key_pressed(click_prefixes[((clicks - 1) % 3) + 1] .. button:sub(1,1) .. "click", x, y, clicks)