Quote:
Originally Posted by Alan Anderson
There does seem to be a way in the basic Joystick class to remap axes to the X/Y/Z/Throttle functions, but I don't use C++ enough to have tried it.
|
I don't believe you can re-map the default value of the throttle, which is set to axis 3 (0-based values). You can define the number of axes and buttons, but not which axis is which.
Quote:
|
What do you need the source code for? All you'd be doing is inheriting from and extending an existing class. You wouldn't be reimplementing any of the lower-level code.
|
Last I "wrote" a custom class, I took gyro.cpp/.h source, renamed the files gyro48.cpp/.h, and changed the code to permit adjustment of the sensitivity parameter, which was previously not exposed to the end user. Seemed easier and more likely to work to adapt existing code than figure out all the BS of inheritance and writing my own classes and worrying about missing some inane piece of required syntax that would break the code or worse, compile it and cause unintended results I am not equipped to debug. If this somehow violates some code of appropriateness seasoned programmers adhere to, well, I'm not a seasoned programmer, nor do I aspire to be, so I guess it doesn't matter.
In the case of the joystick class, I'd simply change the default throttle axis from 3 to 2. Bing bang zoom. But with GetZ or GetRawAxis in the default class, I don't need to do that, so I won't even bother.