wire up mouse move handler
This commit is contained in:
parent
1095761585
commit
fbf99b040d
1
0001-on
1
0001-on
|
@ -12,6 +12,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)
|
||||
|
|
4
main.lua
4
main.lua
|
@ -191,6 +191,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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue