onClientMouseWheel | Multi Theft Auto: Wiki Skip to content

onClientMouseWheel

Client-side
Server-side
Shared

This event is triggered each time the user scrolls his mouse scroll on top of a GUI element.

Parameters

int upOrDown
  • upOrDown: An integer representing whether the scroll was scrolled up or down. This can be either 1 (mouse was scrolled up) or -1 (mouse was scrolled down).

Source

element: The source of this event is the GUI element on which the mouse scroll was scrolled.

Code Examples

client

The example tells player in which direction wheel was scrolled (UP or DOWN) and also the type of the GUI element that wheel was scrolled on.

addEventHandler( "onClientMouseWheel", root,
function ( up_down )
outputChatBox( "You scrolled mouse wheel " .. ( up_down == 1 and "UP" or "DOWN" ) .. " on " .. getElementType( source ) )
end
)