About mouse wheel or mouseZ()

BlitzMax Forums/BlitzMax Beginners Area/About mouse wheel or mouseZ()

Takis76(Posted 2014) [#1]
Hello,
I would like to find some way to reset the mousez() function to 0 when I am using my mouse wheel for once.

When I am rotating my mouse wheel up or down then mousez() function returns -1 , -2 , -3 when I rotate my mouse wheel up and +1, +2, +3 when I am rotating my mouse wheel down.

Is it possible when I am rotating the mouse wheel at one then after I take the mousez() variable and then reset the mouse wheel to 0 again. So every time I rotate the mouse wheel I will have only -1 and +1 value return from mousez() function.

I use this wheel function to rotate my camera in my level editor.

Thank you very much. :)


Takis76(Posted 2014) [#2]
I think I found it , FlushMouse() function resets my mousez() value.
Thank you :)


Derron(Posted 2014) [#3]
You can use FlushMouse() ... or you just store the last read zValue.

At the end of each update: lastMouseZ = MouseZ().

Now you just need to check the difference of both. 0 means no change, the other values... I think you got it.
Positive Aspect: you know the absolute movement from "0" which could somehow be of use in odd situations ("Scroll thousand times downwards achievement" :D).

bye
Ron