Game Development Community

Mouse Scroll Wheel Commands?

by USC Cinema Television 9 · in Technical Issues · 06/02/2009 (12:46 pm) · 1 replies

Hello friendly torquers,

I'm currently using torque game builder and I cannot for the life of me find the documentation on mouse scroll wheel commands. I'm totally comfortable with OnMouseUp/Down type events, and I know exactly what I want to code for the scroll wheel, but I just can't find the damn console command (ie something like OnMouseScrollUp).

Anyone know what the scroll wheel commands are? Or, anyone know a workaround to get the scroll wheel input from the mouse?

Thanks!

-Sean

#1
06/02/2009 (1:25 pm)
I don't use TGB so have no clue if this would work for you, but in 3d land I can do this:
moveMap.bind(mouse, "zaxis", someFunction);

function someFunction(%val)
{
    if (%val < 0)
        commandToServer('doNextWheelAction', "next");
    else if (%val > 0)
        commandToServer('doPrevWheelAction', "prev");
}

Basically you have some function bound to the mouse wheel (zaxis). Inside of that function you check the value sent from the wheel when it is activated. A positive "value" is one scroll direction, and a negative value is the other direction. It's here that you will take the result and split it into two separate actions (functions).