controller

 Function Name  Parameter  Return  Explain
 isValid None boolean Indicates whether controller is valid
 getDevice None device Retrieves the corresponding device
 getMatrix None matrix Retrieves the matrix of controller
 getPosition None vec Retrieves the position of controller ( world space )
 getFront None vec Retrieves the front direction
 getRight None vec Retrieves the right direction
 getUp None vec Retrieves the up direction
 getDeviceID None number Retrieves the device id of controller
 isButtonPressed number buttonId boolean Indicates whether assigned button is pressed, see Remark2.
 isButtonTouched number buttonId boolean Indicates whether assigned button is touched
 getAxis number buttonId number x,y Retrieves the axis offset for assigned button, the range of returned x,y is:
( -1 ~ 1 ) for joysticks and track pads;
( 0 ~ 1 ) for triggers (y always 0), 0 means fully released.
 triggerHapticPulse number duration,
[ buttonId ]
None Trigger a single haptic pulse
 setPulseInterval number interval number oldValue Set pulse interval and return previous value;
triggerHapticPulse function is invalid if be called within Pulse Interval since last call.

Remark: There are two predefined controller instances: ControllerA, ControllerB, you also can new controller instance like:
                  ControllerC = winds3dvr_new_controller(3)
                  if ControllerC.isValid() then print( ControllerC.getDeviceID() ) end 
 


Remark2:  Button ID List:
    ControllerButtonID.System,
    ControllerButtonID.ApplicationMenu,
    ControllerButtonID.Grip,
    ControllerButtonID.Touchpad,
    ControllerButtonID.Trigger,

    ControllerButtonID.Axis0,    -- same as Touchpad
    ControllerButtonID.Axis1,    -- same as Trigger
    ControllerButtonID.Axis2,
    ControllerButtonID.Axis3,
    ControllerButtonID.Axis4,    

    ControllerButtonID.Max,     -- the maximum value of button id ( id range is 0 ~ Max )