static public bool IsBinaryControlDown(BinaryControls control, PlayerIndex player, InputState state) { int controlInt = (int)control; if (controlInt <= 254) { return (state.KeyState[(int)player].IsKeyDown((Keys)controlInt)); } else if (controlInt <= 279) { return (state.PadState[(int)player].IsButtonDown((Buttons)(1 << (controlInt - 255)))); } else if (controlInt <= 290) { MouseState ms = state.GetMouseState((int)player); switch ((MouseButtons)(1 << (controlInt - 286))) { case MouseButtons.Left: return (ms.LeftButton == ButtonState.Pressed); case MouseButtons.Middle: return (ms.MiddleButton == ButtonState.Pressed); case MouseButtons.Right: return (ms.RightButton == ButtonState.Pressed); case MouseButtons.XButton1: return (ms.XButton1 == ButtonState.Pressed); case MouseButtons.XButton2: return (ms.XButton2 == ButtonState.Pressed); } } return false; }
public bool IsNewBinaryControlPress(BinaryControls control, PlayerIndex player) { int controlInt = (int)control; if (controlInt <= 290) { return IsBinaryControlDown(control, player, CurrentState) && !IsBinaryControlDown(control, player, LastState); } else { if ((int)player == InputState.MouseUser) { switch (control) { case BinaryControls.ScrollWheelDown: return (ScrollWheelDiff() < 0); case BinaryControls.ScrollWheelUp: return (ScrollWheelDiff() > 0); } } return false; } }
public static bool IsBinaryControlDown(BinaryControls control, PlayerIndex player, InputState state) { int controlInt = (int)control; if (controlInt <= 254) { return (state.KeyState[(int)player].IsKeyDown((Keys)controlInt)); } else if (controlInt <= 279) { return (state.PadState[(int)player].IsButtonDown((Buttons)(1 << (controlInt - 255)))); } else if (controlInt <= 290) { MouseState ms = state.GetMouseState((int)player); switch ((MouseButtons)(1 << (controlInt - 286))) { case MouseButtons.Left: return (ms.LeftButton == ButtonState.Pressed); case MouseButtons.Middle: return (ms.MiddleButton == ButtonState.Pressed); case MouseButtons.Right: return (ms.RightButton == ButtonState.Pressed); case MouseButtons.XButton1: return (ms.XButton1 == ButtonState.Pressed); case MouseButtons.XButton2: return (ms.XButton2 == ButtonState.Pressed); } } return false; }
public bool IsNewBinaryControlPress(BinaryControls control, PlayerIndex player) { int controlInt = (int)control; if (controlInt <= 290) { return IsBinaryControlDown(control, player, CurrentState) && !IsBinaryControlDown(control, player, LastState); } else { if ((int)player == InputState.MouseUser) { switch (control) { case BinaryControls.ScrollWheelDown: return (ScrollWheelDiff() < 0); case BinaryControls.ScrollWheelUp: return (ScrollWheelDiff() > 0); } } return false; } }
public bool IsBinaryControlDown(BinaryControls control, PlayerIndex player) { return IsBinaryControlDown(control, player, CurrentState); }
public bool IsBinaryControlDown(BinaryControls control, PlayerIndex player) { return IsBinaryControlDown(control, player, CurrentState); }