georgefitz, on 14 January 2013 - 11:52 PM, said:
i have used pete's code for assigning the slider on my saitek 52 for zooming. However, I am getting too much zooming. How would I limit the zoom to say 5x down to 0.25x? Perhaps, someone could explain exactly what each of the aspects or elements of the axis code refers to.
What needs explaining? The only relevant part to scaling the input value to get values more suited to what you want are these:
*-0.01,+327
which simply says "multiply by -0.01" then "add 327". i.e. it changes the sign, making positive negative or vice versa, then divides by 100 (same as multiplying by .01 = 1/100th) before adding 327. You'd need to experiment really.
I'm not totally sure without experimenting myself, but I think the value for 5x needs to be 320 and 0.25x is 16, so you want the minimum axis value converting to 16 and the max to 320. If the values run from -16383 to +16383 you'd need something like:
*.0092779,+168
the first number being 304 / 32766 to get the full ranfe -16383 to +16383 to be -152 to +152, and the +168 adjusts this to +16 to +320, as required.
As before, you can reverse this is you wish by using *-.0092779,+168
Pete