Detecting mouse wheel using python

I looked at the docs, but its outdated.

How do I get python to detect the mouse wheel scroll up, or down, then execute an If statment?

Well, if I am not mistaken, just attach a couple of mouse sensors to the script, one with “Wheel Up” and othe other with “Wheel down” and make the script check if those sensors were activated… just like u would do with any other kind of sensor

Yup, thanks.

How would I make a value like, the Lens on the camera go up by 1 each time i scroll up?

Hmm… you could make an IPO for the camera’s lens value, and then you could use a python script (or some simple logic bricks) to zoom in or out, by changing the frame of the play ipo actuator (use expression).

on the other hand, a much “cooler” way (don’t know about the impact on the system though) would be to make the python script that could directly access the camera’s lens value… right now I’m a little too lazy as to check that for you, but that’s another idea.

Ah, i figured it out by looking an example file. thanks