widget only
This event is only available when the
ui module is loaded before capture and Camera is used as a widget.Camera:onHover(x, y, buttons)event
This event is fired when the user moves the mouse pointer over the Camera widget.
Parameters
x
The horizontal position of the mouse in the Camera widget area (zero means the left border).
y
The vertical position of the mouse in the Camera widget area (zero means the top border).
buttons
A table indicating which mouse buttons or special keys are pressed:
"left": true if the left mouse button is pressed"right": true if the right mouse button is pressed"middle": true if the middle mouse button is pressed"control": true if the CONTROL key is pressed"shift": true if the SHIFT key is pressedReturn value
The event returns no value.Example
--! luart-extensions
import ui, capture
local win = ui.Window("Camera:onHover() sample", "fixed", 640, 520)
local cam = ui.Camera(win, 10, 10, 620, 460)
function cam:onHover(x, y, buttons)
win:status("Mouse at "..x..", "..y)
end
await win:showasync()