To use the advanced features of vJoySerialFeeder, some more details about the inner workings of a Mapping is needed. Every Mapping has the following two properties:
-
Input- This is a unsigned 16-bit integer value (0 - 65535). NormallyInputis the last value read from the serial port, for the selected channel. The actual value range depends on the serial protocol.
Channels are numbered from 1 onwards. If you need a Mapping that should not receive data from the serial port, set its channel to 0. This is useful if you intend to set theInputwith Scripting or Interaction. -
Output- after the mapping gets itsInput, it is transformed to anOutputvalue. The output values depend on the mapping type:- Axis Mapping - the output value is a floating point number in the range [0.0; 1.0].
- Button Mapping - the output value is 0.0 for depressed button and 1.0 for pressed.
- Bitmapped Button Mapping - unmapped bits are the same as the corresponding
bits in the
Inputvalue. For mapped bits the bit in theOutputrepresents the state of the virtual button that the bit commands -1if pressed and0is depressed. In many cases theOutputbit will be the same as the correspondingInputbit, but whenInvertorTriggerare used they may differ.Note: When using in Scripting or Interaction the
Outputvalue of a Bitmapped Button Mapping might be read as floating point number. Simply cast it to integer before performing bitwise operations on it.
Outputis always calculated automatically anytimeInputis modified. On the other hand ifOutputis modified,Inputis unaffected (that is, there is no inverse function to calculate theInputfrom theOutput).In normal usage the
Outputvalue is fed to the virtual joystick's axes or buttons. If theOutputis intended to be used solely for Scripting and Interaction you can set the axis toNonefor Axis Mapping or the button to0for Button Mappings.Note: Mappings are processed in the order they appear on the screen - from top to bottom. For example, if by mistake you have Axis Mapping 1 which outputs to axis X and then later Axis Mapping 5 which also outputs to axis X, that latter mapping will overwrite the output of Mapping 1. The last mapping to set a given axis or button will be the effective one.