I'm struggling with this big time as well.
I'm using vJoy just to emulate a joystick and, although the axis aren't mapped properly, you can work out pretty easily which axis you are varying.
I must have been through all the forums and tried every single combination of joystick.xml file & nasal snippet and got it to click through 30 degrees at a time. Before I actually start posting code snippets let's just step back and ask "how do you associate a joystick axis with a control in the joystick control GUI? For example how would I associate a joystick axis with something that isn't in the GUI like head roll. There is only "view(horizontal)" and "view(vertical)". How do you put or find "view(roll)" in the GUI for example? Or "X" offset?
setprop("/sim/current-view/x-offset-m", getprop("/sim/view/config/x-offset-m"));
Please answer this question in general - not specifically.
Example snippet copied from
viewtopic.php?f=36&t=16052 (head tracking is the ultimate objective)
<name>vJoy Device</name>
<axis n="0">
<desc>6DOFYaw</desc>
<binding>
<command>property-scale</command>
<property>/sim/current-view/goal-heading-offset-deg</property>
<factor type="double">180.0</factor>
</binding>
</axis>
I stress I'm trying to bind an axis to a view in a continuous way, NOT a button or key.