// Utility public static void GetState(ref NpadState pOutValue, NpadId npadId, NpadStyle npadStyle) { NpadButton preButtons = pOutValue.buttons; switch (npadStyle) { case NpadStyle.FullKey: NpadFullKey.GetState(ref pOutValue, npadId); break; case NpadStyle.Handheld: NpadHandheld.GetState(ref pOutValue, npadId); break; case NpadStyle.JoyDual: NpadJoyDual.GetState(ref pOutValue, npadId); break; case NpadStyle.JoyLeft: NpadJoyLeft.GetState(ref pOutValue, npadId); break; case NpadStyle.JoyRight: NpadJoyRight.GetState(ref pOutValue, npadId); break; } pOutValue.preButtons = preButtons; }
public static int GetStates( [Out] NpadStateArrayItem[] pOutValues, int count, NpadId npadId, NpadStyle npadStyle) { switch (npadStyle) { case NpadStyle.FullKey: return(NpadFullKey.GetStates(pOutValues, count, npadId)); case NpadStyle.Handheld: return(NpadHandheld.GetStates(pOutValues, count, npadId)); case NpadStyle.JoyDual: return(NpadJoyDual.GetStates(pOutValues, count, npadId)); case NpadStyle.JoyLeft: return(NpadJoyLeft.GetStates(pOutValues, count, npadId)); case NpadStyle.JoyRight: return(NpadJoyRight.GetStates(pOutValues, count, npadId)); } return(0); }