コード例 #1
0
ファイル: GamePadDPad.cs プロジェクト: leha-bot/Mono.XNA
 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;
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 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);
     }
 }
コード例 #4
0
ファイル: MouseState.cs プロジェクト: leha-bot/Mono.XNA
 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;
 }
コード例 #5
0
 public static ButtonState ToInterface(this Microsoft.Xna.Framework.Input.ButtonState state)
 {
     return(state == Microsoft.Xna.Framework.Input.ButtonState.Pressed ? ButtonState.Pressed : ButtonState.Released);
 }