public GamePadDPad(Microsoft.Xna.Framework.Input.ButtonState upValue, Microsoft.Xna.Framework.Input.ButtonState downValue, Microsoft.Xna.Framework.Input.ButtonState leftValue, Microsoft.Xna.Framework.Input.ButtonState rightValue) { _down = downValue; _left = leftValue; _right = rightValue; _up = upValue; }
private static Microsoft.Xna.Framework.Input.Buttons AddButtonIfPressed(Microsoft.Xna.Framework.Input.Buttons originalButtonState, SharpDX.XInput.GamepadButtonFlags buttonFlags, SharpDX.XInput.GamepadButtonFlags xInputButton, Microsoft.Xna.Framework.Input.Buttons xnaButton) { Microsoft.Xna.Framework.Input.ButtonState buttonState = ConvertToButtonState(buttonFlags, xInputButton); return(buttonState == Microsoft.Xna.Framework.Input.ButtonState.Pressed ? originalButtonState | xnaButton : originalButtonState); }
private void DispatchClickEvent(IBrowserHost host, Microsoft.Xna.Framework.Input.ButtonState currentState, Microsoft.Xna.Framework.Input.ButtonState lastState, Vector2 relativeMousePosition, MouseButtonType mouseButtonType, CefEventFlags eventFlags) { if (lastState == Microsoft.Xna.Framework.Input.ButtonState.Released && currentState == Microsoft.Xna.Framework.Input.ButtonState.Pressed) { host.SendMouseClickEvent((int)relativeMousePosition.X, (int)relativeMousePosition.Y, mouseButtonType, false, 1, eventFlags); } else if (lastState == Microsoft.Xna.Framework.Input.ButtonState.Pressed && currentState == Microsoft.Xna.Framework.Input.ButtonState.Released) { host.SendMouseClickEvent((int)relativeMousePosition.X, (int)relativeMousePosition.Y, mouseButtonType, true, 1, eventFlags); } }
public MouseState(int x, int y, int scrollWheel, Microsoft.Xna.Framework.Input.ButtonState leftButton, Microsoft.Xna.Framework.Input.ButtonState middleButton, Microsoft.Xna.Framework.Input.ButtonState rightButton, Microsoft.Xna.Framework.Input.ButtonState xButton1, Microsoft.Xna.Framework.Input.ButtonState xButton2) { this.x = x; this.y = y; this.wheel = scrollWheel; this.left = leftButton; this.right = rightButton; this.middle = middleButton; this.xb1 = xButton1; this.xb2 = xButton2; }
public static ButtonState ToInterface(this Microsoft.Xna.Framework.Input.ButtonState state) { return(state == Microsoft.Xna.Framework.Input.ButtonState.Pressed ? ButtonState.Pressed : ButtonState.Released); }