vJoyInterfaceWrap.vJoy.SetAxis C# (CSharp) Method

SetAxis() public method

public SetAxis ( Int32 Value, UInt32 rID, HID_USAGES Axis ) : bool
Value Int32
rID UInt32
Axis HID_USAGES
return bool
        public bool SetAxis(Int32 Value, UInt32 rID, HID_USAGES Axis) { return _SetAxis(Value, rID, Axis); }
        public bool SetBtn(bool Value, UInt32 rID, uint nBtn) { return _SetBtn( Value, rID, (Byte)nBtn); }

Usage Example

Exemplo n.º 1
0
        //set joystick axis, private class to be called
        private bool convertAndSetJoystickAxis()
        {
            //no motion in joystick is X = 16383, Y = 16383
            // y  = 16384x + 16384, calculation is done in this method
            int xScaled = (int)Math.Floor(16384 * xRaw) + 16384;
            int yScaled = (int)Math.Floor(16384 * yRaw) + 16384;

            //Console.WriteLine("raw value in convert function X: " + xRaw + " Y: " + yRaw);
            joystick.SetAxis(xScaled, id, HID_USAGES.HID_USAGE_X);
            joystick.SetAxis(yScaled, id, HID_USAGES.HID_USAGE_Y);
            // return "Values set as X: " + xScaled + " Y: " + yScaled;
            return(true);
        }
All Usage Examples Of vJoyInterfaceWrap.vJoy::SetAxis