input.IsMouseDown(MOUSE_WHEEL_DOWN) not working?

Trying to change the CalcView based on MOUSE_WHEEL_DOWN/MOUSE_WHEEL_UP but its not working. Am I using IsMouseDown in the wrong hook? In the wiki it doesn’t say if it needs to be called on a certain hook.


-- cl_init.lua
hook.Add("Think", "PlayerInput", function()
    if input.IsMouseDown(MOUSE_WHEEL_DOWN) then
        print("up")
    elseif input.IsMouseDown(MOUSE_WHEEL_UP) then
        print("down")
    end
end)

Use CreateMove. Examples:

_cmd, used in CreateMove allows the use of GetMouseWheel:

Simple example of one of many ways to “LERP” roll back to 0:
https://dl.dropboxusercontent.com/u/26074909/tutoring/camera/camera_roll_system.lua.html

Example of my thirdperson free-camera: https://dl.dropboxusercontent.com/u/26074909/tutoring/camera/cl_thirdperson_freecam.lua.html

The free camera is more in-line with what can be done… Except in the example it checks for ALT + SCROLL. The GetFlag / SetFlag is part of my networking / data system, it’ll be released soon. The third arg just means it is private ( although when the client sets a value, it isn’t networked, so it could be in the “public” pool for the entity…

I cleaned up the free-cam code to bring it up to my coding-standards as it was old code; improved readability hopefully… As always, remove .html to view the .lua if you copy/paste anything as html doesn’t copy well…

Thank you :smiley: That is awesome!