Detecting Mouse wheel scroll

As in title, I can’t seem to detect the mouse wheel scrolling. In a panel’s think function i have put:



if input.IsMouseDown(MOUSE_WHEEL_DOWN) then
print("test")
end

And nothing prints.

I’ve tried this before and i didn’t get anything from it either. There are other ways of detecting the scroll wheel but it depends on what you’re trying to make. So, please do tell me.

its because you are trying to detect when the scroll wheel button (mb3) is pressed.
use this function instead:

CUserCmd:GetMouseWheel

I tried that, the code didn’t know what CUserCmd was.

Try using

CUserCmd is passed to the movement hooks such as

GM/CreateMove or

GM/StartCommand which means you can’t just access it from anywhere.