Exemplo n.º 1
0
        /// <summary>
        /// Used to retrieve data from joystick. If JoyInfoEx structure is not properly initialized,
        /// this method will do it for you.
        /// </summary>
        /// <param name="joyId"></param>
        /// <param name="infox"></param>
        /// <returns></returns>
        public static MMResult JoyGetPosX(int joyId, ref JoyInfoEx infox)
        {
            if (infox.dwSize == 0)
            {
                infox.dwSize = Marshal.SizeOf(infox);
            }

            if (infox.dwFlags == 0)
            {
                infox.dwSize = (int)JoyFlags.ReturnAll;
            }

            return((MMResult)joyGetPosEx(joyId, ref infox));
        }
Exemplo n.º 2
0
 private static extern int joyGetPosEx(int uJoyID, ref JoyInfoEx pji);