mouse_scroll - bradyakent/CC-Tweaked GitHub Wiki
This event is fired when a mousewheel is scrolled in the terminal.
Return values
string
: The event name.number
: The direction of the scroll. (-1 = up, 1 = down)number
: The X-coordinate of the scroll (in screen-characters).number
: The Y-coordinate of the scroll (in screen-characters).
Other notes
- This event is only available on Advanced systems, as only Advanced systems have mouse support.
Example
Prints the direction and the coordinates of every mouse scroll:
while true do
local event, scrollDirection, x, y = os.pullEvent("mouse_scroll")
print("mouse_scroll: " .. tostring(scrollDirection) .. ", " ..
"X: " .. tostring(x) .. ", " ..
"Y: " .. tostring(y))
end