public static int HALGetJoystickAxes(byte joystickNum, ref HALJoystickAxes axes) { axes.axes = new HALJoystickAxesArray(); var joyData = halData["joysticks"][joystickNum]["axes"]; for (short i = 0; i < joyData.Length; i++) { int tmp = 0; if (joyData[i] < 0) tmp = (int)(joyData[i] * 128); else tmp = (int)(joyData[i] * 127); axes.axes[i] = (short)tmp; } axes.count = (ushort)joyData.Length; return 0; }
public static extern int HALGetJoystickAxes(byte joystickNum, ref HALJoystickAxes axes);