diff options
| author | ne_mene <[email protected]> | 2026-03-12 19:56:53 +0100 |
|---|---|---|
| committer | ne_mene <[email protected]> | 2026-03-12 19:56:53 +0100 |
| commit | 5179c0c029487ea0107c9f9a7d879cc44b51e924 (patch) | |
| tree | 9608bc7497490c74ad5e3711e5d122f3e2f070a7 /src/input.lua | |
| parent | d4f1856d357de241320dd6cbf66972c74784c309 (diff) | |
| parent | 4828c80a92a40067d8f58922c38c4dbeeafc8403 (diff) | |
Merge remote-tracking branch 'refs/remotes/origin/main'
thanks
Diffstat (limited to 'src/input.lua')
| -rw-r--r-- | src/input.lua | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/input.lua b/src/input.lua index 8029be2..c5c9012 100644 --- a/src/input.lua +++ b/src/input.lua @@ -55,8 +55,26 @@ function love.keypressed(key) keyEvents[key] = true end -function love.mousepressed(x, y, btn) +function love.mousepressed(_, _, btn) mouseEvents[btn] = true + local sx, sy = get_mouse_pos() + im.mousepressed(sx, sy, btn) +end + +function love.mousereleased(_, _, btn) + local sx, sy = get_mouse_pos() + im.mousereleased(sx, sy, btn) +end + +function love.mousemoved(_, _, dx, dy) + local sx, sy = get_mouse_pos() + local scrw, scrh = love.graphics.getDimensions() + local rdx, rdy = dx / scrw * SCR_WIDTH, dy / scrh * SCR_HEIGHT + im.mousemoved(sx, sy, rdx, rdy) +end + +function love.wheelmoved(...) + im.wheelmoved(...) end function get_mouse_pos() |
