Merge template-live-editor
This commit is contained in:
commit
4241270cf2
1
0001-on
1
0001-on
|
@ -11,6 +11,7 @@ on = {
|
||||||
-- on.focus
|
-- on.focus
|
||||||
-- on.mouse_press (see love.mousepressed)
|
-- on.mouse_press (see love.mousepressed)
|
||||||
-- on.mouse_release (see love.mousereleased)
|
-- on.mouse_release (see love.mousereleased)
|
||||||
|
-- on.mouse_move (see love.mousemoved)
|
||||||
-- on.mouse_wheel_move (see love.wheelmoved)
|
-- on.mouse_wheel_move (see love.wheelmoved)
|
||||||
-- on.keychord_press (see keychord.lua in this repo)
|
-- on.keychord_press (see keychord.lua in this repo)
|
||||||
-- on.text_input (see love.textinput)
|
-- on.text_input (see love.textinput)
|
||||||
|
|
4
main.lua
4
main.lua
|
@ -190,6 +190,10 @@ function App.mousereleased(x,y, mouse_button)
|
||||||
if on.mouse_release then on.mouse_release(x,y, mouse_button) end
|
if on.mouse_release then on.mouse_release(x,y, mouse_button) end
|
||||||
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)
|
function App.wheelmoved(dx,dy)
|
||||||
if Mode == 'error' then return end
|
if Mode == 'error' then return end
|
||||||
Cursor_time = 0 -- ensure cursor is visible immediately after it moves
|
Cursor_time = 0 -- ensure cursor is visible immediately after it moves
|
||||||
|
|
|
@ -76,6 +76,12 @@ two categories.
|
||||||
button. Provides the same arguments as `on.mouse_press()` above.
|
button. Provides the same arguments as `on.mouse_press()` above.
|
||||||
(Based on [LÖVE](https://love2d.org/wiki/love.mousereleased).)
|
(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
|
* `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
|
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
|
wheel is being scrolled. Positive values for `dx` indicate movement to the
|
||||||
|
|
Loading…
Reference in New Issue