Window:onHover(x, y, buttons)event
This event is fired when the user moves the mouse pointer over the window.
Parameters
x
The horizontal position of the mouse in the window's client area.
y
The vertical position of the mouse in the window's client area.
buttons
A table which fields indicates if mouse buttons or special keys have been pressed during the move :
"left":trueif left mouse button is pressed,falseotherwise"right":trueif right mouse button is pressed,falseotherwise"middle":trueif middle mouse button is pressed,falseotherwise"control":trueif the CONTROL key is pressed,falseotherwise"shift":trueif the SHIFT mouse button is pressed,falseotherwise
Return value
The event returns no value.Example
--! luart-extensions
import ui
-- create a window
local win = ui.Window("Window:onHover() sample", 320, 200)
local label = ui.Label(win, "Move the mouse on this text!", 110, 75)
-- set a onHover() event : display a status bar with the mouse position when the user has clicked
function win:onHover(x,y buttons)
win:status("Mouse position : "..x..", "..y)
end
win:show()
while win.visible do
ui.update()
end