Merge luaML.love

This commit is contained in:
Kartik K. Agaram 2023-12-26 09:36:41 -08:00
commit 5e07848bb6
3 changed files with 11 additions and 0 deletions

View File

@ -18,6 +18,7 @@ on = {
-- on.focus
-- on.mouse_press (see love.mousepressed)
-- on.mouse_release (see love.mousereleased)
-- on.mouse_move (see love.mousemoved)
-- on.mouse_wheel_move (see love.wheelmoved)
-- on.keychord_press (see keychord.lua in this repo)
-- on.text_input (see love.textinput)

View File

@ -216,6 +216,10 @@ function App.mousereleased(x,y, mouse_button)
if on.mouse_release then on.mouse_release(x,y, mouse_button) end
end
function App.mousemoved(x,y, dx,dy, istouch)
if on.mouse_move then on.mouse_move(x,y, dx,dy, istouch) end
end
function App.wheelmoved(dx,dy)
if Mode == 'error' then return end
Cursor_time = 0 -- ensure cursor is visible immediately after it moves

View File

@ -85,6 +85,12 @@ two categories.
button. Provides the same arguments as `on.mouse_press()` above.
(Based on [LÖVE](https://love2d.org/wiki/love.mousereleased).)
* `on.mouse_move(x,y, dx,dy, istouch)` -- called when you move the mouse.
Provides in `x` and `y` the point on the screen at which the click occurred
and in `dx` and `dy` the amount moved since the previous call of
`mouse_move`.
(Based on [LÖVE](https://love2d.org/wiki/love.mousemoved).)
* `on.mouse_wheel_move(dx,dy)` -- called when you use the scroll wheel on a
mouse that has it. Provides in `dx` and `dy` an indication of how fast the
wheel is being scrolled. Positive values for `dx` indicate movement to the