public override bool GamePadButtonDown(GameTime gameTime, GamePadButtonEventArgs e) { var selected = Game.Client.HotbarSelection; switch (e.Button) { case Buttons.LeftShoulder: selected--; if (selected < 0) selected = 8; if (selected > 8) selected = 0; Game.Client.HotbarSelection = selected; break; case Buttons.RightShoulder: selected++; if (selected < 0) selected = 8; if (selected > 8) selected = 0; Game.Client.HotbarSelection = selected; break; case Buttons.A: if (Math.Floor(Game.Client.Position.Y) == Game.Client.Position.Y) Game.Client.Velocity += TrueCraft.API.Vector3.Up * 0.3; break; } return false; }
/// <summary> /// GamePadButton down event handler -- added solely to work-around problem in "Back" button handling /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void RefAppPlayer_GamePadButtonDown(object sender, GamePadButtonEventArgs e) { if (GamePadButton.Back == e.Button) { // Work-around problem in MediaTransport.cs in the ADK Platform that neglects to set this. e.Handled = true; } }
private void FullScreenPlayer_GamePadButtonDown(object sender, GamePadButtonEventArgs e) { if (e.Button == GamePadButton.X) { if (NavigationService.CanGoBack) { NavigationService.GoBack(); } } }
private void OnGamePadButtonDown(object sender, GamePadButtonEventArgs e) { foreach (var module in InputModules) { var input = module as IInputModule; if (input != null) { if (input.GamePadButtonDown(GameTime, e)) break; } } }
public override bool GamePadButtonDown(GameTime gameTime, GamePadButtonEventArgs e) { var selected = Game.Client.HotBarSelection; switch (e.Button) { case Buttons.LeftShoulder: selected--; if (selected < 0) { selected = 8; } if (selected > 8) { selected = 0; } Game.Client.HotBarSelection = selected; break; case Buttons.RightShoulder: selected++; if (selected < 0) { selected = 8; } if (selected > 8) { selected = 0; } Game.Client.HotBarSelection = selected; break; case Buttons.A: if (Math.Floor(Game.Client.Position.Y) == Game.Client.Position.Y) { Game.Client.Velocity += Directions.Up * 0.3f; } break; } return(false); }
private void OnGamePadButtonDown(object sender, GamePadButtonEventArgs e) { if (!IsActive) { return; } foreach (var module in InputModules) { if (!(module is IInputModule input)) { continue; } if (input.GamePadButtonDown(GameTime, e)) { break; } } }
void LayoutRoot_GamePadButtonDown(object sender, GamePadButtonEventArgs e) { GamePadButtonDown += new EventHandler<GamePadButtonEventArgs>(HLSPlayerPage_GamePadButtonDown); }
void HLSPlayerPage_GamePadButtonDown(object sender, GamePadButtonEventArgs e) { }
private void OnGamePadButtonUp(object sender, GamePadButtonEventArgs e) { foreach (var module in InputModules) { var input = module as IInputModule; if (input != null) { if (input.GamePadButtonUp(GameTime, e)) break; } } }
/// <summary> /// Raises the ButtonUp event. This is automatically raised by an appropriately configured /// GamePadEvents object, but this allows for programmatic raising of events. /// </summary> public void OnButtonUp(object sender, GamePadButtonEventArgs args) { if (ButtonUp != null) { ButtonUp(sender, args); } }
public virtual bool GamePadButtonUp(GameTime gameTime, GamePadButtonEventArgs e) { return(false); }