Skip to main content

GetMouseScroll

This function was added in DSL 5

Description

Returns the scroll wheel value for the mouse.

function GetMouseScroll() --[[ ... ]] end

Parameters

None.

Return Values

  • scroll: number - The scroll wheel value. Positive values indicate scrolling up, while negative values indicate scrolling down. A value of 0 means no scrolling has occurred since the last call to this function.

Example

local scroll = GetMouseScroll()
if scroll > 0 then
print("Scrolled up: " .. scroll)
elseif scroll < 0 then
print("Scrolled down: " .. scroll)
else
print("No scrolling has occurred.")
end